added cff1_legacyops.otf as test-ot-extents-cff test case
fixed roll operator bugs uncovered by the test
This commit is contained in:
parent
588518ea51
commit
83c5298f33
@ -603,13 +603,13 @@ struct ArgStack : Stack<ARG, 513>
|
||||
|
||||
inline void reverse_range (int i, int j)
|
||||
{
|
||||
assert (i >= 0 && i < j);
|
||||
assert (i >= 0 && i <= j);
|
||||
ARG tmp;
|
||||
while (i < j)
|
||||
{
|
||||
tmp = S::elements[i];
|
||||
S::elements[i++] = S::elements[j];
|
||||
S::elements[j++] = tmp;
|
||||
S::elements[j--] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
test/api/fonts/cff1_legacyops.otf
Normal file
BIN
test/api/fonts/cff1_legacyops.otf
Normal file
Binary file not shown.
@ -52,6 +52,28 @@ test_extents_cff1 (void)
|
||||
hb_font_destroy (font);
|
||||
}
|
||||
|
||||
static void
|
||||
test_extents_cff1_legacyops (void)
|
||||
{
|
||||
hb_face_t *face = hb_subset_test_open_font ("fonts/cff1_legacyops.otf");
|
||||
g_assert (face);
|
||||
hb_font_t *font = hb_font_create (face);
|
||||
hb_face_destroy (face);
|
||||
g_assert (font);
|
||||
hb_ot_font_set_funcs (font);
|
||||
|
||||
hb_glyph_extents_t extents;
|
||||
hb_bool_t result = hb_font_get_glyph_extents (font, 0, &extents);
|
||||
g_assert (result);
|
||||
|
||||
g_assert_cmpint (extents.x_bearing, ==, 20);
|
||||
g_assert_cmpint (extents.y_bearing, ==, 800);
|
||||
g_assert_cmpint (extents.width, ==, 160);
|
||||
g_assert_cmpint (extents.height, ==, -810);
|
||||
|
||||
hb_font_destroy (font);
|
||||
}
|
||||
|
||||
static void
|
||||
test_extents_cff2 (void)
|
||||
{
|
||||
@ -90,6 +112,7 @@ main (int argc, char **argv)
|
||||
hb_test_init (&argc, &argv);
|
||||
|
||||
hb_test_add (test_extents_cff1);
|
||||
hb_test_add (test_extents_cff1_legacyops);
|
||||
hb_test_add (test_extents_cff2);
|
||||
|
||||
return hb_test_run ();
|
||||
|
Loading…
Reference in New Issue
Block a user