[Vertical] Fix GPOS y-advance direction

This commit is contained in:
Behdad Esfahbod 2011-05-19 19:19:50 -04:00
parent 67d51ff961
commit cc2086d67c
1 changed files with 4 additions and 3 deletions

View File

@ -104,11 +104,11 @@ struct ValueFormat : USHORT
if (!format) return; if (!format) return;
/* design units -> fractional pixel */
if (format & xPlacement) glyph_pos.x_offset += font->em_scale_x (get_short (values++)); if (format & xPlacement) glyph_pos.x_offset += font->em_scale_x (get_short (values++));
if (format & yPlacement) glyph_pos.y_offset += font->em_scale_y (get_short (values++)); if (format & yPlacement) glyph_pos.y_offset += font->em_scale_y (get_short (values++));
if (format & xAdvance) glyph_pos.x_advance += font->em_scale_x (get_short (values++)); if (format & xAdvance) glyph_pos.x_advance += font->em_scale_x (get_short (values++));
if (format & yAdvance) glyph_pos.y_advance += font->em_scale_y (get_short (values++)); /* y_advance values grow downward but font-space grows upward, hence negation */
if (format & yAdvance) glyph_pos.y_advance -= font->em_scale_y (get_short (values++));
if (!has_device ()) return; if (!has_device ()) return;
@ -128,7 +128,8 @@ struct ValueFormat : USHORT
if (x_ppem) glyph_pos.x_advance += (base + get_device (values++)).get_x_delta (font); else values++; if (x_ppem) glyph_pos.x_advance += (base + get_device (values++)).get_x_delta (font); else values++;
} }
if (format & yAdvDevice) { if (format & yAdvDevice) {
if (y_ppem) glyph_pos.y_advance += (base + get_device (values++)).get_y_delta (font); else values++; /* y_advance values grow downward but font-space grows upward, hence negation */
if (y_ppem) glyph_pos.y_advance -= (base + get_device (values++)).get_y_delta (font); else values++;
} }
} }