[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - vcl/quartz

Tor Lillqvist tml at collabora.com
Wed Feb 28 10:09:53 UTC 2018


 vcl/quartz/ctfonts.cxx |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit b15741f0bbc405afc8e4db34543d34c054120186
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
    (cherry picked from commit f7733528e88a6619f82b54b59e92a9bca72c0a89)
    Reviewed-on: https://gerrit.libreoffice.org/50497
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 4420e99378b1..6ffa2aed7ad0 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -422,6 +422,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