This commit is contained in:
Behdad Esfahbod 2018-10-31 14:22:31 -07:00
parent 995bf6c6f8
commit b9db610add
2 changed files with 15 additions and 15 deletions

View File

@ -54,23 +54,23 @@
static hb_bool_t
hb_font_get_font_h_extents_nil (hb_font_t *font HB_UNUSED,
void *font_data HB_UNUSED,
hb_font_extents_t *metrics,
hb_font_extents_t *extents,
void *user_data HB_UNUSED)
{
memset (metrics, 0, sizeof (*metrics));
memset (extents, 0, sizeof (*extents));
return false;
}
static hb_bool_t
hb_font_get_font_h_extents_default (hb_font_t *font,
void *font_data HB_UNUSED,
hb_font_extents_t *metrics,
hb_font_extents_t *extents,
void *user_data HB_UNUSED)
{
hb_bool_t ret = font->parent->get_font_h_extents (metrics);
hb_bool_t ret = font->parent->get_font_h_extents (extents);
if (ret) {
metrics->ascender = font->parent_scale_y_distance (metrics->ascender);
metrics->descender = font->parent_scale_y_distance (metrics->descender);
metrics->line_gap = font->parent_scale_y_distance (metrics->line_gap);
extents->ascender = font->parent_scale_y_distance (extents->ascender);
extents->descender = font->parent_scale_y_distance (extents->descender);
extents->line_gap = font->parent_scale_y_distance (extents->line_gap);
}
return ret;
}
@ -78,23 +78,23 @@ hb_font_get_font_h_extents_default (hb_font_t *font,
static hb_bool_t
hb_font_get_font_v_extents_nil (hb_font_t *font HB_UNUSED,
void *font_data HB_UNUSED,
hb_font_extents_t *metrics,
hb_font_extents_t *extents,
void *user_data HB_UNUSED)
{
memset (metrics, 0, sizeof (*metrics));
memset (extents, 0, sizeof (*extents));
return false;
}
static hb_bool_t
hb_font_get_font_v_extents_default (hb_font_t *font,
void *font_data HB_UNUSED,
hb_font_extents_t *metrics,
hb_font_extents_t *extents,
void *user_data HB_UNUSED)
{
hb_bool_t ret = font->parent->get_font_v_extents (metrics);
hb_bool_t ret = font->parent->get_font_v_extents (extents);
if (ret) {
metrics->ascender = font->parent_scale_x_distance (metrics->ascender);
metrics->descender = font->parent_scale_x_distance (metrics->descender);
metrics->line_gap = font->parent_scale_x_distance (metrics->line_gap);
extents->ascender = font->parent_scale_x_distance (extents->ascender);
extents->descender = font->parent_scale_x_distance (extents->descender);
extents->line_gap = font->parent_scale_x_distance (extents->line_gap);
}
return ret;
}

View File

@ -110,7 +110,7 @@ typedef struct hb_glyph_extents_t
/* func types */
typedef hb_bool_t (*hb_font_get_font_extents_func_t) (hb_font_t *font, void *font_data,
hb_font_extents_t *metrics,
hb_font_extents_t *extents,
void *user_data);
typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t;
typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t;