Commit graph

1456 commits

Author SHA1 Message Date
Behdad Esfahbod
8a1d9ca2dd check-headers.sh: Add a test for cairo_public decorators in public headers
Test fails currently because of bug 8313 and similar issues.
(cherry picked from 01f10fb27a commit)
2006-10-31 21:11:25 -05:00
Carl Worth
cb46125b5f Fix typo in error message (enhacement -> enhancement)
(cherry picked from edfceea853 commit)
2006-10-31 21:11:07 -05:00
Vladimir Vukicevic
8756984041 Correctly acquire/release mutex in _cairo_scaled_font_map_destroy
_cairo_scaled_font_map_destroy needs to both lock/unlock the mutex,
not just unlock it.
(cherry picked from 5ab72579ef commit)
2006-10-31 21:09:43 -05:00
Vladimir Vukicevic
baca4a50ac [win32] Misc win32 compilation fixes
Fix win32/MSVC defines for snprintf, inline, and M_PI
(cherry picked from 3c5a02c3ed commit)
2006-10-31 21:07:00 -05:00
Vladimir Vukicevic
387499c650 [win32] Make cairo as a win32 static library possible
This adds a win32 initialization function that is called from all
surface creation and font creation functions to ensure that the win32
mutexes are initialized.
(cherry picked from dbd0fa193c commit)
2006-10-31 21:02:38 -05:00
Carl Worth
2be2b11231 Use new return value from _cairo_output_stream_destroy
This is a little simpler than the old idiom of calling
_cairo_output_stream_get_status just before calling
_cairo_output_stream_destroy.

I had hoped this technique would apply in more cases, but
many cases want to separate the two actions anyway to do
conditional assignment of the status value, (in order to
not overwrite an earlier error value).
(cherry picked from 179f7defdf commit)
2006-10-31 21:01:03 -05:00
Carl Worth
d0657f65dd Make _cairo_output_stream_destroy return the stream's status as a last gasp.
(cherry picked from 89e7d5d420 commit)
2006-10-31 21:00:56 -05:00
Nicholas Miell
13612ac7a8 Make the SLIM macros robust in the face of macro-renamed symbols
This doesn't actually fix the AMD64 link failure, but it does make the
foo/EXT_foo/INT_foo symbol names generated by the slim_hidden_proto()
and slim_hidden_def() macros consistent in the face of the meddling of
pixman-remap.h.

Signed-off-by: Nicholas Miell <nmiell@gmail.com>
(cherry picked from 203d70a562 commit)
2006-10-31 20:59:33 -05:00
Behdad Esfahbod
bd8790bbc5 [x86-64] check-plt.sh: match on JU?MP_SLO as on x86-64 "SLOT" is truncated
(cherry picked from b5a64138bb commit)
2006-10-31 20:57:50 -05:00
Behdad Esfahbod
e46d73951d Add scripts to sanity check the shared object for exported and PLT symbols
src/check-def.sh checks that the list of symbols exported is the same as the
list of symbols in cairo.def, ie. symbols in public header files. (except for
symbols starting with _cairo)

src/check-plt.sh checks that no PLT entries exist for local function calls.
This makes sure we keep the 'slim' annotations uptodate.

These two are defined as tests in src/ and will be run during "make distcheck".
However, they are skipped if the commands 'nm' and 'readelf' are not found.
(We don't really rely on any functionality of eu-readelf, so using readelf
proper which should be more commonlly installed.)
(cherry picked from cd1b665064 commit)
2006-10-31 20:57:40 -05:00
Carl Worth
e14a7b0786 slim_hidden_proto: Move smeicolon from definition to use for consistency and legibility
(cherry picked from 60c4add26a commit)
2006-10-31 20:56:30 -05:00
Carl Worth
94ef526d4b Add many missing slim_hidden calls to bypass PLT entries for local use of public functions
(cherry picked from d7f08794ef commit)
2006-10-31 20:56:17 -05:00
Adrian Johnson
63b28849c6 Improve error checking in TrueType subsetting
TrueType subsetting will SEGV when using OpenType fonts with CFF outlines.
(cherry picked from ad78eb7692 commit)
2006-10-31 20:55:50 -05:00
Adrian Johnson
e194c9cdbe Correct the value of /LastChar in the PDF Type 1 font dictionary.
(cherry picked from 49fa8d353b commit)
2006-10-31 20:55:43 -05:00
Adrian Johnson
25e46ac935 Fix Type 1 embedding in PDF
PDF Files with Type 1 fonts fail to open in any version of
ghostscript prior to 8.54. The problem is the hex encoding of the
encrypted portion of the font. The PDF reference says this should
only be in binary.
(cherry picked from d81de15804 commit)
2006-10-31 20:55:37 -05:00
Carl Worth
80d8e695ff bug 8104: Eliminate unused variables. Replicate assert statement to identify branch of interest.
(cherry picked from 7c97a787eb commit)
2006-10-31 20:55:11 -05:00
Christian Biesinger
a08c0b43e2 [beos] Fix build error
Rename cairo_rectangle_fixed_t to cairo_rectangle_int16_t
as needed per commit 746f66c3fc.
(cherry picked from 05a259d493 commit)
2006-10-26 22:09:13 +02:00
Behdad Esfahbod
3252ad5ca6 [PNG] Mark status volatile to fix gcc warning 2006-08-28 22:44:15 -04:00
Behdad Esfahbod
b6e5f2b0fe [xlib] Bug 7593: rewrite loop to be more readable, and fix warnings
Basically, it's evil to write a loop like:

    while ((c -= 4) > 0) {
        ...
    }

