Commit graph

5429 commits

Author SHA1 Message Date
Behdad Esfahbod
1dc0f3a1ad [test/user-font] Document that Poppler is buggy with glyph 0 2008-08-06 12:00:28 -04:00
Chris Wilson
0ec6c9ca62 [pdf] Propagate status from emit_glyph()
Propagate the error status from _cairo_pdf_operators_emit_glyph().
2008-08-06 11:11:24 +01:00
Chris Wilson
2dfee9986c [pdf] Fixup a couple of inverted tests.
Check for NULL returns from malloc, instead of reporting errors and
leaking on success.
2008-08-06 10:51:34 +01:00
Chris Wilson
7ffd8bbcb0 [cairo-font-options] Add private alias for set_lcd_filter()
check-plt was rightfully claiming about an internal use of a public
symbol, so add the missing private alias.
2008-08-06 00:36:47 +01:00
Behdad Esfahbod
221599ab0f Finish off lcd-filter merge 2008-08-05 16:36:05 -04:00
Behdad Esfahbod
19b36fb887 [win32] Fix build 2008-08-05 16:36:04 -04:00
Sylvain Pasche
65d017a406 Add tests for the new LCD filter API 2008-08-05 16:30:37 -04:00
Sylvain Pasche
45ec5e77bb Add symbols for setting the LCD filter type on font options 2008-08-05 16:30:37 -04:00
Sylvain Pasche
a0cad6c398 [cairo-ft] Interaction with Fontconfig to deal with the LCD filter type 2008-08-05 16:30:36 -04:00
Sylvain Pasche
f64cf7fb09 [cairo-xlib] Support to retrieve the LCD filter type from the Xrm database 2008-08-05 16:30:36 -04:00
Sylvain Pasche
28d18f3f93 [cairo-ft] Fontconfig defines for LCD constants when using Fontconfig < 2.6
This adds define for compatibility when without the new lcd filtering
constants (Fontconfig patch not yet applied, see bug 13566).
2008-08-05 16:30:36 -04:00
Sylvain Pasche
0013f2c269 Add lcd filter type to the public API and font options
New struct cairo_lcd_filter_t and new functions
cairo_font_options_set_lcd_filter
cairo_font_options_get_lcd_filter
2008-08-05 16:30:36 -04:00
Sylvain Pasche
4b5e0ba720 [cairo-ft] LCD filtering patch coding style corrections 2008-08-05 16:30:35 -04:00
Sylvain Pasche
7f87003517 [cairo-ft] LCD filtering patch from David Turner
This is the patch David Turner wrote some times ago and can be found on
http://david.freetype.org/lcd/cairo-1.2.4-lcd-filter-1.patch. It was
somewhat modified for compatibility with cairo 1.5
2008-08-05 16:30:35 -04:00
Vladimir Vukicevic
acdc306905 [win32] Adding cairo-features-win32.h to EXTRA_DIST 2008-08-05 13:16:17 -07:00
Vladimir Vukicevic
924a242f89 [win32] Update win32 build, remove gcc dependency 2008-08-05 12:57:51 -07:00
Jeff Muizelaar
e1132d434e Make cairo_scaled_font_glyph_extents() unconditionally zero the extents
This makes cairo_scaled_font_glyph_extents() match a similar pattern of
initialization in cairo_glyph_extents(). It also fixes the 'text-zero-len' test
that was broken by 676b221326.
2008-07-30 13:05:01 -07:00
Peter Weilbacher
d560a3d965 [OS/2] Fix build 2008-07-25 11:19:11 -04:00
Behdad Esfahbod
ba95b9dee8 [cairo-ft] Use FcFreeTypeCharIndex instead of FT_Get_Char_Index 2008-07-25 11:18:22 -04:00
Behdad Esfahbod
bc42989501 [configure.in] Cosmetic 2008-07-25 11:18:22 -04:00
Jeff Muizelaar
1a9809baab Fix scaling with a device offset
Apply the device offset transformation to the pattern before the ctm one.
Fixes bug #16469.
2008-07-21 22:24:42 -04:00
Jeff Muizelaar
3074ba02a1 Add a test for scaling a surface with device offset. 2008-07-21 22:08:46 -04:00
Vladimir Vukicevic
96c9e2a1a8 Fix cairo-quartz-image-surface compilation error 2008-07-18 15:55:11 -07:00
Carl Worth
ec9337697e cairo.h: Remove trailing comma in enumeration 2008-07-17 19:31:11 -07:00
Frederic Plourde
5284f8cab4 [win32] Make cairo-perf-diff run on win32 2008-07-17 13:56:22 -07:00
Vladimir Vukicevic
d61c7df1c0 [quartz] Take snapshot instead of using CGImageCreateCopy
CGImageCreateCopy doesn't copy the data provider, so it's possible to
free the data underneath an image without snapshotting it first.
2008-07-09 13:20:53 -07:00
Vladimir Vukicevic
e534b0bed1 [quartz] Protect against NULL from CGFontGetHMetricsPtr
Seems to happen on 10.4 only for unknown reasons.  Protect against a crash at least.
2008-07-09 13:06:23 -07:00
Adrian Johnson
7127089fe6 PDF/PS: Remember the current line style
So we don't need to emit line style parameters that are already set.
2008-07-08 22:57:22 +09:30
Adrian Johnson
837bf73f08 Add PDF operators function to reset any remembered state 2008-07-08 22:00:15 +09:30
Adrian Johnson
9b302fac63 PDF: Oops - turn compression back on 2008-07-08 21:51:41 +09:30
Adrian Johnson
50eb1e71f3 PS: Ensure the color is re-emitted after resetting the clip path
because the graphics state has been restored.
2008-07-08 21:36:19 +09:30
Adrian Johnson
b082c15df6 PDF: Don't use a Form dictionary for the content stream
because pdfTeX (and maybe other PDF consumers) can not handle it.

