[Libreoffice-commits] core.git: vcl/quartz
Tor Lillqvist
tml at collabora.com
Thu Feb 22 20:58:46 UTC 2018
vcl/quartz/ctfonts.cxx | 11 +++++++++++
1 file changed, 11 insertions(+)
New commits:
commit f7733528e88a6619f82b54b59e92a9bca72c0a89
Author: Tor Lillqvist <tml at collabora.com>
Date: Thu Feb 22 22:45:30 2018 +0200
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
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));
More information about the Libreoffice-commits
mailing list