summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2016-02-22 15:12:27 +0900
committerBehdad Esfahbod <behdad@behdad.org>2016-02-22 15:12:27 +0900
commit04c64431530a4a6d9ebd33674c4665a8e6d25bdd (patch)
tree74b6846f045b801a491b30c0f2ac430d3baa1230
parent62c2711121fe78f373c15c0f53090b62b52d11c1 (diff)
[coretext] Ignore PPEM in font size selection
-rw-r--r--src/hb-coretext.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index 8c18fdf8..446e4126 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -157,16 +157,10 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font)
hb_face_t *face = font->face;
hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
- /* Choose a CoreText font size and calculate multipliers to convert to HarfBuzz space. */
- /* TODO: use upem instead of 36? */
- CGFloat font_size = 36.; /* Default... */
- /* No idea if the following is even a good idea. */
- if (font->y_ppem)
- font_size = font->y_ppem;
-
- if (font_size < 0)
- font_size = -font_size;
- data->ct_font = CTFontCreateWithGraphicsFont (face_data, font_size, NULL, NULL);
+ /* We use 36pt size instead of UPEM, because CoreText implements the 'trak' table,
+ * which can make the font too tight at large sizes. 36pt should be a good semi-neutral
+ * size. */
+ data->ct_font = CTFontCreateWithGraphicsFont (face_data, 36., NULL, NULL);
if (unlikely (!data->ct_font)) {
DEBUG_MSG (CORETEXT, font, "Font CTFontCreateWithGraphicsFont() failed");
free (data);