diff --git a/ChangeLog b/ChangeLog index 1511c7623..b5352e63e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-01-03 Werner Lemberg + + [autofit] Fix scaling of HarfBuzz shaping. + + * src/autofit/hbshim.c (af_get_char_index): Scale to units per EM. + 2014-01-03 Werner Lemberg [autofit] Better ftgrid support. diff --git a/src/autofit/hbshim.c b/src/autofit/hbshim.c index aec545b72..b3525450a 100644 --- a/src/autofit/hbshim.c +++ b/src/autofit/hbshim.c @@ -369,6 +369,8 @@ if ( feature ) { + FT_UInt upem = metrics->globals->face->units_per_EM; + hb_font_t* font = metrics->globals->hb_font; hb_buffer_t* buf = hb_buffer_create(); @@ -379,6 +381,9 @@ unsigned int gcount; + /* we shape at a size of units per EM; this means font units */ + hb_font_set_scale( font, upem, upem ); + /* XXX: is this sufficient for a single character of any script? */ hb_buffer_set_direction( buf, HB_DIRECTION_LTR ); hb_buffer_set_script( buf, scripts[style_class->script] );