summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/fitz/font.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index 67dd726c..186b7bc8 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -199,6 +199,8 @@ float fz_font_ascender(fz_context *ctx, fz_font *font)
else
{
FT_Face face = font->ft_face;
+ if (face->ascender == 0)
+ return 0.8f;
return (float)face->ascender / face->units_per_EM;
}
}
@@ -210,6 +212,8 @@ float fz_font_descender(fz_context *ctx, fz_font *font)
else
{
FT_Face face = font->ft_face;
+ if (face->descender == 0)
+ return -0.2f;
return (float)face->descender / face->units_per_EM;
}
}