Commit graph

3414 commits

Author SHA1 Message Date
Behdad Esfahbod
a1e5d40376 [doc] Another typo fix 2008-08-17 00:11:34 -04:00
Behdad Esfahbod
20d178c1c2 [doc] Fix typo 2008-08-16 21:27:03 -04:00
Chris Wilson
63befc6ab1 [xlib] Remove the key parameter from the close display hook.
By inspecting all the users of the close display hooks, we can see that
(a) the key is redundant and (b) the data is unique to the hook. This
means we can trim the interface and stop the linear searches as soon as
we've found the correct element.
2008-08-14 09:14:51 +01:00
Chris Wilson
84a541a041 [cairo-xlib-surface] Remove status return for SUCCESS only function.
Convert _cairo_xlib_surface_set_repeat() to a void return type, and
update caller, as the function can only return CAIRO_STATUS_SUCCESS.
2008-08-14 09:06:24 +01:00
Chris Wilson
2699a986d3 [cairo-gstate] Guard against unsetting the font unnecessary.
Only unset the current font if we change any of the font settings, i.e.
font_face, font_options, font_matrix and ctm.
2008-08-14 08:59:14 +01:00
Chris Wilson
8552e76ee5 [xlib] Fix leak of pending_free_glyphs on CloseDisplay.
Missing free of the pending_free_glyphs array in
_cairo_xlib_surface_remove_scaled_font.
2008-08-14 08:25:58 +01:00
Chris Wilson
c73b3e43e1 [cairo-surface] Check for the error surface in _get_font_options()
cairo_surface_get_font_options() has the side effect of initialising the
font options on the surface, but fails to check that the surface is
valid first. Therefore if we are passed a read-only error object, we will
trigger a segmentation fault.

Most likely this is the bug behind:
http://bugs.freedesktop.org/show_bug.cgi?id=17096.
2008-08-12 21:30:51 +01:00
Adrian Johnson
922df7fc23 Win32: Fix uninitialized variable 2008-08-12 07:34:24 +09:30
Chris Wilson
31565677db [pattern] Unbounded patterns should have infinite extents.
Fix a slight typo that produced negative sized extents instead of the
maximum.
2008-08-11 20:43:14 +01:00
Behdad Esfahbod
2c53acea0b [src/Makefile.am] Include missing header file 2008-08-11 13:54:26 -04:00
Behdad Esfahbod
6e4ed9ce84 Fix doc syntax 2008-08-11 01:44:54 -04:00
Behdad Esfahbod
f2db80bf9e [gstate] Revert Check for NULL font_face in _cairo_gstate_set_font_face
Revert commit b67d34e960.
cairo_set_font_face() is documented to accept NULL to restore default
font face.  Revert commit that made it reject NULL.
2008-08-10 23:39:44 -04:00
Chris Wilson
fef03ef98a [xlib] Check for depth == 0 in create_surface_internal().
Validate that we find an appropriate depth for the Xlib surface, before
attempting to create the surface. This was manifesting itself with
XInitImage() failures during _draw_image_surface() (actually detected as
a segmentation fault in XPutPixel() due to an incomplete XImage).  So we
also add a couple of asserts to ensure that XInitImage() is successful -
which to the best of our knowledge, they should always be.
2008-08-10 08:44:45 +01:00
Vladimir Vukicevic
ac2781ec08 [dfb] fix crashes due to cached glyphs going away during operation 2008-08-09 22:10:10 -07:00
Vladimir Vukicevic
7fbda72137 [dfb] optimize DirectFB blits 2008-08-09 22:10:06 -07:00
Vladimir Vukicevic
a097bafd28 [dfb] correctly handle case of 0 boxes in clip region 2008-08-09 22:10:05 -07:00
Vladimir Vukicevic
a0cfd9962f [dfb] Propagate clip correctly to surface returned from acquire_dest_image
If the internal buffer is wrapped in an image surface in acquire_dest_image,
that image surface needs the current clip region propagated to it.  If not,
then the clip needs to be applied at release_dest_image time.
2008-08-09 22:10:04 -07:00
Vladimir Vukicevic
71f010bb52 [dfb] convert RUN_CLIPPED macro to function with helpers
This helps with debugging and prepares the way for some future
code cleanup.
2008-08-09 22:10:02 -07:00
Adrian Johnson
bc4635f077 Update _cairo_scaled_font_subsets_map_glyph() docs 2008-08-10 14:24:48 +09:30
Adrian Johnson
4c83179418 Win32-printing: Fix Type 1 font printing so fallback is not used
Using glyph indices with Type 1 fonts on a printer DC does not work.
Previously there was a temporary fix where Type 1 fonts were printed
as filled paths.

Now that _cairo_scaled_font_subsets_map_glyph() provides the reverse
mapping of the glyph index fix this by converting the glyph indices
back to the unicode values when printing Type 1 fonts.
2008-08-10 14:24:16 +09:30
Adrian Johnson
b34c248b92 Fix _cairo_sub_font_map_glyph() to return correct unicode value 2008-08-10 14:18:52 +09:30
Adrian Johnson
d1c619bc7d win32-font: Make cairo_show_text() work again
For now implement _ucs4_to_index() and leave _text_to_glyphs()
disabled.
2008-08-10 14:17:01 +09:30
Behdad Esfahbod
5227897b17 Add note about zero-glyph clusters 2008-08-08 17:13:27 -04:00
Chris Wilson
49fb0e834e [matrix] Prefer a return parameter for _compute_determinant().
Returning a double tends to be slightly more efficient than passing a
pointer to fill, and is a lot easier to read.
2008-08-08 09:11:10 +01:00
Behdad Esfahbod
eabe572981 Document all new API
Also validate clusters generated by font backends.
2008-08-08 03:04:38 -04:00
Behdad Esfahbod
38c5f0d49b [scaled-font-subsets] Fix UTF-8 mapping
Prevously all show_text_glyphs() clusters were using ActualText.  This
fixes that.

