diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2011-07-26 16:09:55 +0100 |
---|---|---|
committer | Robin Watts <robin@ghostscript.com> | 2011-07-26 19:33:43 +0000 |
commit | 93701ab27b4d50f5d27da43f34d432e1963ce337 (patch) | |
tree | 58e3d91238e9866d3aecb8fb8c4047dc2c093bf0 /fitz/res_font.c | |
parent | 9aba12aaa87f1da7b9047d1a86ad0d02298193ff (diff) | |
download | mupdf-93701ab27b4d50f5d27da43f34d432e1963ce337.tar.xz |
Fix bug 692354: Horizontal white lines in images.
The problem is due to abutting images showing gaps between them.
These gaps are due to a combination of rounding errors, and anti-aliasing
effects on the edge of images.
The solution is to selectively 'grid fit' images.
If an image is part of a type 3 font, we do NOT want to grid fit it, as
this is where the sub pixel positioning makes a huge difference.
If an image is displayed with alpha, then we don't want to grid fit it
(as grid fitting will tend to make the edges of images overlap by 1
pixel, and will hence produce nasty effects).
Otherwise, we will grid fit; Grid fit in this sense is where we expand
an image to completely fill the pixel grid that it touches (i.e. the
extents for the image are expanded to pixel boundaries; no half full
pixels are left around the edges).
The only real change of note here is in how we detect that we are in a
type 3 charproc; we add a new draw device creation function that we call
in the type3 charproc case that sets a flag that the drawing functions
can check.
Diffstat (limited to 'fitz/res_font.c')
-rw-r--r-- | fitz/res_font.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fitz/res_font.c b/fitz/res_font.c index 948b2bdd..e5027d5b 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -546,7 +546,7 @@ fz_render_t3_glyph(fz_font *font, int gid, fz_matrix trm) fz_clear_pixmap(glyph); cache = fz_new_glyph_cache(); - dev = fz_new_draw_device(cache, glyph); + dev = fz_new_draw_device_type3(cache, glyph); error = font->t3run(font->t3xref, font->t3resources, contents, dev, ctm); if (error) fz_catch(error, "cannot draw type3 glyph"); |