diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-11-07 14:26:26 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-11-07 14:54:40 +0100 |
commit | 135a83731df60dc321ea6a2b66c010f6232530dc (patch) | |
tree | 51ebc247a5dd3e22e9387296e5925d3c8c6dabb5 /source | |
parent | 2c766bcf417f68bfbd688d10f0dd8065507d7225 (diff) | |
download | mupdf-135a83731df60dc321ea6a2b66c010f6232530dc.tar.xz |
Handle bogus font ascender and descender values.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/font.c | 4 |
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; } } |