summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-10-05 14:12:20 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-10-06 11:20:16 +0200
commit56c0babe3bd6941382072a5b8209236d801a4201 (patch)
tree74d81b6e59b1f158be30d6117af2aa65a131e8fe /source
parent458907ad6e1e69cacbe7dac9f4b189f29944a844 (diff)
downloadmupdf-56c0babe3bd6941382072a5b8209236d801a4201.tar.xz
Never squish a substitute font to zero width, in case of broken font metrics.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/font.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index 5a1e61ff..d5296eb9 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -426,7 +426,8 @@ fz_adjust_ft_glyph_width(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm
else
subw = font->width_default;
- if (realw > 0)
+ /* Sanity check scaling in case of broken metrics. */
+ if (realw > 0 && subw > 0)
fz_pre_scale(trm, subw / realw, 1);
}