1 parent
7370e1b1a4
commit
499e7f936f
1 file changed
+4
-4
@@ -102,7 +102,7 @@ fn load_font(font_attr: &FontAttributes, pixel_size: u16) -> anyhow::Result<Pars
|
||||
lfEscapement: 0,
|
||||
lfOrientation: 0,
|
||||
lfWeight: font_attr.weight.to_opentype_weight() as _,
|
||||
lfItalic: if font_attr.slant != WTFontStyle::Normal {
|
||||
lfItalic: if font_attr.style != WTFontStyle::Normal {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
@@ -150,7 +150,7 @@ pub fn parse_log_font(log_font: &LOGFONTW, hdc: HDC) -> anyhow::Result<(ParsedFo
|
||||
let mut attr = FontAttributes::new(&name);
|
||||
attr.weight = config::FontWeight::from_opentype_weight(log_font.lfWeight as u16);
|
||||
if log_font.lfItalic == 1 {
|
||||
attr.slant = WTFontStyle::Italic;
|
||||
attr.style = WTFontStyle::Italic;
|
||||
}
|
||||
|
||||
let mut font_info = vec![];
|
||||
@@ -170,7 +170,7 @@ fn attributes_to_descriptor(font_attr: &FontAttributes) -> FontDescriptor {
|
||||
family_name: font_attr.family.to_string(),
|
||||
weight: FontWeight::from_u32(font_attr.weight.to_opentype_weight() as u32),
|
||||
stretch: FontStretch::Normal,
|
||||
style: match font_attr.slant {
|
||||
style: match font_attr.style {
|
||||
WTFontStyle::Italic => FontStyle::Italic,
|
||||
WTFontStyle::Oblique => FontStyle::Oblique,
|
||||
WTFontStyle::Normal => FontStyle::Normal,
|
||||
@@ -319,7 +319,7 @@ impl FontLocator for GdiFontLocator {
|
||||
let attr = FontAttributes {
|
||||
weight: WTFontWeight::from_opentype_weight(font.weight().to_u32() as _),
|
||||
stretch: WTFontStretch::from_opentype_stretch(font.stretch().to_u32() as _),
|
||||
slant: WTFontStyle::Normal,
|
||||
style: WTFontStyle::Normal,
|
||||
family: font.family_name(),
|
||||
is_fallback: true,
|
||||
is_synthetic: true,
|
||||
|
||||
Reference in new issue
Block a user