for one reason that doesn't work if c is unsigned.  And when c is signed, if
for some reason c is about -MAXINT, then it will overflow and not work as
expected.

It's much safer (and more gcc warning friendly) to rewrite it as:

    unsigned int c;

    while (c >= 4) {
        ...
        c -= 4;
    }
2006-08-28 22:30:38 -04:00
Carl Worth
06a9628868 Eliminate conditions checking for unsigned or enum values less than 0. 2006-08-28 19:00:48 -07:00
Carl Worth
7d1399a4bb Put static first to avoid compiler warning. 2006-08-28 18:58:27 -07:00
Behdad Esfahbod
1b7ced6614 Bug #7593: Avoid unsigned loop control variable to eliminate infinite, memory-scribbling loop.
Behdad chased this bug down when looking into bug #7593. This
bug is what finally motivated us to figure out how to get -Wextra
(for the "always true" comparisons of unsigned variables against
negative values).
2006-08-28 18:57:14 -07:00
Behdad Esfahbod
5492946b0c [image] Print out cairo version in the unsupported-format message 2006-08-23 12:29:49 -04:00
Adrian Johnson
782e3eb65b Get correct unhinted outlines on win32.
The documentation for GetGlyphOutline() states that outline returned is grid
fitted and if an application requires an unmodified outline it can request an
outline for a font whose size is equal to the font's em unit.

This seems to suggest that the solution to this bug would be to obtain the
unmodified outline data and scale it to the required size.

https://bugs.freedesktop.org/show_bug.cgi?id=7603
2006-08-21 12:52:56 -04:00
Yevgen Muntyan
6de226be0e Define WINVER if it's not defined. (bug 6456) 2006-08-21 03:52:40 -04:00
Behdad Esfahbod
6ed1613b51 [Makefile.am] Remove unnecessary parantheses that were causing trouble with old bash
Reported by Tor Lillqvist
2006-08-20 13:44:56 -04:00
Carl Worth
b8b507c092 Use &image->base as appropriate to avoid warnings. 2006-08-18 16:12:43 -07:00
Carl Worth
861f1cb4f7 Merge branch 'jrmuizel-stroking-fixes' into cairo
Conflicts:

	test/dash-caps-joins-ps-argb32-ref.png
	test/degenerate-path-ps-argb32-ref.png
	test/degenerate-path.c
2006-08-18 07:59:20 -07:00
Carl Worth
c78c011017 Don't set current point to (0,0) in close_path.
The setting of current point to (0,0) is actually harmless, but it
definitely looks like a bug, (since after close_path the current point
is really the last move point).

We don't keep track of last move point here, nor do we even need to.
So we can be consistent with _cairo_path_fixed_close_path by not
adjusting current point at all, (the subsequent move_to coming right
behind the close_path will fix up the current point).
2006-08-18 06:32:12 -07:00
Carl Worth
53f74e59fa Fix close-path failure by adding explicit move_to after close_path.
Besides the bug fix, this is a user-visible change since the new
move_to element after the close_path element can be seen in the
results of cairo_copy_path, so we document that here.

We are also careful to fix up _cairo_path_fixed_line_to to defer to
_cairo_path_fixed_move_to to avoid letting the last_move_point state
get stale. This avoids introducing the second bug that is also tested
by the close-path test case.
2006-08-18 06:32:12 -07:00
Behdad Esfahbod
474daa4493 [PNG] Include png.h after cairoint.h to avoid macro problems (bug 7744) 2006-08-17 22:03:36 -04:00
Adrian Johnson
da1019c913 Only use GGO_GLYPH_INDEX for truetype and opentype fonts on win32. 2006-08-17 21:46:38 -04:00
Carl Worth
9878a03353 Add (primitive) bitmap glyph tracing to fix bug #7889 2006-08-17 17:50:41 -07:00
Carl Worth
0bfa6d4f33 Fix assertion failures in bitmap-font test by coercing A8 images to A1
There are still some problems in the resulting output:

PDF: Rotated font ends up being blurry in final PNG (not too important)
PS and SVG: There's an incorrect offset being applied somewhere.
2006-08-17 17:50:40 -07:00
Behdad Esfahbod
89008ad1c7 [FreeType] Use _cairo_ft_scaled_font_is_vertical where appropriate
instead of poking at the loadflags.
2006-08-15 13:53:51 -04:00
Behdad Esfahbod
b7bc263842 [FreeType] Fix vertical metrics adjustment to work with non-identity shapes 2006-08-15 08:33:20 -04:00
Behdad Esfahbod
d47388ad75 [PS] Set correct ImageMatrix in _cairo_ps_surface_emit_bitmap_glyph_data
which should be set to device_transform_inverse, not device_transform.
Moreover, no negation is needed anymore, as that has been working around
the inverse matrix :-).
2006-08-15 07:29:18 -04:00
Behdad Esfahbod
4b3fadefc8 [FreeType] Fix comment about font coordinate 2006-08-15 05:48:12 -04:00
Behdad Esfahbod
f183b835b1 Respect font_matrix translation in _cairo_gstate_glyph_path 2006-08-15 04:59:48 -04:00
Behdad Esfahbod
c802cd2d62 [Type1] Synch comments in the encoding table 2006-08-13 20:16:22 -04:00
Pavel Roskin
e5f36a54da [Type1] Use NULL instead of 0
Using NULL is encouraged for pointers.  While fixing that, it turned out
that the comments indicating the current index were wrong, so I'm fixing
them too.
2006-08-13 05:09:28 -04:00
Pavel Roskin
fdd7518b8b Update nil surface structs to the surface struct
Quite a few fields were missing, but all zero, so didn't matter
practically, but comments were out of synch.
2006-08-13 05:02:46 -04:00
Behdad Esfahbod
d1520a99d4 Remove the ft_load_sfnt_table check from PS/PDF/SVG backends
and make sure that _cairo_ft_load_truetype_table returns UNSUPPORTED
if the version of FreeType used doesn't support FT_Load_Sfnt_Table.
2006-08-10 13:05:26 -04:00
Behdad Esfahbod
16c18aea52 [PDF] Fix leak: free glyphs 2006-08-08 15:30:56 -04:00
Behdad Esfahbod
ac4922bd07 [TrueType] Zero out padding memory in generated TrueType subset
to make the output deterministic and fix valgrind errors.
2006-08-08 15:27:21 -04:00
Behdad Esfahbod
356e646dc6 [FreeType] Unset and set to FC_RGBA_NONE the FC_RGBA attribute on pattern
if we don't want it.  This stuff is tricky, but I hope to explain:  In your
fontconfig configuration, you may match on "font", or on "pattern".  Turning
subpixel on typically looks like:

        <match target="font">
		<test qual="all" name="rgba">
			<const>unknown</const>
		</test>
		<edit name="rgba" mode="assign"><const>rgb</const></edit>
	</match>

This works good enough, and if you set to ANTIALIAS_GRAY, this will not
override that.  Now one may forget to match on "font" target, or intentionally
match on the pattern.  That happens before cairo font options are substituted
in the pattern.  So, to give a hint of subpixel in your config file, you can
write:

        <match target="pattern">
		<edit name="rgba" mode="assign"><const>rgb</const></edit>
	</match>

You don't really need to check for current values, as FcConfigSubstitute is
run before merging cairo_font_options_t in.  What this patch does, is to reset
pattern's rgba property if the font options explicitly ask for ANTIALIAS_GRAY.
This is the only place in cairo-ft-font.c that we use FcPatternDel, so I
thought some explanation is needed.
2006-08-08 14:04:51 -04:00
Behdad Esfahbod
6ff531c182 [TrueType] Add comment block describing why we only use int16_t 2006-08-08 13:13:18 -04:00
Behdad Esfahbod
23f3888618 [TrueType] More leak fixes 2006-08-08 07:39:31 -04:00
Behdad Esfahbod
519bd3d3e9 [TrueType] Fix leaks. 2006-08-08 07:30:46 -04:00
Behdad Esfahbod
501e5cc883 Restructure subpixel_order handling such that the code doesn't look suspicious!
Shouldn't make /any/ difference at all in any case.
2006-08-08 06:12:13 -04:00