Commit graph

5016 commits

Author SHA1 Message Date
Carl Worth
e07e1b7bbb Document many more defaults
Including: fallback_resolution, fill_rule, line_cap, line_join,
miter_limit, font_face, font_size, and operator.
2008-04-06 02:47:32 -07:00
Carl Worth
a55669c325 Document toy nature of cairo_select_font_face 2008-04-06 02:17:33 -07:00
Carl Worth
d1fe008440 Document default extend modes 2008-04-06 02:17:09 -07:00
Carl Worth
abe6f9541e Document EXTEND_REFLECT and EXTEND_PAD as implemented for surfaces since 1.6 2008-04-06 02:01:04 -07:00
Carl Worth
657b348e01 README: Update dependencies 2008-04-06 01:57:45 -07:00
Carl Worth
c642a40195 Revert "[README] Remove the Dependencies section as it falls out of date easily"
This reverts commit 5f38e215ed.

It's true that the dependencies can fall out of date, but it's really
unkind to not provide users with this information. I think we can
compromise by committing to update this information before major
releases.
2008-04-06 01:14:14 -07:00
Carl Worth
b61d1b01e9 Change default filter from BEST to GOOD
Right now the two filters are implemented identically, so there's
no real change for now. But in the future, it's conceivable that an
X server could implement some crazy, high-quality filter for BEST
without regard to performance, (since that's what BEST means).

Meanwhile, GOOD actually captures what we want by default which is
a good mix of both quality and performance.
2008-04-06 01:07:32 -07:00
Carl Worth
14b056945c Update smask-text reference image
It appears the reference image wasn't generated on a gold-standard
machine, (and yes, the gold standard is, *ahem* whatever happens
to match what Carl's machine does---eventually we'll make the test-
based tests less picky about system configuration like this).
2008-04-06 00:34:59 -07:00
Chris Wilson
3a89bf4a1d [test] Remove some redundant evals from the summary.
In a couple of places we used eval to execute a simple assignment -
complete overkill.
2008-04-05 22:06:34 +01:00
Chris Wilson
fc0a2988cd [test] Disable jobserver with make check.
make -j check has the unfortunate side-effect of performing the summary
before the TESTS have completed, both hiding in the stream of test
output and making it useless. Forcibly disable the jobserver so that the
summary is always last at the expense of not compiling the tests in parallel.
2008-04-05 22:06:34 +01:00
Adrian Johnson
ae6fbe9e6e scaled-font-subsets: Special case .notdef in a new subset
If the .notdef glyph is the first glyph in the subset to be mapped in
scaled font, we do not know if the subset will scaled or unscaled. We
can put it in the unscaled subset as Type1-fallback will embded an
empty glyph if it can not get the path.
2008-04-06 01:08:31 +10:30
Adrian Johnson
0d5902b716 Type1-fallback: Use correct glyph metrics for .notdef glyph
Bug 15348 references the following PDF that was printing incorrectly
when running through poppler and cairo to generate PostScript.

http://launchpadlibrarian.net/12921700/UbuntuDesktop.pdf

The PostScript output had too much space between each word causing
strings of glyphs printed with the TJ operator to overlap.

The original PDF file contains an CFF font with CID Identity-H
encoding. The PDF file is using character code 0 (glyph 0 due to
Identity-H encoding) as a space character. The CFF specification
defines glyph 0 to be the .notdef glyph.

The PS backend subsets CFF fonts as a Type1-fallback
font. Type1-fallback creates it's own empty .notdef glyph with an
arbitrary glyph advance of 500. The problem here is the TJ operator
used to output the glyphs depends on the glyph advance being
correct. pdf-operators.c uses the glyph advance returned by
_scaled_glyph_init(). However the PostScript interpreter sees the
glyph advance of 500 for .notdef. This problem does not occur when
generating PDF as the PDF font dictionary contains an list of glyph
advances that override the font metrics.

Fix this by making Type1-fallback not treat .notdef as special and to
create it the path and metrics obtained from _scaled_glyph_init(). As
a special case, make it not fail if _scaled_glyph_init() is unable to
return a path for .notdef. This was probably the reason Type1-fallback
previously created it's own .notdef glyph as calling
_scaled_glyph_init(_GLYPH_INFO_PATH) for glyph 0 returns
CAIRO_INT_STATUS_UNSUPPORTED for some fonts.

This ensures the Type1-fallback font metrics match the metrics used
by pdf-operators.c to position the glyphs. This also results in the
removal of some duplicated code.
2008-04-06 00:36:02 +10:30
Adrian Johnson
03d2b098ff Type1-fallback: Use correct glyph advance in Type 1 charstrings
5050c55f93 fixed type1-fallback to use the glyph advance instead of
glyph width in the stored glyph metrics in the font. However it did
not fix the same bug in Type 2 charstrings (used by CFF fallback in
PDF). This problem was not noticed since the glyph widths in the PDF
font dictionary overrides these values.

Fix this in case any software reading cairo PDFs uses these values.
2008-04-06 00:36:02 +10:30
Adrian Johnson
40cee8c578 Add assert to scaled_glyph_lookup in scaled-font-subsets
If _cairo_scaled_glyph_lookup() returns CAIRO_INT_STATUS_UNSUPPORTED
it will be caught by the ASSERT_NOT_REACHED in
_emit_unscaled_font_subset in PS/PDF. It is more useful to catch this
closer to the source.
2008-04-06 00:36:02 +10:30
Chris Wilson
93536bf3ac [test] Summarise failures per backend.
Enhance the test failure summary to list the tests that failed per
backend.
2008-04-05 09:31:22 +01:00
Carl Worth
731e121c80 _cairo_pattern_get_extents: Fix to allow for expansion based on filter
This fixes the filter-bilinear-extents test case and the
related bug entry:

	bad clipping with EXTEND_NONE
	http://bugs.freedesktop.org/show_bug.cgi?id=15349

Though there are still differences in the PDF and PostScript
backends, (primarily because we can't capture cairo's filter
modes in those file formats).
2008-04-04 19:00:28 -07:00
Carl Worth
04608952e2 Replace open-coded transformation with a call to _cairo_matrix_transform_bounding_box
It's a wonderful feeiling to remove duplicate code.
2008-04-04 18:56:38 -07:00
Carl Worth
89567f9278 Add new filter-bilinear-extents test
This test exercises code that computes the extents of a surface
pattern with CAIRO_FILTER_BILINEAR, (where the filtering
effectively increases the extents of the pattern).

The original bug was reported by Owen Taylor here:

    bad clipping with EXTEND_NONE
    http://bugs.freedesktop.org/show_bug.cgi?id=15349
2008-04-04 18:28:23 -07:00
Carl Worth
80f7aa03b3 Enable buggy_repeat workaround for X.Org servers < 1.4
This covers the known-to-broken 1.3 servers such as appeared
in Fedora 8. It also leaves the workaround off, (since it's
a severe slowdown), for the known-to-be-working 1.4.99.901
server as appears in Fedora 9 Betas.
2008-04-04 11:30:16 -07:00
Chris Wilson
2c8ead12a6 [xlib] Avoiding sending glyphs > XMaxRequestSize.
XRenderAddGlyph() does not split its image data across multiple requests
and so the glyph surface must be smaller than XMaxRequestSize or else
the server will disconnect the client, causing "Fatal IO error 104".
As this will require an extension to the XRender spec, we can work
around the issue by using our fallbacks if we detect that the glyph will
be too large for a single request.

See bugs https://bugs.freedesktop.org/show_bug.cgi?id=4339 and
http://bugs.freedesktop.org/show_bug.cgi?id=13266 for examples.
2008-04-04 18:08:25 +01:00
Chris Wilson
a4f94624b2 [test] Add bilevel image test case.
Add a simple test to exercise the embedding of an image with a bilevel
alpha channel into a postscript level 3 document.
2008-04-04 15:56:22 +01:00
Chris Wilson
f72799a252 [configure.in] Add a link to the LTP homepage.
If ./configure --enable-gcov fails due to a missing LTP package, then
include a link to LTP homepage in the error message.
2008-04-04 14:22:18 +01:00
Chris Wilson
c0593d16c7 [pdf] Copy the glyphs for use within an smask group.
When constructing an smask group using PDF_SHOW_GLYPHS, we need a copy
of the glyphs else they'll be freed be we use them (in _show_page()).
2008-04-04 13:40:46 +01:00
Chris Wilson
a74db7e7bc [test] Exercise "soft" masks.
PDF has a concept of "soft" masks, for which it is able to construct a
mask out of PDF drawing operations. These tests exercise constructing
various masks using the high level drawing operations.
2008-04-04 13:40:37 +01:00
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
6192001816 Add PS reference image for ft-show-glyphs-table 2008-04-04 19:26:36 +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
Carl Worth
8a78760f15 Add new ft-show-glyphs-table test to exercise recent glyph positioning bug fix
Interestingly, this test case does demonstrate that cairo-pdf
is fixed, (where without commit f6509933a4 the Y positions
of the glyphs were inverted); however, cairo-ps is failing
with this test, (all the glyphs are ending up on top of each
other).
2008-04-03 17:12:14 -07: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
7901eb29ef [test] Add a1-mask.
Add a variant of the a8-mask test case that exercises the FORMAT_A1 code
paths instead.
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
Chris Wilson
048160d44c [.gitignore] Add test/stroke-image 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
b3a70629f8 [test/text-transform] Fix pattern leak.
Add missing cairo_pattern_destroy.
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