Commit graph

3116 commits

Author SHA1 Message Date
Behdad Esfahbod
8d812ae9a6 [cairo-pattern] Correctly delegate device_transform so tests pass again 2007-02-23 17:26:42 -05:00
Behdad Esfahbod
7cbfb9556d [cairo-pattern] Fall back on cairo_surface_create_similar in _cairo_pattern_acquire_surface_for_surface
This was needed for SVG backend because it does not implement clone_similar.
However, I'm worried about possible infinite recursion here.  Not sure what
to do.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
5562050bcf Support CAIRO_EXTEND_REFLECT on surface patterns
We do this through a hack, that is, we make
_cairo_pattern_acquire_surface to return a surface that has four
copies of the original surface painted such that this image can
be simply repeated to get the effect of reflecting the original
surface.

This fixes the formerly XFAIL test extend-reflect.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
81935bb131 [PS] Update surface_pattern_supported() from PDF
The PS backend was accepting all surface patterns, just to ASSERT_NOT_REACHED
later if extend type of the pattern was PAD or REFLECT.  That didn't make
sense and was causing crash for PAD (surprisingly not for REFLECT.  Not sure
why).  So now it rejects those types of surface patterns, just like the PDF
surface does.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
4e30919f30 [cairo-surface] Do not err on CAIRO_EXTEND_PAD and CAIRO_EXTEND_REFLECT
for surface patterns.

Right before releasing cairo 1.2, Carl and I decided to return error on
CAIRO_EXTEND_PAD and CAIRO_EXTEND_REFLECT for surface patterns, as they
are not implemented and one was causing crashes.  Well, that was probably
the worst decision we could make (other than ignoring the problem).  A
much better decision would have been to make them act like
CAIRO_EXTEND_NONE and CAIRO_EXTEND_REPEAT respectively.  Anyway, remove
the error paths.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
a57bc6b697 [test] Add ref image for extend-reflect 2007-02-23 17:26:41 -05:00
Vladimir Vukicevic
5a72aac598 [core] put back REF_COUNT_INVALID to be -1, fix finish
Previous commit broke cairo_surface_finish, since it was checking for
ref_count == CAIRO_REF_COUNT_INVALID and bailing.  But, that condition
was reached from destroy, so finish was bailing out early.
2007-02-23 14:24:04 -08:00
Vladimir Vukicevic
cf73118522 [core] Add user_data and reference count getters to all objects
user_data setters/getters were added to public refcounted objects
that were missing them (cairo_t, pattern, scaled_font).  Also,
a refcount getter (cairo_*_get_reference_count) was added to all
public refcounted objects.
2007-02-23 13:05:23 -08:00
Behdad Esfahbod
67e3b3c53b [xlib/xcb] Check for same_screen in is_compatible
Two drawables can be used in an X and Render operation only if they share
the same screen.  Previously we were only checking for the same display
in is_compatible.  Check for the same screen now.
2007-02-23 11:15:04 -05:00
Adrian Johnson
a1e5b91588 Subsetting: Add check for malloc() error 2007-02-23 22:55:29 +10:30
Adrian Johnson
27312591fe Win32: Fix _cairo_win32_scaled_font_map_glyphs_to_unicode return type 2007-02-23 22:14:42 +10:30
Behdad Esfahbod
3b168e4551 [FreeType] Truely return unhinted advance width if metrics hinting is off
David Turner said:
The returned 26.6 advance is always rounded, even with FT_LOAD_NO_HINTING.
You can however retrieve the linearly scaled value as a 16.16 fixed float
number through face->glyph->linearHoriAdvance. This works even with hinted
glyphs.
2007-02-22 23:14:58 -05:00
Behdad Esfahbod
0ff5192e4c [Makefile.am] Include boilerplate/ in SUBDIRS 2007-02-22 15:44:32 -05:00
Emmanuel Pacaud
1bc1f8ef46 Set overflow to visible for symbols.
It makes viewers implementing correctly the SVG specification show texts.
2007-02-21 23:23:32 +01:00
Behdad Esfahbod
7d91c8a2cb [test] Fix syntax typo in text-rotate 2007-02-21 15:47:43 -05:00
Behdad Esfahbod
155a1b48f6 [test] Remove text-rotate test from XFAIL as the bugs are fixed now
All missing is subpixel text positioning, but we don't need an XFAIL test
to remind us for that.
2007-02-21 13:52:17 -05:00
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