File tree 2 files changed +12
-1
lines changed
installer-downloader/src/winapi_impl
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
pub fn main ( ) {
10
10
nwg:: init ( ) . expect ( "Failed to init Native Windows GUI" ) ;
11
- nwg:: Font :: set_global_family ( "Segoe UI" ) . expect ( "Failed to set default font" ) ;
11
+ let mut global_font = nwg:: Font :: default ( ) ;
12
+ nwg:: FontBuilder :: new ( )
13
+ . family ( "Segoe UI" )
14
+ . size_absolute ( ui:: FONT_HEIGHT )
15
+ . build ( & mut global_font)
16
+ . unwrap ( ) ;
17
+ nwg:: Font :: set_global_default ( Some ( global_font) ) ;
12
18
13
19
// Load "global" values and resources
14
20
let environment = match Environment :: load ( ) {
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ use crate::resource::{
20
20
21
21
use super :: delegate:: QueueContext ;
22
22
23
+ /// Font height
24
+ pub const FONT_HEIGHT : u32 = 16 ;
25
+
23
26
static BANNER_IMAGE_DATA : & [ u8 ] = include_bytes ! ( "../../assets/logo-icon.png" ) ;
24
27
static BANNER_TEXT_IMAGE_DATA : & [ u8 ] = include_bytes ! ( "../../assets/logo-text.png" ) ;
25
28
static ERROR_IMAGE_DATA : & [ u8 ] = include_bytes ! ( "../../assets/alert-circle.png" ) ;
@@ -473,6 +476,8 @@ fn create_link_font() -> Result<&'static nwg::Font, nwg::NwgError> {
473
476
// SAFETY: Trivially safe. `LOGFONTW` is a C struct
474
477
let mut logfont: LOGFONTW = unsafe { std:: mem:: zeroed ( ) } ;
475
478
logfont. lfUnderline = 1 ;
479
+ logfont. lfHeight = -i32:: try_from ( FONT_HEIGHT ) . unwrap ( ) ;
480
+
476
481
for ( dest, src) in logfont. lfFaceName . iter_mut ( ) . zip ( face_name) {
477
482
* dest = src;
478
483
}
You can’t perform that action at this time.
0 commit comments