return -1;
}
-static void face_set_size(FT_Face face, double size);
-
static void buggy_font_workaround(FT_Face face)
{
// Some fonts have zero Ascender/Descender fields in 'hhea' table.
buggy_font_workaround(face);
font->faces[font->n_faces++] = face;
- face_set_size(face, font->size);
+ ass_face_set_size(face, font->size);
free(path);
return font->n_faces - 1;
}
}
}
-static void face_set_size(FT_Face face, double size)
+void ass_face_set_size(FT_Face face, double size)
{
TT_HoriHeader *hori = FT_Get_Sfnt_Table(face, ft_sfnt_hhea);
TT_OS2 *os2 = FT_Get_Sfnt_Table(face, ft_sfnt_os2);
if (font->size != size) {
font->size = size;
for (i = 0; i < font->n_faces; ++i)
- face_set_size(font->faces[i], size);
+ ass_face_set_size(font->faces[i], size);
}
}
ASS_FontDesc *desc);
void ass_font_set_transform(ASS_Font *font, double scale_x,
double scale_y, FT_Vector *v);
+void ass_face_set_size(FT_Face face, double size);
void ass_font_set_size(ASS_Font *font, double size);
void ass_font_get_asc_desc(ASS_Font *font, uint32_t ch, int *asc,
int *desc);
info->desc = drawing->desc;
ass_drawing_free(drawing);
} else {
- double size_scaled = ensure_font_size(render_priv,
- info->font_size * render_priv->font_scale);
- ass_font_set_size(info->font, size_scaled);
+ ass_face_set_size(info->font->faces[info->face_index],
+ info->font_size);
ass_font_set_transform(info->font, info->scale_x,
info->scale_y, NULL);
// symbol might have been changed. re-get it.
render_priv->state.effect_timing;
glyphs[text_info->length].effect_skip_timing =
render_priv->state.effect_skip_timing;
- glyphs[text_info->length].font_size = render_priv->state.font_size;
+ glyphs[text_info->length].font_size = ensure_font_size(render_priv,
+ render_priv->state.font_size * render_priv->font_scale);
glyphs[text_info->length].be = render_priv->state.be;
glyphs[text_info->length].blur = render_priv->state.blur;
glyphs[text_info->length].shadow_x = render_priv->state.shadow_x;
hb_fonts[info->face_index] =
hb_ft_font_create(font->faces[info->face_index], NULL);
+ ass_face_set_size(font->faces[info->face_index], info->font_size);
+
return hb_fonts[info->face_index];
}
// set size and get glyph index
double size_scaled = ensure_font_size(render_priv,
info->font_size * render_priv->font_scale);
- ass_font_set_size(info->font, size_scaled);
ass_font_get_index(render_priv->fontconfig_priv, info->font,
info->symbol, &info->face_index, &info->glyph_index);
// shape runs share the same font face and size