summaryrefslogtreecommitdiffstats
path: root/libass/ass_font.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2011-07-16 03:00:41 +0200
committerGrigori Goronzy <greg@blackbox>2011-07-16 03:00:41 +0200
commitab9053174b7815d2c0b9cb7a5a726cb2e183ec4e (patch)
treedc0509badd5d20334f1529fc10f70a1501a22c03 /libass/ass_font.c
parentfa7e99e3d8a78805e9acfb327786307d91c20104 (diff)
downloadlibass-ab9053174b7815d2c0b9cb7a5a726cb2e183ec4e.tar.bz2
libass-ab9053174b7815d2c0b9cb7a5a726cb2e183ec4e.tar.xz
shaper: fix run-specific font size
Make sure to set the font size for every run, as needed, to get metrics (advance/offset) for the right size.
Diffstat (limited to 'libass/ass_font.c')
-rw-r--r--libass/ass_font.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libass/ass_font.c b/libass/ass_font.c
index 954040e..d65b976 100644
--- a/libass/ass_font.c
+++ b/libass/ass_font.c
@@ -90,8 +90,6 @@ static int find_font(ASS_Library *library, char *name)
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.
@@ -160,7 +158,7 @@ static int add_face(void *fc_priv, ASS_Font *font, uint32_t ch)
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;
}
@@ -216,7 +214,7 @@ void ass_font_set_transform(ASS_Font *font, double scale_x,
}
}
-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);
@@ -251,7 +249,7 @@ void ass_font_set_size(ASS_Font *font, double size)
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);
}
}