I have a feeling that the following scenario is broken still though:

  - show_text_glyphs maps glyph 1 to some utf8 text different from
    what index_to_ucs4 will give for glyph 1.  This will assign the
    utf8 text to glyph 1's ToUnicode.

  - show_glyphs shows glyph 1.  Since cluster has no utf8 text, we
    won't use ActualText and fall back to ToUnicode.  But the ToUnicode
    value assigned to glyph 1 is non-standard now.  We should use
    ActualText.

I have not verified this hypothesis though.
2008-08-08 03:01:18 -04:00
Behdad Esfahbod
bc4d363e92 [pdf-operators] Add note about clusters with no glyphs 2008-08-08 03:01:18 -04:00
Behdad Esfahbod
1bc404e346 Make utf8 handling in font subsets more consistent 2008-08-08 03:01:17 -04:00
Behdad Esfahbod
849159ddd1 [truetype] Fix gcc warning about possibly-infinite-loops 2008-08-08 03:01:17 -04:00
Behdad Esfahbod
178789c37a [cairo-scaled-font-subsets] Make utf8 handling more robust 2008-08-08 03:01:17 -04:00
Behdad Esfahbod
d9408041aa Add cairo_scaled_font_text_to_glyphs()
And update user-font text_to_glyphs() method to match.

Currently disable the win32-font text_to_glyphs(), until that one
is updated.  Or better yet, remove it and implement ucs4_to_index().
It's the toy font API afterall.
2008-08-08 03:01:16 -04:00
Behdad Esfahbod
b8fc845094 [cairo-scaled-font-subsets] Fix bug with utf8 handling 2008-08-08 03:01:16 -04:00
Behdad Esfahbod
6b3f6dc77a [unicode] Add _cairo_utf8_get_char_validated() 2008-08-08 03:01:16 -04:00
Behdad Esfahbod
8c514a40b8 Add cairo_glyph/text_cluster_allocate/free
These are needed by the upcoming cairo_scaled_font_text_to_glyphs()
2008-08-08 03:01:16 -04:00
Behdad Esfahbod
b01ad0835d [user-font] Add a cairo_t argument to cairo_user_scaled_font_init_func_t
The init func does not actually need to draw anything, but having a cairo_t
similar to that passed to render_glyph is handy for computing font extents.
This is because cairo makes doing some things really hard (if not impossible)
without a cairo_t.

The user-font-proxy test case is a great example of how the added cairo_t
makes life much easier.
2008-08-08 03:01:15 -04:00
Behdad Esfahbod
d6ae23478a Check for NULL pointer in cairo_set_scaled_font 2008-08-08 03:01:15 -04:00
Behdad Esfahbod
b67d34e960 [gstate] Check for NULL font_face in _cairo_gstate_set_font_face 2008-08-08 03:01:15 -04:00
Behdad Esfahbod
7e57892983 Add toy font constructor and getters
New public API:

	cairo_toy_font_face_create()
	cairo_toy_font_face_get_family()
	cairo_toy_font_face_get_slant()
	cairo_toy_font_face_get_weight()
2008-08-08 03:01:14 -04:00
Behdad Esfahbod
4bb7388b65 Remove unnecessary checks for CAIRO_STATUS_INVALID_STRING
We check that all input text is valid UTF-8.  Not sure why the code
was being lenient to invalid strings.
2008-08-08 03:01:14 -04:00
Chris Wilson
5bac12252c [xlib] Free regions on failure.
Fix leak of regions along error path.
2008-08-08 01:48:43 +01:00
Jeff Muizelaar
16939e1a86 Center the group pattern transform around the device_transformed origin
When popping a group, transform it by the ctm centered at the origin
specified by the device_transform so that it ends up in the right place
when we try to paint. This fixes the regressions caused by
1a9809baab as shown by the pdf backend.
2008-08-07 19:25:40 -04:00
Chris Wilson
f916e2178b [meta] Use the pre-computed device_transform_inverse.
Avoid repeatedly inverting the same matrix by using the pre-computed
inverse.
2008-08-07 23:54:25 +01:00
Chris Wilson
523f725801 [meta] Remove debugging assert.
Remove an old assertion that no error occurred.
2008-08-07 22:00:30 +01:00
Vladimir Vukicevic
34eb420cc7 [misc] Remove trailing comma on enum 2008-08-07 13:25:02 -07:00
Chris Wilson
7c1078b830 Check return from pixman_image_set_filter().
Adding warn_unused_result to pixman detected a couple of instances where
we abused the knowledge that the code currently can not fail, but in
deference to its independent existence we should be more cautious.
2008-08-07 14:01:54 +01:00
Chris Wilson
56619a16dd [cairo-surface] Use the pre-computed device_transform_inverse.
Avoid inverting the device_transform when copying the pattern for the
destination surface by using the pre-computed inverse.
2008-08-07 08:30:57 +01:00
Chris Wilson
6a4ddb6f47 [pattern] Set the reference count for stack allocations to 0.
Keep the reference count as zero for temporary, on-stack patterns in
order to detect attempts to keep references beyond their scope. (And
mismatched _init()/_destroy()).
2008-08-07 08:30:09 +01:00
Behdad Esfahbod
64ba6c74db Fix Ubuntu-specific issue with FC_LCD_NONE et al
No idea if Ubuntu will ever learn not to modify public API of
common libraries without any clue of what kind of problems they
create by doing that.  They could very well define
FC_UBUNTU_LCD_FILTER if they wanted to, but no, they defined
FC_LCD_FILTER as if it's an upstream thing.  It wasn't.
2008-08-06 18:37:03 -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