diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-02-22 22:45:30 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-02-22 22:49:48 +0200 |
commit | f7733528e88a6619f82b54b59e92a9bca72c0a89 (patch) | |
tree | 8d749e4e8aed0d1361e1b45b2522e032e63ff2ec /vcl/quartz | |
parent | f0a14acc4ebe7f1192b195738540cd9f4e1435fa (diff) |
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
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 297c4dd58941..1ac73c59a60f 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -394,6 +394,17 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont 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 ) { nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - WEIGHT_NORMAL)/0.68)); |