Commit graph

5451 commits

Author SHA1 Message Date
Adrian Johnson
7c268bc838 PS: Enable support for latin subsets
Make PS TrueType embedding use the winansi glyph mapping for latin subsets.

Enable use of latin subsets in PS.
2010-10-01 19:15:30 +09:30
Adrian Johnson
52f3db92a7 Type 1 fallback: add support for latin subsets
For latin subsets the /Encoding array maps the latin encoding to the
font glyphs.
2010-10-01 19:15:30 +09:30
Adrian Johnson
4a0e5b7ced Type 1 subsetting: add support for latin subsets
For latin subsets the /Encoding array maps the latin encoding to the
font glyphs.
2010-10-01 19:15:30 +09:30
Adrian Johnson
01ee091ee9 Add winansi glyph names
for the PS backend and Type 1 subsetters to use with latin fonts.
2010-10-01 19:15:30 +09:30
Adrian Johnson
e62891cd8f Return latin to glyph mapping in cairo_scaled_font_subset_t
so that font subsetters can include the latin to glyph encoding in the
subsetted font.
2010-10-01 19:15:30 +09:30
Adrian Johnson
807e690de4 pdf-operators: output (abc) style strings when font is latin 2010-10-01 19:15:26 +09:30
Adrian Johnson
f1ca978032 Add capability for font subsets to put latin glyphs in a separate subset
This is required to allow PDF/PS output to use "(this is ascii)" style
strings that can be post processed by applications like psfrag. It
will also reduce the file size when a large amount of latin text is
used due to the 8-bit encoding instead of the 16-bit used for CID
fonts.

The winansi encoding (CP1252) is used for the latin subset as this is
a standard PDF encoding. Some PDF readers have buggy support for non
standard PDF 8-bit encodings.
2010-10-01 17:53:11 +09:30
Adrian Johnson
3f817dcfd3 Fix font metrics in PDF Type 1 fonts
edcefa87 introduced a bug in the Type 1 font metrics in PDF files.
2010-10-01 17:41:28 +09:30
Chris Wilson
66ace8cd33 image: The a8 in-place span compositing is only valid for SOURCE
Fixes test/a8-clear.

Reported-by: Jeremy Moles <jeremy@emperorlinux.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-29 13:57:15 +01:00
Chris Wilson
ac6fd51fe4 image: Silence a compile warning
cairo-image-surface.c: In function ‘_cairo_image_reset_static_data’:
cairo-image-surface.c:1006: warning: old-style function definition

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-29 13:56:58 +01:00
Tim Janik
75e2b7c7b5 cairo: docu fix for cairo_set_source_surface 2010-09-23 15:12:06 +02:00
Kouhei Sutou
4cf5260e99 xml: fix a typo to correct the indentation after <path></path>
Signed-off-by: Kouhei Sutou <kou@cozmixng.org>
2010-09-12 10:07:09 +01:00
Chris Wilson
f59771051b drm: Add missing header file for tarball 2010-09-10 13:38:33 +01:00
Chris Wilson
8fca990be7 cairo: Remove trailing comma from cairo_device_t
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30115
Reported-by: Murray Cumming <murrayc@murrayc.com>
2010-09-10 13:35:11 +01:00
Andrea Canciani
8fda4ab1cc image: add _cairo_image_reset_static_data
Image has static caches which needs to be reset to make
cairo_debug_reset_static_data behave as expected.
Silences a bunch of leak reports by check-valgrind.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-09 17:25:00 +02:00
Carlos Garcia Campos
2b6c4c2a64 recording: Document CAIRO_HAS_RECORDING_SURFACE macro 2010-09-09 11:28:03 +02:00
Carlos Garcia Campos
d8f88cf3f9 recording: Fix cairo_recording_surface_create() doc comments
The name of the parameters in the docs should match the name of the
function parameters. Added also return value docs.
2010-09-09 11:00:42 +02:00
Carlos Garcia Campos
737880260f recording: Add section doc comments 2010-09-09 10:57:13 +02:00
Chris Wilson
8258532794 Reduce the cairo_device_type_t to only hold the used entries.
This should help clarify the documentation by not mentioning non-existent
devices and prevent any assumed coupling between surface-type values and
devices.
2010-09-06 13:11:22 +01:00
Chris Wilson
e3afbc1875 check: Fix for link-time-optimisation 2010-09-06 13:11:21 +01:00
M Joonas Pihlaja
a9e055ff48 freelist: Separate freelist inlines from the datatype in headers.
The cairo-freelist-private.h header has a number of static inline
functions which call hidden functions in libcairo.  This poses
a problem on Solaris where the native compiler compiles inline
functions whether they are used or not, thereby adding the
link time requirements on hidden functions from whatever code
that includes cairo-freelist-private.h.  Unfortunately the
boilerplate code includes cairo-private headers and indirectly
the freelist header, so linking the boilerplate helper library
fails on Solaris.

