Commit graph

3077 commits

Author SHA1 Message Date
Adrian Johnson
2d42f5ac27 TrueType: Fix buffer check
bb76eb50 added some checks to ensure we do not read past the end of
the buffer for the loaded glyph. However the checks assumed
tt_composite_glyph_t has a fixed size. tt_composite_glyph_t has a
variable size that depends on the values with the struct.
2008-04-04 20:29:12 +10:30
Adrian Johnson
7dbb2dec33 TrueType: Remove assert
If the status is UNSUPPORTED we should let type1-fallback subset it.
2008-04-04 19:48:55 +10:30
Adrian Johnson
e50324d3cc PS: Fix emulation of 'Td' pdf operator 2008-04-04 19:26:36 +10:30
Chris Wilson
759793cad1 Add links to the font specifications.
Add links to specifications for the Type1, CFF, and TrueType font file
formats, provided by Adrian Johnson.
2008-04-04 09:49:34 +01:00
Adrian Johnson
f6509933a4 PDF: Fix glyph positioning bug 2008-04-04 08:41:08 +10:30
Chris Wilson
bb76eb508b [cairo-truetype-subset] Check reads are within valid data.
Check cairo_truetype_font_remap_composite_glyph() does not read beyond
the end of the buffer loaded for the glyf.
2008-04-03 18:36:16 +01:00
Chris Wilson
a5e2a2ad2d [cairo-truetype-subset] Prevent accesses beyond the end of the glyph array.
Reject the font if we try to remap a composite glyph that exists outside
the known set of glyphs.
2008-04-03 18:35:57 +01:00
Chris Wilson
13cdfed894 [cairo-truetype-subset] Perform a quick sanity check that glyf end >= begin.
Check for a bogus glyf position and prevent an integer overflow.
2008-04-03 17:43:37 +01:00
Chris Wilson
cfff3c3bd0 [cairo-array] Guard against integer overflow whilst growing the array.
Sanity check the arguments to _cairo_array_grow_by() such that the
array size does not overflow, similar to the defensive checking of
parameters to malloc.
2008-04-03 17:36:50 +01:00
Chris Wilson
6101dc3e93 [cairo-pdf-surface] Do not bitswap big-endian A1 masks.
Pixman stores the bits A1 surfaces in native byte order, PDF stores
A1 masks in MSb - so only perform swapping for little-endian machines.

Note this also removes the extraneous packing as per the PDF spec 4.8.2:
"Byte boundaries are ignored, except that each row of sample data must
begin on a byte boundary. If the number of data bits per row is not a
multiple of 8, the end of the row is padded with extra bits to fill out
the last byte."
2008-04-03 15:41:31 +01:00
Chris Wilson
5aa5aeb1f5 [cairo-font-face] Cleanup up the font_face on the error path.
A missing _cairo_toy_font_face_fini() was leaking the strdup(family).
2008-04-03 15:41:31 +01:00
Vladimir Vukicevic
9e749d0a28 [cgfont] typo fix 2008-04-02 23:37:24 -07:00
Vladimir Vukicevic
3f9b1ceac7 [cgfont] Implement missing scaled font metrics 2008-04-02 16:14:09 -07:00
Chris Wilson
eb3eb0252b [cairo-xlib-surface] Avoid writing to the error surface.
Insert status checks during construction of temporary glyph surfaces
to avoid potentially writing to the inert error object.
2008-04-02 17:33:30 +01:00
Chris Wilson
c1062bf20a [cairo-xlib-surface] Preserve Visuals for non-TrueColor similar surfaces.
Previously, given a valid XRenderFormat the Visual was discarded
when creating similar surfaces. However the original Visual is
required to support reading back from non-TrueColor surfaces.
2008-04-02 10:50:48 +01:00
Chris Wilson
37c69c0d54 [cairo-xlib] Handle malloc failures for cairo_xlib_visual_info_t.
Tidy the error paths whilst handling visuals, in particular avoiding a
couple of potential NULL deferences, missed status checks and fresh
leaks.
2008-04-02 10:50:48 +01:00
Chris Wilson
0cd42c25a6 [cairo-svg-surface] Check surface status before extracting the svg target.
We need to check and report the existent status, else we may try to
modify the inert error object.
2008-04-02 10:50:47 +01:00
Chris Wilson
013bbda637 [cairo-ps-surface] Check surface status before extracting the ps target.
We need to check and report the existent status, else we may try to
modify the inert error object.
2008-04-02 10:50:47 +01:00
Chris Wilson
cebb1eef43 [cairo-svg-surface] Missing status check.
Check and, if necessary, propagate the error status - do not allow the
status to be overwritten, potentially masking the original error.
2008-04-02 10:50:47 +01:00
Chris Wilson
94db91b65e [cairo-pdf-surface] Do not mask error during cleanup.
Be careful to preserve the original error status whilst on the common
cleanup path for _cairo_pdf_surface_emit_meta_surface().
2008-04-02 10:50:47 +01:00
Chris Wilson
3580b99a8f [cairo-pdf-surface] Check surface status before extracting the pdf target.
We need to check and report the existent status, else we may try to
modify the inert error object.
2008-04-02 10:50:47 +01:00
Chris Wilson
34d734365b [cairo-svg-surface] Release acquired surface on error path.
Ensure the surface returned from _cairo_pattern_acquire_surface() is
released on the error path.
2008-04-02 10:50:47 +01:00
Chris Wilson
ba2e82d138 [cairo-ps-surface] Check error status before potential illegal dereference.
After acquiring the source image, check for the error status to ensure
that we do not attempt to deference an invalid surface.
2008-04-02 10:50:47 +01:00
Chris Wilson
767add1ee3 [cairo-pdf-operators] Destroy stream on error.
We cannot guarantee that a newly created error stream is a static error
object, so we need to always destroy the stream on the error path. (One
day this may change with the global pool of error objects...)
2008-04-02 10:50:47 +01:00
Carl Worth
07130a9061 Include cairoint.h first to satisfy the test suite
Forgetting to include cairoint.h (or not including it first) can
cause some subtle bugs due to specific feature flags not being
set, etc.
2008-04-01 15:20:42 -07:00
Carl Worth
46ea00d829 More quieting of subtle potentially-uninitialized warnings
The compiler isn't clever enough to notice that these
variables are always initialized (in either the TrueColor
or ! TrueColor conditions corresponding to the later
identical conditions in which the variables are used).
2008-04-01 14:53:55 -07:00
Carl Worth
1489e66d25 Quiet a more subtle potentially-uninitialized warning
The compiler isn't clever enough to notice that these
variables are always initialized.
2008-04-01 14:49:03 -07:00
Carl Worth
afc6e3b69d Quiet some trivial unused and potentially-uninitialized compiler warnings 2008-04-01 14:40:18 -07:00
Vladimir Vukicevic
56800e6ea0 [quartz] Remove cairo-atsui-font.c 2008-04-01 13:28:03 -07:00
Vladimir Vukicevic
8ddae11b54 [quartz] Update documentation 2008-04-01 13:26:00 -07:00
Vladimir Vukicevic
94b67d13f3 [quartz] Handle further 10.4 vs. 10.5 differences; fix text AA handling 2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
a1d1be4234 [cgfont] Round surface rectangle outwards to ensure whole-pixel dimensions 2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
c064ad1b56 [cgfont] Fix whitespace errors 2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
2be3e67db2 [cgfont] Add CGFont backend to replace deprecated ATSUI backend
Create a new font backend that uses the CGFont API on MacOS X
10.4 and beyond.
2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
30f7fae647 [cgfont] Add start of CGFont font backend to replace ATSUI 2008-04-01 13:04:08 -07:00
Emmanuel Pacaud
9e6d679870 [SVG] Fix stroke-image test failure.
The pattern transform inherit the object transform matrix, and that was not
taken into account.
2008-04-01 16:50:12 +02:00
Adrian Johnson
47981226db Fix PDF analysis of OPERATOR_SOURCE surface patterns 2008-03-29 23:45:31 +10:30
Adrian Johnson
b3b3e3810d PS: Clear pattern background to when using OPERATOR_SOURCE
Set pattern background to white if surface content is COLOR_ALPHA or
black if surface content is COLOR when operator is SOURCE.
2008-03-29 23:00:34 +10:30
Adrian Johnson
5b8b3a9765 PS/PDF: Save/Restore surface clip when emitting a meta-surface pattern 2008-03-29 15:52:37 +10:30
Carl Worth
75972167a2 Use floating-point offsets for color stops
Previously we were using the cairo_fixed_t type which meant we've
historically only been using 16 bits of precision for these offsets,
and recently only 8 bits. Meanwhile, all manipulatons of offsets
have been in floating-point anyway, so we might as well store them
that way.

