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.
Previously, when emitting image patterns the PDF backend used
_cairo_pattern_acquire_surface to get the image. For reflected images
this would return an image containing four images in a reflect
pattern. When drawn in a PDF pattern (which only does repeating
patterns) this would create the reflected pattern in PDF.
For some reason _cairo_pattern_acquire_surface is no longer returning
a reflected image pattern.
This is fixed by only using _cairo_surface_acquire_source_image to get
the image and using the same code as is used for reflected
meta-surface patterns to created a reflected pattern by drawing four
transformed copies of the image inside the PDF patten.
This is the better way to implement reflected images as we are no
longer embedding an image four times larger than the original.
By switching to cairo_font_options_status() instead of checking against
the _cairo_font_options_nil error object, the API is protected from NULL
dereferences.
On IRC Drakou reported a user error whereby cairo_scaled_font_create()
was called with a NULL cairo_font_options_t. However, instead of
reporting the error back to the user, cairo instead segfaulted trying
to dereference the NULL pointer!
Add a guard to check that the options is not NULL.
Add various test cases to exercise
_cairo_pattern_acquire_surface_for_surface(), most notably using similar
source surfaces to provide coverage of the non-image surface branch.
No need to guarding against the pointer being NULL on internal functions
as no path can call the function will a NULL pointer and no path should
ever try, which in any case it would be better to crash immediately.
This variable was expanding to an empty string, so the next -I flag
was getting completely swallowed. Let's avoid being clever and just
use . which is what we want in the expansion anyway.