Commit graph

7375 commits

Author SHA1 Message Date
Adrian Johnson
28e3a20d79 PDF: Fix TrueType font metrics 2007-02-04 23:47:28 +10:30
Adrian Johnson
05ff2c77da PDF: Add Encoding dictionary to TrueType fonts
This is a fix for the bugs reported here

  http://lists.freedesktop.org/archives/cairo/2006-December/008984.html

  http://lists.freedesktop.org/archives/cairo/2007-January/009387.html

Cairo PDFs will not print correctly from Adobe Reader. The symptoms are
that all the glyphs on the page are replaced with the same glyph.

According to the PDF Reference an Encoding dictionary is not required
for the symbolic fonts used by cairo. However including the Encoding
dictionary fixes the printing problem.
2007-02-04 19:00:16 +10:30
Adrian Johnson
3f8d5f505a TrueType: Include notdef glyph in the subset
Required by the TrueType specification.
2007-02-04 18:21:50 +10:30
Adrian Johnson
d22ba141e6 TrueType Subsetting: Whitespace change 2007-02-04 16:58:04 +10:30
Adrian Johnson
e4a5011a27 TrueType Subsetting: Add comment 2007-02-04 16:51:44 +10:30
Eugeniy Meshcheryakov
7d05b9bdd3 TrueType Subsetting: Sort table directory
The TrueType specification requires the table directory
to be sorted by tag.
2007-02-04 16:36:01 +10:30
Eugeniy Meshcheryakov
8b31761583 TrueType Subsetting: Correct the checksum calculation of 'head' table
Checksum field should be zero before calculating checksum.
2007-02-04 16:22:12 +10:30
Eugeniy Meshcheryakov
0bf5e18b14 TrueType Subsetting : Correct the checksum calculation 2007-02-04 16:19:05 +10:30
Carl Worth
c621201a41 Don't finish a finished surface in cairo_surface_destroy
Calling cairo_surface_finish from cairo_surface_destroy was
triggering an error due to finish being called twice. The
error was usually hidden as the surface would still eventually
be destroyed. But it did clutter things up quite badly if a
user was trying to break on _cairo_error to track down a
problem.

Thanks again to Stuart Parmenter <stuartp@gmail.com>
for pointing out the problem.
2007-02-01 16:05:59 -08:00
Carl Worth
159359325d Fix crashes in cairo_surface_finish for NULL or nil
Thanks to Stuart Parmenter for alerting us of this bug.
2007-02-01 15:22:27 -08:00
Eugeniy Meshcheryakov
7abfb39709 CFF Subsetting: Add charset data to embedded font
Current code for subsetting CFF fonts does not write charset information
into it. According to spec this means that font have ISOAdobe charset.
This charset contains only 228 names (excluding .notdef). This is not
enough for subfonts with 256 glyphs and causes bugs when viewing
generated PDFs.
2007-01-28 19:01:38 +10:30
Carl Worth
a63ceef06c Fix _cairo_pattern_acquire_surface_for_surface to not clone outside surface extents
Rotation and other transformations would cause extents to be
computed which were outside the bounds of the surface to be
cloned, (and for non repeating patterns). Now we simply
restrict the computed extents to the surface extents.

