mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 15:31:05 +01:00
calculate extents based on scaled then rounded values; undo two of the earlier test result adjustments
This commit is contained in:
1 parent
1d02e9c63b
commit
d01ebeae21
2 files changed
+4
-4
No files matched your search
@@ -944,9 +944,9 @@ struct glyf
|
||||
return;
|
||||
}
|
||||
extents->x_bearing = font->em_scalef_x (min_x);
|
||||
extents->width = font->em_scalef_x (max_x - min_x);
|
||||
extents->width = font->em_scalef_x (max_x) - extents->x_bearing;
|
||||
extents->y_bearing = font->em_scalef_y (max_y);
|
||||
extents->height = font->em_scalef_y (min_y - max_y);
|
||||
extents->height = font->em_scalef_y (min_y) - extents->y_bearing;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -55,7 +55,7 @@ test_extents_tt_var (void)
|
||||
|
||||
g_assert_cmpint (extents.x_bearing, ==, 0);
|
||||
g_assert_cmpint (extents.y_bearing, ==, 874);
|
||||
g_assert_cmpint (extents.width, ==, 550);
|
||||
g_assert_cmpint (extents.width, ==, 551);
|
||||
g_assert_cmpint (extents.height, ==, -874);
|
||||
|
||||
hb_font_destroy (font);
|
||||
@@ -186,7 +186,7 @@ test_extents_tt_var_comp (void)
|
||||
g_assert_cmpint (extents.x_bearing, ==, 19);
|
||||
g_assert_cmpint (extents.y_bearing, ==, 663);
|
||||
g_assert_cmpint (extents.width, ==, 519);
|
||||
g_assert_cmpint (extents.height, ==, -894);
|
||||
g_assert_cmpint (extents.height, ==, -895);
|
||||
|
||||
result = hb_font_get_glyph_extents (font, 3, &extents); /* Cacute, acute y-scaled by 0.8, with unscaled component offset (default) */
|
||||
g_assert (result);
|
||||
|
||||
Reference in new issue
Block a user