This patch separates the structure definitions from the function
prototypes and static inlines in cairo-freelist-private.h by moving
the datatypes to a new cairo-freelist-type-private.h.
2010-09-02 14:51:30 +01:00
M Joonas Pihlaja
f5632d641c build: Remove stray backslash.
A stray backslash bwetween two assignment lines apparently
invokes a GNU make extension for conditional assignments.
This patch fixes the build when using the native Solaris make.
2010-09-02 13:55:55 +03:00
Benjamin Otte
61a1835e40 subsurface: Fix acquire_source_surface for out-of-bounds surfaces
See subsurface-outside-target test.
2010-09-01 03:17:12 +02:00
M Joonas Pihlaja
9f98ec6eb9 device: Refer the user to per-backend docs about devices.
The exact semantics of the device API can't be spelled out
out in the device API docs since the effects are so tied
to the specific backend.  To use a particular device in
practice the user should refer to the backend docs.
2010-08-29 00:05:51 +03:00
M Joonas Pihlaja
b0f65054b8 subsurface: Add a note to the docs about usage restrictions.
Make our assumptions about constructed subsurfaces explicit
while we work out the correct semantics for the edge cases.
2010-08-29 00:03:07 +03:00
Benjamin Otte
92fe2d370d surface-offset: Use right variable in mask
Use source/mask instead of their copies. The copies only get initialized
if we actually need to translate things.
2010-08-28 17:13:46 +02:00
M Joonas Pihlaja
df4b23ff74 subsurface: Fix crash when acquiring a source image.
The code is passing in the extra info received from
the target surface's acquire_source() method to
_cairo_surface_get_extents() rather than the acquired
source surface itself.
2010-08-27 20:26:06 +03:00
Andrea Canciani
2d146867dc subsurface: Correct cloning condition
72644c6df2 was using the wrong (inverted)
condition to check if the subsurface extents are contained in the
target extents.
2010-08-26 14:50:34 +02:00
Andrea Canciani
72644c6df2 subsurface: Avoid invalid accesses
Whenever subsurface extents are not contained in the target extents,
using the source image given by the target (with origin corrected by
using an appropriate offset in the data pointer) is not a valid
operation. Fallback to cloning in that case.
2010-08-26 14:38:34 +02:00
Andrea Canciani
df4465bdd1 subsurface: Silence compiler warnings
Commit d1c35f5e65 introduced two
unused variable warnings.
2010-08-26 14:23:04 +02:00
Benjamin Otte
d1c35f5e65 subsurface: Don't clip size to target size
This clipping would modify the origin of the subsurface and then the
creator has no easy way to figure this out.
2010-08-26 13:55:02 +02:00
Benjamin Otte
174fb5f16f subsurface: Don't apply device transform twice for source/mask 2010-08-26 13:21:04 +02:00
Benjamin Otte
e79acf47a5 subsurface: Make CAIRO_SURFACE_TYPE_SUBSURFACE public 2010-08-26 12:55:39 +02:00
Benjamin Otte
40459dacb5 subsurface: Don't crash when the device transform isn't integer
Apply the transform before rounding to integer coordinates, so we can
handle doubles easily.
2010-08-26 11:45:28 +02:00
Benjamin Otte
e19b213e84 subsurface: Make subsurfaces their own type
Do not try to hide being a subsurface.
This would cause confusion when users where calling surface-type
specific getters on subsurfaces.

