[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Oct 13 08:30:32 UTC 2017


 src/hb-coretext.cc |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit c2cf68dbdffcbf45297dd161b4b6b2de667b5ae4
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Oct 13 10:30:19 2017 +0200

    [coretext] Fix build

diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index c8a4a652..22661407 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -38,13 +38,18 @@
 #endif
 
 /* https://developer.apple.com/documentation/coretext/1508745-ctfontcreatewithgraphicsfont */
-#define HB_CORETEXT_DEFAULT_FONT_SIZE 12f
+#define HB_CORETEXT_DEFAULT_FONT_SIZE 12.f
 
 static CGFloat
 coretext_font_size (float ptem)
 {
-  ptem *= 96f / 72f;
-  return ptem <= 0f ? HB_CORETEXT_DEFAULT_FONT_SIZE : ptem;
+  /* CoreText points are CSS pixels (96 per inch),
+   * NOT typographic points (72 per inch).
+   *
+   * https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
+   */
+  ptem *= 96.f / 72.f;
+  return ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : ptem;
 }
 
 static void


More information about the HarfBuzz mailing list