The PostScript backend was generating image masks with packed mask
bits, when PS seems to expect each line of the mask to be padded out
to 8 bytes.
Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=407360
This is now failing as we compute NAN font metrics for bitmap-only fonts under
disabled metrics hinting. A very infamous bug excercised with PangoCairo's PDF
output.
In 02970ac8cf Vlad introduced the following
innocent-looking change:
- short min_x = INT16_MAX, max_x = INT16_MIN;
- short min_y = INT16_MAX, max_y = INT16_MIN;
+ cairo_point_int_t min = { CAIRO_RECT_INT_MIN, CAIRO_RECT_INT_MIN };
+ cairo_point_int_t max = { CAIRO_RECT_INT_MAX, CAIRO_RECT_INT_MAX };
Well, read it carefully... yeah. That caused each show glyph operation
upload a mask the size of the surface. With evince/poppler and certain
PDF files that each glyph is rendered in its own cairo_show_glyphs()
call, that meant a 20x slowdown in rendering a page of PDF.
If still wondering what's wrong with that change, here is the answer:
- cairo_point_int_t min = { CAIRO_RECT_INT_MIN, CAIRO_RECT_INT_MIN };
- cairo_point_int_t max = { CAIRO_RECT_INT_MAX, CAIRO_RECT_INT_MAX };
+ cairo_point_int_t min = { CAIRO_RECT_INT_MAX, CAIRO_RECT_INT_MAX };
+ cairo_point_int_t max = { CAIRO_RECT_INT_MIN, CAIRO_RECT_INT_MIN };
Yay for git-bisect.
I was experiencing very weird rendering problems and crashes in evince with
pixman 0.9.4. Upgrading to pixman 0.9.6 fixed the all. Lets just require it.
First, seems like we were rejecting degenerate font matrix right away
at the constructor. Don't do that.
Next, PS/PDF were inverting the font scale matrix, assuming that it's
invertible. We now keep the inverse too, so they can use it. For the
case of a size 0 font, both the scale matrix and its invert are set to
0,0,0,0. That's safe, even if slightly inconsistent.
The data parameter from get_image was never really used; get rid of it and clean up
callers. Also get rid of a chunk of dead code in release_dest_image.
There were a few corner cases that the win32 surface was failing
at when there was an initial clip set; the win32-printing surface
had more serious problems when painting meta surface patterns.
This cleans up the initial DC clip tracking for both surfaces.
cairo_rectangle_int16_t was being used in a number of places instead
of cairo_rectangle_int_t, which led to memory corruption when cairo was
using a fixed point format with a bigger space than 16.16 (such as 24.8).
It's a common idiom to stroke degenerate sub-paths made with
cairo_move_to(x,y);cairo_rel_line_to(0,0) to draw dots. Test
that we get the desired extents from cairo_fill_extents,
cairo_stroke_extents, and cairo_path_extents for these cases.
Also document that the cairo_path_extents result is equivalent
to the limit of stroking with CAIRO_LINE_CAP_ROUND, (so that
these "dot" points are included), as the line width
approaches 0.0 .
This new function gets the extents of the current path, whether
or not they would be inked by a 'fill'. It differs from
cairo_fill_extents() when the area enclosed by the path is 0.
Includes documentation and updated test.
_cairo_path_fixed_bounds can use the new _interpret_flat mechanism; this
results in tighter bounds; previously the bounds followed the control
points of the beziers, whereas now they are the bounds of the curve.
cairo-scaled-fonts-subsets.c reserves position 0 in each subset for
glyph 0 (.notdef) as the font embedding of each font type requires
.notdef as the first glyph. For some reason this was done by reserving
the position then inserting glyph 0 in the collect function instead of
just adding the glyph to the hash table when the subset is
created. The problem this caused was that when an application called
show_glyphs() with glyph 0, the glyph was added to the hash table
(because it was not already there) resulting in two .notdef glyphs in
the subset. This resulted in breakage in the Type 1 subsetting where
the second .notdef was not emitted and all subsequent glyphs were
moved up one place resulting in incorrect font encoding in the PS/PDF
output.
Fix this by adding .notdef to the subset hash table when the subset is
created.
This fixes#13841.