Previously the content stream was an Form dictionary because at the
time the content is written it is not known whether the content stream
will be belong to the page or be an XObject in a knockout group. With
the additional of the paginated surface function
set_fallback_images_required() this information is now known at the
time the content is emitted.
2008-07-08 21:18:45 +09:30
Adrian Johnson
4fcdc364cd Add paginated surface backend function _set_fallback_images_required 2008-07-08 21:12:54 +09:30
Adrian Johnson
0c05aa60f5 PDF: Limit precision of Td operands
As the translation is in text space, the full precision of a double
for numbers close to zero is not required. Limit the precision to the
same as for numbers > 1.
2008-07-08 21:12:28 +09:30
Adrian Johnson
d5c7b87ca9 PDF: Ensure clip is not emitted outside of stream
Sylvain Munaut discovered a bug in
_cairo_pdf_surface_emit_meta_surface() where the clip may be emitted
after the stream is closed. Fix this by moving the call to
_cairo_surface_set_clip() to before the stream is closed.
2008-07-08 20:57:57 +09:30
Adrian Johnson
130cd29a70 PDF: remove meta surface group clean
The group that was being cleaned up was removed in
099810b6c3
2008-07-08 20:55:38 +09:30
Chris Wilson
fe7973d60a [cairo-scaled-font-subsets] Fix memleak.
Valgrind reported that sub_font_glyph->utf8 was not being freed along
with the cairo_sub_font_glyph_t.
2008-07-06 15:16:30 +01:00
Chris Wilson
07b39ee3c0 [cairo-scaled-font-subsets] Fix use of unitialised variable.
Valgrind reported that pdf-operators tried to use an uninitialised
subset_glyph->utf8_is_mapped.
2008-07-06 15:14:22 +01:00
Adrian Johnson
f92131c38a PS: Remember current color
This allows PDF operators to merge text strings together when they are
all the same color.
2008-07-05 16:23:43 +09:30
Adrian Johnson
dac22cf2b9 PDF: Fix glyph positioning bug in Tj operator
Previously this was not correctly checking the position of the first
glyph and falling back to using TJ if the glyph was not at the the
standard glyph advance.
2008-07-05 16:22:35 +09:30
Adrian Johnson
c9c4b0eded PDF: Fix glyph positioning bug in TJ operator
Previously this was not correctly positioning the first glyph in a TJ
string if the glyph was not at the the standard glyph advance.
2008-07-05 16:19:30 +09:30
Adrian Johnson
0f748df670 PS: Remember position when changing font
Previously the PS emulation of the PDF operators would change the
current position to the text line matrix instead of the the text
matrix when changing the font.
2008-07-05 16:14:31 +09:30
Behdad Esfahbod
1c729f85ed [cairo-pattern] Fix crash in solid-pattern-surface cache
Ickle knew something when he only extended cache size when we are
committed to inserting something into the cache.  I broke that while
fixing other issues a while ago.  This cache just doesn't want to
give us any rest...
2008-07-03 19:15:53 -04:00
Behdad Esfahbod
7c9536b653 [analysis-surface] Fix crashers introduced in my previous commit
Oops!
2008-07-03 18:06:01 -04:00
Adrian Johnson
37ed55acef Add missing status checks 2008-07-03 20:27:50 +09:30
Behdad Esfahbod
85de817e09 [analysis-surface] Fallback between show_glyphs and show_text_glyphs
This is needed because analysis-surface takes any UNSUPPORTED returns
as a signal for using image fallbacks.  So the fallback mechanism in
_cairo_surface_show_text_glyphs() is not enough.  Reported by Adrian
Johnson.
2008-07-02 19:21:50 -04:00
Behdad Esfahbod
d19d9b4149 [cairo-pdf-operators] Fix backward cluster iteration
It's trickier than it appears...

There still remains the question of whether the loop should iterate
utf8 forward and glyphs backward (as it does now), or iterate glyphs
forward and utf8 backward.

Doing utf8 forward has the benefit that glyphs appear in the PDF stream
in the logical order of text.  That may be a good thing.

Doing glyphs forward has the benefit of most glyphs taking their natural
width, providing for a more compact PDF output.

Firefox 3 currently calls cairo_show_glyphs() with glyphs going
right-to-left for RTL runs.  That's like going utf8 forward.

On the other hand, if we are fine doing glyphs backward, then we may as
well remove the "backward" flag and ask callers of show_text_glyphs to
produce glyph array going right to left for RTL runs.  The idea behind
having a backward flag in the first place was to allow keeping utf8 in
logical order and glyphs in visual left-to-right order.  If we don't
do that in practice, there's no point in having the flag.  Another design
idea of the flag was to mark right-to-left runs explicitly so the backend
can use this information.  In that case we probably better rename it to
"rtl" as the current semantics make it perfectly fine to set a LTR segment
with backward flag on: just revers the glyph array...

Anyway, the way to determine the right thing to do is to see how Acrobat
extracts text for RTL text in logical vs visual order.  Then we can decide
what to do in the PDF backend and whether the flag is worth keeping.
Going to experiment with that.
2008-07-01 01:04:10 -04:00
Behdad Esfahbod
c29029ce43 Remove _cairo_surface_show_glyphs() in favor of _cairo_surface_show_text_glyphs() 2008-06-30 22:11:48 -04:00
Behdad Esfahbod
17a5f10f53 [show_text_glyphs] Allow clusters with zero text
As Adrian points out, PDF can handle it, and it doesn't harm allowing.
2008-06-29 15:00:10 -04:00
Behdad Esfahbod
686fa2600d [PDF] Remove show_glyphs that was a wrapper to show_text_glyphs
The cairo-surface layer already does that itself.  Just set show_glyphs
to NULL.
2008-06-29 13:56:14 -04:00