This fixes the xlib failure of the recent rotate-image-surface-paint
test, (the apparently distinct ps failure remains).
2007-01-26 18:03:43 -08:00
Vladimir Vukicevic
8ff70d6b91 [win32] regression with win32 glyph y-offsets (mozbug#365021) 2007-01-25 12:01:50 -08:00
Vladimir Vukicevic
0231d18a57 [atsui] add function prototype for a public 10.4 function that's 2007-01-25 12:01:50 -08:00
Eugeniy Meshcheryakov
50136a7806 [PDF-CFF] Fix bad /LastChar value for CFF fonts in PDF backend
PDF backend sets /LastChar value in Type1C font dictionary incorrectly.
acroread then complains about incorrect /Widths in font.
The last char is numchars - 1, since it's zero-based.
2007-01-24 15:51:00 -05:00
Michael Emmel
bb02b4e5ec Merge branch 'master' of ssh+git://git.cairographics.org/git/cairo 2007-01-23 22:22:20 -08:00
Michael Emmel
48c2896f69 Turned off acclerated rectangle drawing in dfb backend
causes bugs in gtk
2007-01-23 22:17:24 -08:00
Brian Ewins
c316b7220d [ATSUI] Some glyph operations cannot be 'unsupported'. (#9530)
The atsui font backend returned the internal 'unsupported' error 
code for errors in operations that do not have fallbacks. Now that 
the underlying cause, deleted glyphs, has been fixed, I'm changing 
the status code returned to the public 'no memory' one; it should 
be the only condition triggering the failure now.
2007-01-22 01:13:50 +00:00
Brian Ewins
49b9f0c082 [ATSUI] out-of-range glyphs should be treated as deleted. (#9530)
Glyphs outside the range 0x0-0xffff are not valid in atsui, but
scaled_glyph stores unsigned long. Ensure that invalid values do
not cause errors.
2007-01-22 01:10:52 +00:00
Brian Ewins
4dfa5d33e4 [ATSUI] Handle deleted glyphs correctly. (#9530)
This code ensures that deleted glyphs are not drawn.
2007-01-22 01:09:49 +00:00
Behdad Esfahbod
1a8d0a33ce PDF: Fix approximate diagonal in recent commit
Use x+y as an upper bound for sqrt(x*x+y*y), not x*y.
2007-01-20 13:01:35 -05:00
Carl Worth
87b3ac10af cairo-wideint: Fix to eliminate comparison of signed and unsigned values 2007-01-20 02:01:29 -08:00
Carl Worth
6c40575a22 Fix two misspellings in a recent comment. 2007-01-19 23:23:32 -08:00
Carl Worth
5f9d70a561 PDF: Fix CAIRO_EXTEND_NONE for source surface patterns
The former workaround for the lack of non-repeating patterns in PDF
(as far as we can tell) was broken for a source pattern matrix that
resulted in scaling the source surface pattern down. This was
demonstrated by the failure of the scale-down-source-surface-paint
test which now passes.

The old code would have also allowed for bogus repeated pattern
instances to appear if the source surface pattern was translated
sufficiently far off the destination surface in just the right
direction. This bug is also fixed.
2007-01-19 23:11:09 -08:00
Vladimir Vukicevic
d08502d939 Merge branch 'master' of git+ssh://git.cairographics.org/git/cairo 2007-01-18 16:50:41 -08:00
Vladimir Vukicevic
7b67c20a01 [nquartz] use pattern snapshots, and correctly setup/teardown source
Use a snapshot for the pattern, to avoid the pattern being freed undreneath
us before we actually render (as when rendering to a CG PDF context).  Also
correctly return UNSUPPORTED from setup source, avoiding brokenness when
the source isn't torn down correctly.
2007-01-18 16:49:14 -08:00
Carl Worth
28d6a228f0 Fix cairo_get_dash and cairo_get_dash_count APIs
Make these functions consistent with other cairo_get functions
by making cairo_get_dash_count return the count directly, and
removing the cairo_status_t return value from cairo_get_dash.
2007-01-18 13:09:23 -08:00
Carl Worth
bc7072064e cairo-path-fixed: Don't add redundant, succesive MOVE_TO operations to the path
Instead, we can simply tweak the argument value for the last
MOVE_TO operation that's already at the end of the path.

This helps backends like pdf that are currently emitting all
of the redundant MOVE_TO operations in the output.
2007-01-17 16:24:00 -08:00
Vladimir Vukicevic
d9df44d807 Merge branch 'master' of git+ssh://git.cairographics.org/git/cairo 2007-01-17 15:08:21 -08:00
Robert O'Callahan
4e1c2b1ad8 Rename cairo_copy_clip_rectangles to cairo_copy_clip_rectangle_list 2007-01-17 15:07:31 -08:00
Adrian Johnson
b02b86da5c PDF: Compress the content stream
Use cairo-deflate-stream to compress all content streams emitted by the
PDF surface.
2007-01-17 13:21:26 -08:00
Adrian Johnson
7f246462eb Add cairo-deflate-stream.c
Add a new stream type that compresses the stream using the zlib deflate method.
This is intended for use by the PDF surface.
2007-01-17 13:21:03 -08:00
Adrian Johnson
b3440e8530 PDF: Use Td where possible instead of Tm for positioning glyphs
This avoids emitting the font matrix for every single glyph.
2007-01-17 13:20:43 -08:00
Kjartan Maraas
1002d01683 Remove unused variables (#7963) 2007-01-11 17:59:16 -05:00
Behdad Esfahbod
eff6d3c7a0 [cairo-type1-subset] Do not use an array of pointers, to reduce .data size
We use a string pool plus lookup indices tables now, generated by perl code
embedded before the tables.  The table in question is the default PS encoding
table, so no changes are expected in the future.
2007-01-10 16:54:43 -05:00
Brian Ewins
504cbdae37 [ATSUI] [2/2] Implement CAIRO_SCALED_GLYPH_INFO_SURFACE support.(#9467)
All non-quartz surfaces need to fall back to using glyph surfaces,
in order to clip correctly. This second patch implements glyph
surface support, correcting the unclipped text seen in the clip-operator
test.
2007-01-08 22:57:02 +00:00
Brian Ewins
77171cb8e2 [ATSUI] [1/2] Implement CAIRO_SCALED_GLYPH_INFO_SURFACE support.(#9467)
All non-quartz surfaces need to fall back to using glyph surfaces,
in order to clip correctly. The bug being fixed is visible in the
clip-operator test. This first patch takes out direct rendering support 
for non-quartz surfaces, causing all image tests to fail.
2007-01-08 22:37:22 +00:00
Jinghua Luo
116ae23fc6 Glitz: position large glyph correctly.
I introduced this bug while fixing test glyph-cache-pressure
(commit 3b1d0d3519). I also changed
GLYPH_CACHE_MAX_HEIGHT and GLYPH_CACHE_MAX_HEIGHT to 96, then we
still can cache at least 28 glyphes per font(512 ^ 2 / 96 ^ 2).
This make us not hit slow path too much and improve performance
a lot.
2007-01-08 16:51:28 +08:00
Brian Ewins
aed4029a10 [ATSUI] Refactor code for creating CGBitmapContexts from cairo surfaces.
No changes to test output. This just prepares code for reuse when 
implementing support for CAIRO_SCALED_GLYPH_INFO_SURFACE.
2007-01-08 01:23:16 +00:00
Brian Ewins
9a005c6221 [ATSUI] correct the rotation of glyph paths. (#9378)
This fixes a bug visible in the text-rotate test when 
CAIRO_TEST_GENERATE_REFERENCE_IMAGE is defined.
2007-01-08 01:07:44 +00:00
Brian Ewins
58265f3508 [ATSUI] Select Bitstream Vera and CSS font families reliably.
Previously the code selected using the family name; this intermittently
selected a bold or italic face instead of the regular one. The new approach
is to select the desired font instance directly if possible, and only use
the family lookup if that fails. This isn't 100% correct but should always
provide the correct font instance for CSS generic font families. The
bug was sometimes reproducible with the select-font-face test.
2007-01-08 00:54:38 +00:00
Brian Ewins
d30b1bf157 [ATSUI] Scale glyphs using _cairo_matrix_compute_scale_factor (#9350)
This bug shows up in the text-rotate test.
2007-01-07 13:46:00 +00:00
Behdad Esfahbod
ded08256ef Spell check the docs 2007-01-07 02:08:15 -05:00
Alp Toker
caa3c2e1e7 Fix various code/comment typos 2007-01-07 01:35:15 -05:00
Carl Worth
c96a71e709 Restrict _clip_and_composite_trapezoids to destination extents
This is a fix for a huge performance bug (as measured by perf/long-lines).
Previously, if no explicit clip was set, _clip_and_composite_trapezoids
would allocate a mask as large as the trapezoids and rasterize into it.
With this fix, it restricts the mask by the extents of the destination
surface.

This doesn't address the identical performance problem with the xlib
backend, which is due to a very similar bug in the X server.

image-rgb  long-lines-uncropped-100 465.42 -> 5.03: 92.66x speedup
█████████████████████████████████████████████▉
image-rgba long-lines-uncropped-100 460.80 -> 5.02: 91.87x speedup
█████████████████████████████████████████████▍
2007-01-05 16:50:11 -08:00
Behdad Esfahbod
11dd9eab69 [src/Makefile.am] Don't remove cairo-features.h in "make clean"
That's generated by configure, so it should be removed by "make distclean".
2007-01-04 23:36:32 -05:00
Jonathan Watt
d4a58b2437 Remove WINVER from public header file 2007-01-04 16:46:22 +01:00
Peter Weilbacher
e6369f9478 Fix for OS/2 display drivers that cannot handle 32bit output (feed them a 24bit buffer instead). 2007-01-04 00:11:44 +01:00
Behdad Esfahbod
eafd6e454a In _cairo_scaled_font_text_to_glyphs, bail if text is zero-length (#5177) 2006-12-28 20:01:18 -05:00
Jinghua Luo
2d30161e89 glitz: fix all compiler warnings in glitz backend. 2006-12-24 18:31:02 +08:00