src/hb-coretext.cc | 6 +++--- src/hb-font.cc | 5 ++--- src/hb-font.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-)
New commits: commit 717fcb51dd051ca27d8537e5cf3a32d0447f78b5 Author: Behdad Esfahbod <[email protected]> Date: Wed Oct 11 15:38:21 2017 +0200 [coretext] Minor diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index a2bbfbd1..c24ce70c 100644 --- a/src/hb-coretext.cc +++ b/src/hb-coretext.cc @@ -37,7 +37,7 @@ #endif /* https://developer.apple.com/documentation/coretext/1508745-ctfontcreatewithgraphicsfont */ -#define HB_CORETEXT_FONT_SIZE 12.0 +#define HB_CORETEXT_DEFAULT_FONT_SIZE 12.0 static void release_table_data (void *user_data) @@ -74,7 +74,7 @@ hb_coretext_face_create (CGFontRef cg_font) HB_SHAPER_DATA_ENSURE_DEFINE(coretext, face) HB_SHAPER_DATA_ENSURE_DEFINE_WITH_CONDITION(coretext, font, abs (CTFontGetSize((CTFontRef) data) - - (font->ptem <= 0 ? HB_CORETEXT_FONT_SIZE : font->ptem)) < 1) + (font->ptem <= 0 ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem)) < 1) /* * shaper face data @@ -247,7 +247,7 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font) if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return NULL; CGFontRef cg_font = (CGFontRef) HB_SHAPER_DATA_GET (face); - float ptem = font->ptem <= 0 ? HB_CORETEXT_FONT_SIZE : font->ptem; + float ptem = font->ptem <= 0 ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem; CTFontRef ct_font = create_ct_font (cg_font, ptem); commit 374bb48d902025e8b8d8acbe525ff43540daee36 Author: Behdad Esfahbod <[email protected]> Date: Wed Oct 11 15:37:50 2017 +0200 Change ptem API to make 0 mean unset diff --git a/src/hb-font.cc b/src/hb-font.cc index a43656d9..5673e66e 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -1124,7 +1124,6 @@ hb_font_create (hb_face_t *face) font->parent = hb_font_get_empty (); font->face = hb_face_reference (face); font->klass = hb_font_funcs_get_empty (); - font->ptem = -1; font->x_scale = font->y_scale = hb_face_get_upem (face); @@ -1201,7 +1200,7 @@ hb_font_get_empty (void) 0, /* x_ppem */ 0, /* y_ppem */ - -1, /* ptem */ + 0, /* ptem */ 0, /* num_coords */ NULL, /* coords */ @@ -1598,7 +1597,7 @@ hb_font_set_ptem (hb_font_t *font, float ptem) * hb_font_get_ptem: * @font: a font. * - * Gets the "point size" of the font. A value of -1 means unset. + * Gets the "point size" of the font. A value of 0 means unset. * * Return value: Point size. * diff --git a/src/hb-font.h b/src/hb-font.h index 8fb1849d..540cdcab 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -609,7 +609,7 @@ hb_font_get_ppem (hb_font_t *font, /* * Point size per EM. Used for optical-sizing in CoreText. - * A -1 means "not set". + * A value of zero means "not set". */ HB_EXTERN void hb_font_set_ptem (hb_font_t *font, float ptem); _______________________________________________ HarfBuzz mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/harfbuzz