This change also prevents a rendering regression introduced with the
24.8->16.16 change betwen snapshots 1.5.10 and 1.5.12 .

This change affected gradient-rendering details for the clip-operator
and operator-source tests, so the corresponding reference images are
updated here.
2008-03-26 14:52:09 -07:00
Carl Worth
80dc1714c8 Remove unused variable 2008-03-26 14:52:09 -07:00
Chris Wilson
f676f18050 [cairo] Fixup make check.
make check demands that all function references in the docs are suffixed
with ().
2008-03-26 13:13:20 +00:00
Chris Wilson
452a1de2a0 [cairo-gstate] Remove dead code.
Eliminate _cairo_gstate_recursive_apply_clip_path, as its last caller
was removed over 2 years ago.
2008-03-26 13:13:19 +00:00
Adrian Johnson
ed42916028 Win32: Fix bug in cairo_win32_font_face_create_for_hfont()
Use GetObjectW for LOGFONTW.
2008-03-26 23:04:35 +10:30
Carl Worth
6dc75ab0f8 Quiet compiler warnings about unhandled PIXMAN_yuy2 and PIXMAN_yv12
We still don't handle these format codes of course, (they're meaningless
for the context in which they're used here).

Note that we previously avoided adding these to avoid people being forced
to upgrade pixman just to get two enum values that cairo doesn't really
care about. But now we're depending on a new pixman anyway, (for the
pixman_format_code_to_masks function), so we'll go ahead and do this now.
2008-03-25 16:46:02 -07:00
Carl Worth
1675713aff Depend on pixman 0.9.7 for new pixman_format_supported_destination function
This allows us to do a much more general and complete implementation of
_pixman_format_from_masks and _pixman_format_to_masks so that we'll
even pick up new pixman formats as they get added.
2008-03-25 16:45:21 -07:00
Carl Worth
d7e5f6b6a0 Rename _popcount to _cairo_popcount and make it available for internal use
Both cairo-image-surface.c and cairo-xlib-surface.c want to
use this function now.
2008-03-25 16:32:24 -07:00
Carl Worth
90cf7c2faf Quiet warning about signed vs. unsigned comparison 2008-03-25 13:17:49 -07:00
Carl Worth
770633c05a Quiet warnings about unhandled enum values in _cairo_surface_create_in_error 2008-03-25 13:17:49 -07:00
Carl Worth
d15c7c94bd Document performance advantage of cairo_path_extents
The cairo_path_extents function can perform better than either
cairo_stroke_extents or cairo_fill_extents, so provide that
pointer from the documentation of the other two functions.
2008-03-25 13:17:49 -07:00