diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index 95db7fe6e..79c86ed01 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -198,7 +198,7 @@ struct sbix struct PNGHeader { - HBUINT8 header[9]; + HBUINT8 header[16]; HBUINT32 width; HBUINT32 height; }; @@ -209,7 +209,7 @@ struct sbix hb_glyph_extents_t *extents) const { if (likely (sbix_len == 0)) - return hb_blob_get_empty (); + return false; int x_offset, y_offset; hb_blob_t *blob = reference_blob_for_glyph (glyph, x_ppem, y_ppem, @@ -221,7 +221,7 @@ struct sbix extents->x_bearing = x_offset; extents->y_bearing = y_offset; const PNGHeader &header = *blob->as(); - extents->width = header.width + 100; + extents->width = header.width; extents->height = header.height; hb_blob_destroy (blob); diff --git a/test/api/test-ot-color.c b/test/api/test-ot-color.c index bef52bfba..9cc353bad 100644 --- a/test/api/test-ot-color.c +++ b/test/api/test-ot-color.c @@ -427,8 +427,8 @@ test_hb_ot_color_png (void) hb_font_get_glyph_extents (sbix_font, 1, &extents); g_assert_cmpint (extents.x_bearing, ==, 0); g_assert_cmpint (extents.y_bearing, ==, 0); - g_assert_cmpint (extents.width, ==, 3501); - g_assert_cmpint (extents.height, ==, 20992); + g_assert_cmpint (extents.width, ==, 300); + g_assert_cmpint (extents.height, ==, 300); hb_blob_destroy (blob); hb_font_destroy (sbix_font);