[autofit] Fix scaling of HarfBuzz shaping.

* src/autofit/hbshim.c (af_get_char_index): Scale to units per EM.
This commit is contained in:
Werner Lemberg 2014-01-03 18:09:36 +01:00
parent ea0367fbfe
commit f45749b05b
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2014-01-03 Werner Lemberg <wl@gnu.org>
[autofit] Fix scaling of HarfBuzz shaping.
* src/autofit/hbshim.c (af_get_char_index): Scale to units per EM.
2014-01-03 Werner Lemberg <wl@gnu.org>
[autofit] Better ftgrid support.

View File

@ -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] );