Commit graph

3150 commits

Author SHA1 Message Date
Behdad Esfahbod
b54174e917 [PS] Fix rotated image pattern emission by correcting setting the bbox
The bug was that the bounding box of the image was computed by transforming
the vector (width,height) and then using 0,0,width,height as the bounding box.
This is obviously wrong.  We use _cairo_matrix_transform_bounding_box() now.
This fixes the XFAIL test rotate-image-surface-paint.
2007-02-21 13:43:08 -05:00
Behdad Esfahbod
6ae4a4fd71 [test] Remove ft-text-vertical-layout-type1 from XFAIL
and update reference images.  This test was fixed some time ago
where I disabled type1 subsetting for vertical layouts, then
turned XFAIL again when Carl Worth didn't have the same fonts as me.
I've not updated reference images to work on FC6 and hoping that it
works for Carl too.
2007-02-21 12:57:09 -05:00
Behdad Esfahbod
c6a067f967 [test] Add test case for bug #7965 to the get-path-extents test 2007-02-21 11:50:24 -05:00
Vladimir Vukicevic
363b1a40b5 [quartz] Remove (disabled) support for rendering via AGL/CGGL 2007-02-20 16:18:27 -08:00
Vladimir Vukicevic
e4a1410514 [quartz] Rename public function parameter from surf -> surface 2007-02-20 16:16:18 -08:00
Vladimir Vukicevic
28c1e46b8e [quartz] rename test override images from nquartz to quartz 2007-02-20 13:22:11 -08:00
Vladimir Vukicevic
be451cd83d [quartz] rename NQUARTZ -> QUARTZ in defines 2007-02-20 12:54:03 -08:00
Vladimir Vukicevic
4c201723ce [quartz] Rename nquartz to quartz 2007-02-20 12:15:35 -08:00
Adrian Johnson
641f0919d5 PDF/PS: Don't embed multiple copies of the same font
cairo-scaled-font-subsets stores two sets of subsets -
scaled and unscaled. The first time each glyph is mapped,
_cairo_scaled_glyph_lookup() is called to determine if
the glyph is bitmap or outline. Outline glyphs are put
in the unscaled subsets. Bitmap glyphs are put in the
scaled subsets. The unscaled subsets hash table keyed is
the scaled_font->font_face to ensure only one font for
each font face is created. The scaled subsets hash
table is keyed by scaled_font.

_cairo_scaled_font_subsets_create() now takes two arguments
to specify the maximum size of the scaled and unscaled subsets.
If the unscaled max size is set to 0 all glyphs are mapped
to scaled subsets.

