summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-08-01 12:17:25 +0100
committerRobin Watts <robin.watts@artifex.com>2016-08-01 12:47:14 +0100
commitb08617e17bfbc8504dc00cba724817ddf88b0203 (patch)
treec99f49f694e75c2bf6f1840c64a2ee69a52654c5 /source/fitz
parentf496b7153b8e8ab5e9b9787d4176656af235cd9b (diff)
downloadmupdf-b08617e17bfbc8504dc00cba724817ddf88b0203.tar.xz
Bug 696984: Badly rendered characters.
The type3 font(s) in the file have an invalid (0 sized) bbox, hence the clipping of the chars goes wrong. We now spot the invalid bbox, and suppress the clipping.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/font.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index 79cd050a..a291eab8 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -176,6 +176,7 @@ fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float x
font->bbox.y0 = -1;
font->bbox.x1 = 2;
font->bbox.y1 = 2;
+ font->invalid_bbox = 1;
}
else
{
@@ -1203,11 +1204,14 @@ fz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_rect *bounds)
fz_rethrow(ctx);
}
- /* clip the bbox size to a reasonable maximum for degenerate glyphs */
- big = font->bbox;
- m = fz_max(fz_abs(big.x1 - big.x0), fz_abs(big.y1 - big.y0));
- fz_expand_rect(&big, fz_max(fz_matrix_expansion(&font->t3matrix) * 2, m));
- fz_intersect_rect(bounds, &big);
+ if (!font->invalid_bbox)
+ {
+ /* clip the bbox size to a reasonable maximum for degenerate glyphs */
+ big = font->bbox;
+ m = fz_max(fz_abs(big.x1 - big.x0), fz_abs(big.y1 - big.y0));
+ fz_expand_rect(&big, fz_max(fz_matrix_expansion(&font->t3matrix) * 2, m));
+ fz_intersect_rect(bounds, &big);
+ }
return bounds;
}