FIXME: We still need public API to access a subsurface's target though.
2010-08-26 11:20:36 +02:00
Benjamin Otte
e65bf64c4a subsurface: Properly account for device offsets in the target 2010-08-26 11:20:36 +02:00
Chris Wilson
8e9c4ea589 Mark the context as invalid on the final cairo_destroy()
We initialise the context to a non-error state upon creation, but after
destroy there is a window of opportunity where the object is kept alive
inside the context pool and the user could mistakenly keep on passing
the zombie context into cairo functions. As all entry points need to
check error status, flagging the context as an error object upon the
final unreference prevents such misuse (until such as time as the
context is reallocated).
2010-08-11 12:18:53 +01:00
Andrea Canciani
56ea51fdcc Replace insertion sort with mergesort in the scan converter
Insertion sort can take up to O(n^2), mergesort is guaranteed to run
in O(n*log(n)).
An example showing bad performance for insertion sort is:
   https://bugs.freedesktop.org/show_bug.cgi?id=28067

The mergesort has been engineered to be fast even when working on
cases where the insertion sort would have performed well and as
expected it shows no changes in the benchmark cairo traces.
2010-08-10 14:39:54 +02:00
Nicolaus L Hepler
a150371a5d ft-font: Make alpha mapping consistent
Vertical RGB mapping previously forced opaque pixels.
To be consistent with horizontal RGB/BGR and vertical BGR it
should use an alpha equal to the mid channel (green).
2010-08-10 09:40:46 +02:00
Benjamin Otte
df8f964234 build: Fudge the build system some more so it handles extra libs
Add NONPKGCONFIG_EXTRA_LIBS that are only put into the generated pc file
but not used when linking. This is now used to add -lcairo-gobject to
the cairo-gobject.pc file.
2010-08-10 01:24:30 +02:00
Rich Walsh
046b642db0 os2: Restore surface type checking in the get_extents method. 2010-08-08 22:33:43 +03:00
Rich Walsh
78bdd87b75 os2: Fix clipping to bounds when blitting pixels.
The bounds checks on the rectangle to blit were done
after converting target/source to inclusive/noninclusive
coordinates rather than before, potentially causing an
off-by-one in the sizes, since the same logic was applied
to both inclusive and non-inclusive coordinates.  This
patch enforces bounds up front.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
d0284687b3 os2: Tweak an inline declaration.
C99 and cairo prefers "static inline <return type>" rather
than "static <return type> inline".

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
cb30340064 os2: Consolidate error paths of cairo_os2_surface_create().
Use a single code path to release the resources acquired
for a surface that's been partially constructed, rather than
have multiple error exits which each release the resources
acquired so far.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
66e3d650fe os2: Document ownership of OS/2 objects passed to surfaces.
Clarify the documentation for cairo_os2_surface_create()
and cairo_os2_surface_set_hwnd() to note that the ownership
of the presentation space and window respectively
remains with the caller.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
0152527154 os2: Don't fake an Anchor Block when one isn't needed.
The code was being tricky about passing in a HAB to
DevOpenDC() even though one isn't needed at all under
OS/2.  Pass in NULL instead.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
883d9725e0 os2: Fix buffer allocator behaviour on arithmetic overflow.
On arithmetic overflow the buffer allocator would attempt
to allocate zero bytes instead of failing the allocation.
Depending on the implementation of the underlying allocator
being proxied, this may result in an allocation of a zero
length buffer, causing all kinds of grief.  This patch
causes arithmetic overflows to explicitly fail the allocation.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
b54037828c os2: Fix blitting 24 bpp pixel data.
There's a format mismatch between cairo's pixel formats
and OS/2 24 bpp data: the individual pixels in OS/2 take
only three bytes per pixel, but there needs to be padding
between lines to make the start of a line always be aligned
at a DWORD boundary.

This patch fixes the format conversion code to include
the required padding between rows.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:39 +03:00
Rich Walsh
5aadecb3ac os2: New API to create surfaces without a persistent HPS.
It's not always necessary to create a presentation space (HPS) for
surface tied to a window, as the user may have one already.  This patch
introduces three new functions to create a surface without an HPS
and let the user manage an HPS associated with the surface.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html

Mozilla Bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=557159
2010-08-08 22:29:39 +03:00
Benjamin Otte
9669faa936 gl: Handle errors from _cairo_gl_gradient_render()
Thanks Andrea for finding this.
2010-08-08 17:23:05 +02:00