Use upstream font weight values for windows.

This commit is contained in:
Josh Matthews 2018-10-09 17:09:46 -04:00
parent 171469c27c
commit 8a2eec2714

View file

@ -209,21 +209,7 @@ impl FontInfo {
FontStyle::Oblique => GenericFontStyle::Oblique(StyleFontStyle::default_angle()), FontStyle::Oblique => GenericFontStyle::Oblique(StyleFontStyle::default_angle()),
FontStyle::Italic => GenericFontStyle::Italic, FontStyle::Italic => GenericFontStyle::Italic,
}; };
let weight = StyleFontWeight(match font.weight() { let weight = StyleFontWeight(font.weight().to_u32() as f32);
FontWeight::Thin => 100.,
FontWeight::ExtraLight => 200.,
FontWeight::Light => 300.,
// slightly grayer gray
FontWeight::SemiLight => 300.,
FontWeight::Regular => 400.,
FontWeight::Medium => 500.,
FontWeight::SemiBold => 600.,
FontWeight::Bold => 700.,
FontWeight::ExtraBold => 800.,
FontWeight::Black => 900.,
// slightly blacker black
FontWeight::ExtraBlack => 1000.,
});
let stretch = StyleFontStretch(NonNegative( let stretch = StyleFontStretch(NonNegative(
match font.stretch() { match font.stretch() {
FontStretch::Undefined => FontStretchKeyword::Normal, FontStretch::Undefined => FontStretchKeyword::Normal,