A separate foreach function is provided for scaled and unscaled
subsets. The PDF and PS backends iterate over the unscaled
subsets to emit CFF, TrueType, and Type1 fonts. The scaled
subsets are iterated to emit Type3 bitmap fonts.
2007-02-21 00:32:07 +10:30
Behdad Esfahbod
f65c33edbe [win32] Make win32-surface compile without win32-font
Hacking on the win32 code, thanks to winelib.  Yay!
2007-02-20 01:01:39 -05:00
Behdad Esfahbod
2335a23a16 [test/Makefile.am] Document why svg2png and pdf2png use LDADD
This is to make librsvg and poppler to use the compiled cairo instead
of whatever is on the system, such that the test suite does not depend
on a good version of cairo being installed already.
2007-02-20 01:01:39 -05:00
Behdad Esfahbod
8133530ae5 [configure] Improve win32 detection
We now test for windows.h availability to automatically enable win32
backends.  This nicely enables compiling cairo against libwine by just
setting CC=winegcc LD=winegcc during configure.  This currently only
generates static libs though.
2007-02-20 01:01:34 -05:00
Jeff Smith
0fcd6cfe0e Clean up some inconsistent spacing in the stroking code 2007-02-19 16:06:57 -05:00
Jeff Smith
89010db3ad Add or reword several comments in the stroking code 2007-02-19 16:06:57 -05:00
Jeff Smith
adb573d0ba Minor changes to shorten the stroking code 2007-02-19 16:06:57 -05:00
Jeff Muizelaar
fb29fddd40 Rename tmp to step_length because that is what it actually is. 2007-02-19 16:06:57 -05:00
Jeff Muizelaar
afd5f92195 Fix several issues with dashed stroking code, particularly 'leaky-dash'
Adds some state, 'dash_starts_on', to keep track of whether a dashed path
starts with dash_on or not. This fixes the 'leaky-dash' bug (#4863) and
some other degenerate cases. The new version is, in my opinion,
considerably cleaner and more understandable than the old code.

Finally, the rewrite changes the behaviour of dashing to add degenerate
caps around corners that start at the same place as a dash begins. This
matches the behaviour seen in acroread.

This rewrite is based on an initial rewrite done by Jeff Smith.
2007-02-19 16:06:57 -05:00
Jeff Muizelaar
78ae474d96 Rename has_sub_path to has_initial_sub_path
has_initial_sub_path more accurately describes the condition we want to
track. This flag is used to indicate when an initial sub_path needs capping
but has no associated slope and thus no associated faces.
2007-02-19 16:06:56 -05:00
Jeff Muizelaar
9f3fb4f753 Add a comment about the point choice when capping degenerate paths 2007-02-19 16:06:56 -05:00
Jeff Smith
a1a4d6966e Modify how _cairo_stroker_add_caps handles zero-length sub-paths
For zero-length sub-paths, _cairo_stroker_add_caps sets up a dummy face,
then lets later parts of the function add the caps.
2007-02-19 16:06:56 -05:00
Jeff Smith
849a9ef81b Change type of cairo_stroker_t's dash_on from int to cairo_bool_t 2007-02-19 16:06:56 -05:00
Jeff Muizelaar
74ded42327 Add a new dashing test
This new dashing test, based on some code from Jeff Smith, does a pretty
good job exploring all the cases that the dashing code needs to deal with.
2007-02-19 16:06:56 -05:00
Jeff Muizelaar
1c1697398c Add two new test cases to degenerate-path test
These new cases deal with degenerate paths at the end of dashed paths. They
currently fail.
2007-02-19 16:06:56 -05:00
Adrian Johnson
9927dde533 TrueType: fix bug #9998 - build error with gcc 2.95 2007-02-17 10:55:14 +10:30
Brian Ewins
9bae496a0a [ATSUI] implement load_truetype_table
Implements load truetype table, allowing selection of
text and searching in pdfs generated using the atsui
font backend.
2007-02-15 23:08:40 +00:00
Adrian Johnson
16e20568a5 TrueType: Add post table and 3,0 cmap encoding
Commit 05ff2c77da contained
a fix for the acroread printing problem. However this
patch caused a problem for the Mac Preview PDF viewer.

  http://lists.freedesktop.org/archives/cairo/2007-February/009615.html

This patch fixes the Mac Preview problem. The patch

- Adds a platform 3, encoding 0 cmap table
- Adds a post table that maps the glyph names in the
  PDF truetype font dictionary (/g0 /g1 /g2 ...)
  to glyph indices in the font.
2007-02-16 08:38:26 +10:30
Jorn Baayen
2715f20981 [cairo-pattern] Cache surface for solid patterns
We use a small cache of size 16 for surfaces created for solid patterns.
This mainly helps with the X backends where we don't have to create a
pattern for every operation, so we save a lot on X traffic.  Xft uses a
similar cache, so cairo's text rendering traffic with the xlib backend
now completely matches that of Xft.

The cache uses an static index variable, which itself acts like a cache of
size 1, remembering the most recently used solid pattern.  So repeated
lookups for the same pattern hit immediately.  If that fails, the cache is
searched linearly, and if that fails too, a new surface is created and a
random member of the cache is evicted.

Only surfaces that are "compatible" are used.  The definition of compatible
is backend specific.  For the xlib backend, it means that the two surfaces
are allocated on the same display.  Implementations for compatibility are
provided for all backends that it makes sense.
2007-02-14 18:28:56 -08:00
Carl Worth
b31179478b Bump cairo version to 1.3.15 after making the 1.3.14 snapshot 2007-02-14 00:48:42 -08:00
Carl Worth
90e453fc22 Increment cairo version to 1.3.14 (and libtool versioning to 12:4:10) 2007-02-14 00:34:18 -08:00
Carl Worth
513f21140b NEWS: Add notes for the 1.3.14 snapshot 2007-02-14 00:32:54 -08:00
Carl Worth
51ca187d3e Mark test/rotate-image-surface-paint as XFAIL
This test has always failed with the ps backend since the test
was initially written.
2007-02-13 23:55:03 -08:00
Carl Worth
9966551dc7 Fix cairo_ft_unscaled_font_t to have a lock_count again not an is_locked Boolean
This was inadvertently changed as part of fdffde8b9e

With the Boolean, pango-using programs that locked the same
unscaled_font multiple times would crash with a message such as:

 cairo-ft-font.c:569: _cairo_ft_unscaled_font_unlock_face: Assertion `unscaled->is_locked' failed.
2007-02-13 23:49:26 -08:00
Carl Worth
7adab2866b Add missing call to set_scale of unscaled_font in scaled_glyph init
This fixes a regression introduced with commit:

	25a370d799

This was showing up as a failure of the bitmap-font test case
with the ps, pdf, and svg backends.
2007-02-13 22:05:57 -08:00
Jinghua Luo
17b4496ae9 type1-subset: fix error handling.
This fixes potenial memory leak and leaving font face locked on error.
2007-02-14 11:52:11 +08:00
Dan Amelang
01a133167c Update Win32 makefiles
Since the last time these makefiles were last updated some new source
files have been added and one renamed. In addition, a "clean" rule
needed to be added to the pixman makefile. And the "clean" rule in the
main cairo makefile wasn't working properly for me.
2007-02-13 16:53:12 -08:00
Carl Worth
b8987dd12c ROADMAP: Note that text spacing issues for win32 are fixed 2007-02-13 16:47:30 -08:00
Dan Amelang
f0a16b5bdd Fix Win32 text spacing problem
Thanks to Jordan Miner for reporting the problem and a fix.
2007-02-13 16:32:05 -08:00
Carl Worth
aad1374caa Rename cairo_toy_font_face_hash_table_mutex to cairo_font_face_mutex
The new name more accurately reflects its recently expanded role.
2007-02-13 10:59:51 -08:00
Carl Worth
e107b70b4d Add locking to cairo_font_face_reference/destroy
The reference count of cairo_font_face_t is rather intimately tied,
(for toy font faces), with the cairo_font_face_hash_table, so we
expand the existing cairo_toy_font_face_hash_table_mutex to cover
the manipulation of font_face->ref_count as well.

This commit eliminates an assertion failure that is (occasionally)
exposed by the pthread-show-text test case:

lt-pthread-show-text: cairo-hash.c:196: _cairo_hash_table_destroy: Assertion `hash_table->live_entries == 0' failed.
2007-02-13 10:58:20 -08:00
Carl Worth
d6d1767f9a Increase pthread-show-text thread count and add cairo_select_font_face to expose more bugs. 2007-02-13 10:47:06 -08:00
Carl Worth
fdffde8b9e Add mutex to implement _cairo_ft_unscaled_font_lock_face and _cairo_ft_unscaled_font_unlock_face
Previously we just had an integer counter here, but that is not
sufficient as multiple cairo_scaled_font_t objects, (which are
implicitly shared through the font caches), can reference the
same cairo_ft_unscaled_font_t so real locking is needed here.

This commit eliminates an assertion failure exposed by the
pthread-show-text test case:

lt-pthread-show-text: cairo-ft-font.c:562: _cairo_ft_unscaled_font_unlock_face: Assertion `unscaled->lock > 0' failed.
2007-02-13 10:46:52 -08:00
Carl Worth
25a370d799 Avoid public cairo_ft_scaled_font_lock_face for internal use
We're planning to change the implementation of the public function,
(which will remove some locking safety), so use the safe, locked
_cairo_ft_unscaled_font_lock_face for internal use instead.
2007-02-13 10:40:53 -08:00
Carl Worth
7e1301ffb0 Add missing _cairo_ft_unscaled_font_unlock_face to _cairo_ft_scaled_font_create 2007-02-13 10:22:32 -08:00
Adrian Johnson
6f7cfdf5c7 PDF: Add missing character code to Differences array 2007-02-13 23:53:38 +10:30
Adrian Johnson
88cae7766d output-stream: coding style fix 2007-02-13 23:29:05 +10:30
Adrian Johnson
88f7ea4ad7 CFF: Fix Visual C++ compile problem
Don't use structure intitialization for assigning
structure values.

Add a new field to cff_charset_t to point to the sids
charset array instead of casting it into the data field.
2007-02-13 22:52:53 +10:30
Adrian Johnson
ac01dcb5ad PDF: Remove dead code
The function _cairo_pdf_surface_write_fonts is the
original PDF TrueType font embedding function that was
disabled in commit f500cef19f
shortly before Type3 font support was added.

TrueType font embedding was later reintroduced as new code
making this function obsolete.
2007-02-11 23:14:40 +10:30
Adrian Johnson
d6f15b2600 Output-stream: Omit the minus sign from negative zero 2007-02-11 22:20:58 +10:30
Adrian Johnson
a2fefcc9e9 PDF: Compress Type3 fonts 2007-02-11 21:57:43 +10:30
Adrian Johnson
9f47879ae3 PDF: Fix Type3 font metrics to make text selection work 2007-02-11 21:50:46 +10:30