Merge pull request #1851 from khaledhosny/fix-sbix-extents

Fix sbix glyph extents
This commit is contained in:
Khaled Hosny 2019-07-22 16:44:47 +02:00 committed by GitHub
commit 04c11a19b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View File

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

View File

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

View File

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