Kaydet (Commit) f7733528 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

tdf#68889: Fix the weight reported by the system for the problematic font

Like the previous fix for Courier Std. Let's hope there won't be a lot
of these special cases. Maybe some generic heuristic would be better.
Like if a font's GetStyleName() is "Medium", "Medium Oblique", or
"Medium Italic" then always force its weight to be WEIGHT_NORMAL?

Change-Id: I204655cd9c4e32d5cbbd68bb93c6282d23993b80
üst f0a14acc
...@@ -394,6 +394,17 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont ...@@ -394,6 +394,17 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont
fWeight = 0; fWeight = 0;
} }
// tdf#68889: Ditto for Gill Sans MT Pro. Here I can kinda understand it, maybe the
// kCTFontWeightTrait is intended to give a subjective "optical" impression of how the font
// looks, and Gill Sans MT Pro Medium is kinda heavy. But with the way LibreOffice uses fonts,
// we still should think of it as being "medium" weight.
if (rDFA.GetFamilyName() == "Gill Sans MT Pro" &&
(rDFA.GetStyleName() == "Medium" || rDFA.GetStyleName() == "Medium Italic") &&
fWeight > 0.2)
{
fWeight = 0;
}
if( fWeight > 0 ) if( fWeight > 0 )
{ {
nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - WEIGHT_NORMAL)/0.68)); nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - WEIGHT_NORMAL)/0.68));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment