Commit graph

2079 commits

Author SHA1 Message Date
Behdad Esfahbod
1345552ac2 [xlib] Move cairo_xlib_surface_t definition into cairo-xlib-surface-private.h 2007-04-21 02:08:37 -04:00
Peter Weilbacher
735be3f09d Fix build break related to mutexes on OS/2
cairo_mutex_t is HTMX which is ULONG on OS/2, so we have to set the
mutex itself to 0 and not the address...
2007-04-20 20:46:55 +02:00
Chris Wilson
b6be361d0e Clean up compiler warnings from cairo-png
I introduced some compiler warnings into read_png() with the superfluous
introduction of a couple of volatile qualifiers. I'm sure at the time,
the reason was that gcc suggested adding them - however, ATM gcc issues
no warnings without them.
2007-04-20 17:49:10 +01:00
Adrian Johnson
fc455c53ec Ensure _cairo_scaled_font_subsets_map_glyph() returns correct values
The CID font subsetting exposed a bug where the subset_glyph->is_scaled
return argument of _cairo_scaled_font_subsets_map_glyph() is sometimes
not assigned a value.
2007-04-21 00:26:25 +09:30
Adrian Johnson
9d8eb42c01 Exclude Type1 fonts from CID subsets
Make cairo-scaled-font-subsets.c limit Type1 font subsets to
256 glyphs. This allows Type1 subsetting to be enabled again
with type1-fallback as the fallback option for Type1 fonts.
2007-04-20 22:45:12 +09:30
Adrian Johnson
56ad56263b Enable embedding of CID fonts in PDF
Update cairo-pdf-surface.c to embed CFF and TrueType fonts
as CID fonts. Update the ToUnicode CMap to handle CID fonts.
2007-04-20 22:44:04 +09:30
Adrian Johnson
ca3662d6fc Make cairo-output-stream.c accept variable width printf fields 2007-04-20 22:43:37 +09:30
Adrian Johnson
0c2a653033 Add CFF CID Fallback
Switching to CID font embedding requires a fallback font for
the case where CFF CID or TrueType CID subsetting fails.

The new function _cairo_type2_charstrings_init() added to
cairo-type1-fallback.c creates Type2 charstrings from glyph
paths. _cairo_cff_fallback_init() in cairo-cff-subset.c
wraps these charstrings in a CFF CID font.
2007-04-20 22:30:55 +09:30
Adrian Johnson
c68a2389f5 Make CFF Subsetting create CID subsets
OpenType/CFF fonts come in two types: CID and non CID.
CFF CID font subsetting was previously disabled in cairo
due 1) to the need to embed CFF CID fonts in PDF as a CID fonts
and 2) there is no easy way to convert CFF CID to CFF non CID.

With the switch to CID fonts cairo-cff-subset.c has been
updated to subset CID fonts and to covert non CID fonts to
CID. A further advantage of converting non CID CFF fonts
to CID is the reduction in size due to not embedding the
name of each glyph in the font subset.
2007-04-20 22:30:05 +09:30
Adrian Johnson
073fce5a85 Add support for creating CID/composite font subsets
cairo-scaled-font-subsets.c now provides three functions for creating subsets:

  _cairo_scaled_font_subsets_create_scaled()
    Create a subset for each scaled font with maximum size INT_MAX.

  _cairo_scaled_font_subsets_create_simple()
    Create subsets suitable for embedding as simple fonts in PS/PDF.

  _cairo_scaled_font_subsets_create_composite()
    Create subsets suitable for embedding as composite fonts in PS/PDF.

The _create_simple() and _create_composite() functions both merge
scaled fonts with the same face and an outline path available into
the same subset. _create_composite() has a maximum subset size of
65536 for outline fonts. Bitmap fonts have a separate subset for
each scale with a maximum subset size of 256.

The _create_simple() and _create_composite() functions both reserve
the first glyph in the subset for the .notdef glyph. CID fonts require
CID 0 to be .notdef.

Update Type1, TrueType and CFF subsetting to expect glyph 0 of each
subset to be the .notdef.
2007-04-20 22:29:41 +09:30
Chris Wilson
bf957ee0f2 cairo-png - handle short reads
During MT cairo testing we get the error "libpng: Read Error" which is
emitted should the fread return fewer bytes than asked. However, this is
not necessarily an error, so double-check the ferror() status before
raising a png_error().
2007-04-20 09:52:49 +01:00
Behdad Esfahbod
a684fd80e7 [directfb] Silence compiler warning 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
0ffb021e9b [cairo-mutex] If no mutex implementation is found, should #error instead of #warning
otherwise we will cause compile errors before the sanity check macros get
a chance to err.
2007-04-19 16:53:24 -04:00
Behdad Esfahbod
3631c11eb4 [cairo-mutex] Switch to HAVE_WINDOWS_H to use Win32 mutexes 2007-04-19 16:38:23 -04:00
Behdad Esfahbod
d2a824a191 [cairo-commit] Update attribution headers in cairo-mutex-private.h 2007-04-19 16:37:36 -04:00
Behdad Esfahbod
12dfd8bb4b [cairo-mutex] Warn if no mutex definition found and let sanity macros err
about undefined CAIRO_MUTEX macros.
2007-04-19 16:36:43 -04:00
Behdad Esfahbod
6aa823841d [cairo-mutex] Support non-reentrant compilation if CAIRO_NO_MUTEX defined
to 1.
2007-04-19 16:36:10 -04:00
Behdad Esfahbod
e5980f69ad [cairo-commit] Just warn for BeOS and let the sanity check macros err
about undefined CAIRO_MUTEX macros.
2007-04-19 16:31:47 -04:00
Behdad Esfahbod
8ebb054ff9 [cairo-mutex] Prefer "#if CAIRO_SOMETHING" over "#if defined CAIRO_SOMETHING" 2007-04-19 16:30:21 -04:00
Behdad Esfahbod
97c1974780 [cairo-mutex] Add default implementation for CAIRO_MUTEX_INIT
that uses CAIRO_MUTEX_NIL_INITIALIZER.  This used to be the
implementation for pthread because pthread_mutex_init() is
broken.  See d48bb4fbe8.
2007-04-19 16:26:21 -04:00
Behdad Esfahbod
6d2a2dd6d9 [cairo-mutex] Add default no-op implementation for CAIRO_MUTEX_FINI 2007-04-19 16:24:16 -04:00
Behdad Esfahbod
2067d6fa90 [cairo-mutex] Use CAIRO_MUTEX_NOOP when applicable 2007-04-19 16:23:14 -04:00
Behdad Esfahbod
5dda76c90f [cairo-mutex] Err if at least one of mutex macros are not defined 2007-04-19 16:22:02 -04:00
Behdad Esfahbod
f771b9157c [cairo-mutex] Define and use CAIRO_MUTEX_USE_GENERIC_INITIALIZATION
We use the generic initialization if CAIRO_MUTEX_INITIALIZE is not
defined.
2007-04-19 16:21:13 -04:00
Behdad Esfahbod
4fc52e2d49 [cairo-mutex] Define CAIRO_MUTEX_NOOP 2007-04-19 16:19:48 -04:00
Behdad Esfahbod
f9dd8fd0ef [cairo-mutex] Inlucde cairo-features.h and config.h
Previously we were lucky enough to have them included before us
2007-04-19 16:19:25 -04:00
Behdad Esfahbod
4e754cf3df [cairo-truetype-subset] Shut gcc warning up 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
4141e752e2 [cairo-freelist] Remove redundant struct declarations 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
ea817c560c [cairo-mutex] Remove unneeded #undef CAIRO_MUTEX_EXTERNAL 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
0b281085b5 [cairo-mutex] Err on unintended inclusion of cairo-mutex-list-private.h 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
47be7280bf [cairo-mutex] Remove multiple-inclusion guards from cairo-mutex-list-private.h
This is a list header file.  We should not prevent it from multiple
inclusions.
2007-04-19 16:07:15 -04:00
Chris Wilson
55ea0466e2 Embed simple clip XRectangles in cairo_xlib_surface_t
Toolkits like GTK+ almost always set a simple rectangular clip mask before
any cairo operation, so avoid the allocation for this simple case by
embedding a small number of XRectangles into the surface structure.
2007-04-19 20:37:06 +01:00
Mathias Hasselmann
7906a99340 Define INT32 limits on MSVC as noticed by Hans-Jürgen Schäler 2007-04-19 14:54:30 +02:00
Mathias Hasselmann
cc8841645c Properly use CAIRO_MUTEX_{INIT,FINI} and remove CAIRO_MUTEX_LIST_PRIVATE_H sentinal before explicitly including the mutex list. 2007-04-19 13:47:45 +02:00
Mathias Hasselmann
39a633a8f3 Reintroduce DllMain as deterministic mutex initialization path 2007-04-19 13:38:26 +02:00
Mathias Hasselmann
9b348929b5 Introduce CAIRO_MUTEX_FINALIZE as counter-part for CAIRO_MUTEX_INITIALIZE 2007-04-19 13:38:26 +02:00
Mathias Hasselmann
67767afa09 Update _cairo_mutex_initialized during initialization. 2007-04-19 13:38:25 +02:00
Chris Wilson
41c6eebcd1 Optionally provide a pattern to use for creating a similar solid surface.
_cairo_surface_create_similar_solid() creates a fresh pattern to wrap
color, however sometimes the caller already has that pattern available.
In those circumstances we can pass the pattern as well as the color and
avoid the extra allocation.
2007-04-19 11:56:15 +01:00
Chris Wilson
ef60e7c651 cairo-xlib-surface - track picture properties.
By tracking picture properties we can dramatically reduce the amount of
X11 traffic by avoiding redundant changes.
2007-04-19 10:54:02 +01:00
Chris Wilson
9cf0955633 Create opaque similar solid surfaces when possible.
For opaque surfaces the backends may use simpler code paths - for
example, the xlib backend may be able to use the Core protocol rather
than Render. So we only generate a surface with an alpha component if
the color is not opaque.
2007-04-19 09:30:28 +01:00
Chris Wilson
f7b6fc4746 Define a CAIRO_ALPHA_IS_OPAQUE variant that operates on uint16.
Introducing this variant also fixed a bug in _gradient_is_opaque()
which was using the fractional test on a uint16.
2007-04-19 09:30:15 +01:00
Behdad Esfahbod
beadcdf9bd Rename cairo-font.c to cairo-font-face.c 2007-04-18 18:24:09 -04:00
Behdad Esfahbod
f56582ef06 Put back __inline definition for MSC compilers, in both cairo and pixman
Apparently it's too much to expect people compiling on windows to fill
in sensible values for config.h... /sigh
2007-04-18 17:55:05 -04:00
Behdad Esfahbod
48121e97ac [cairoint.h] Define WARN_UNUSED_RESULT if undefined 2007-04-18 17:06:48 -04:00
Dave Yeo
7131f4e6ae [OS2] Fix #include "cairo-mutex-list-private.h" 2007-04-17 15:30:20 -04:00
Chris Wilson
3a3fb0031d Update .gitignore
Add .*.sw? (vim swapfiles).
Add *~ (backup files).
Add *.gcno and *.gcda (gcov intermediates).
2007-04-16 15:08:54 +01:00
Kouhei Sutou
7ff95c7230 Support MinGW DLL compilation 2007-04-16 02:48:14 -04:00
Behdad Esfahbod
84c10a79ff [cairo-pattern] Slightly hackish fix for bug #10508
The so-attributed-to-X-server bug was that cairo maps the drawing
region to the pattern space, rounds the box, and uploads only that
part of the source surface to the X server.  Well, this only works for
NEAREST filter as any more sophisticated filter needs to sneak a peek
at the neighboring pixels around the edges too.

The right fix involves taking into account the filter used, and the
pattern matrix, but for most cases, a single pixel should be enough.
Not sure about scaling down...

Anyway, this is just a workaround to get 1.4.4 out of the door.  I'll
commit a proper fix soon.
2007-04-13 16:33:33 -04:00
Behdad Esfahbod
4e3be54861 [cairo-pattern] Add a TODO item to code 2007-04-12 21:38:25 -04:00
Behdad Esfahbod
04164c996c [cairo-surface] Make sure cairo_surface_get_font_options() fully initializes
the font_options passed in.
2007-04-12 20:14:23 -04:00