Merge pull request #1851 from khaledhosny/fix-sbix-extents
Fix sbix glyph extents
This commit is contained in:
commit
04c11a19b7
|
@ -235,9 +235,9 @@ struct sbix
|
||||||
const PNGHeader &png = *blob->as<PNGHeader>();
|
const PNGHeader &png = *blob->as<PNGHeader>();
|
||||||
|
|
||||||
extents->x_bearing = x_offset;
|
extents->x_bearing = x_offset;
|
||||||
extents->y_bearing = y_offset;
|
extents->y_bearing = png.IHDR.height + y_offset;
|
||||||
extents->width = png.IHDR.width;
|
extents->width = png.IHDR.width;
|
||||||
extents->height = png.IHDR.height;
|
extents->height = -png.IHDR.height;
|
||||||
|
|
||||||
/* Convert to font units. */
|
/* Convert to font units. */
|
||||||
if (strike_ppem)
|
if (strike_ppem)
|
||||||
|
|
|
@ -426,9 +426,9 @@ test_hb_ot_color_png (void)
|
||||||
g_assert (strncmp (data + 1, "PNG", 3) == 0);
|
g_assert (strncmp (data + 1, "PNG", 3) == 0);
|
||||||
hb_font_get_glyph_extents (sbix_font, 1, &extents);
|
hb_font_get_glyph_extents (sbix_font, 1, &extents);
|
||||||
g_assert_cmpint (extents.x_bearing, ==, 0);
|
g_assert_cmpint (extents.x_bearing, ==, 0);
|
||||||
g_assert_cmpint (extents.y_bearing, ==, 0);
|
g_assert_cmpint (extents.y_bearing, ==, 800);
|
||||||
g_assert_cmpint (extents.width, ==, 800);
|
g_assert_cmpint (extents.width, ==, 800);
|
||||||
g_assert_cmpint (extents.height, ==, 800);
|
g_assert_cmpint (extents.height, ==, -800);
|
||||||
hb_blob_destroy (blob);
|
hb_blob_destroy (blob);
|
||||||
hb_font_destroy (sbix_font);
|
hb_font_destroy (sbix_font);
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -1 +1,2 @@
|
||||||
../fonts/ee39587d13b2afa5499cc79e45780aa79293bbd4.ttf:--font-funcs=ot --show-extents:U+1F42F:[gid1=0+2963<0,2179,2963,-2789>]
|
../fonts/ee39587d13b2afa5499cc79e45780aa79293bbd4.ttf:--font-funcs=ot --show-extents:U+1F42F:[gid1=0+2963<0,2179,2963,-2789>]
|
||||||
|
../fonts/fcbaa518d3cce441ed37ae3b1fed6a19e9b54efd.ttf:--font-funcs=ot --show-extents:U+1F600:[gid4=0+2550<0,1898,2555,-2405>]
|
||||||
|
|
Loading…
Reference in New Issue