Commit graph

338 commits

Author SHA1 Message Date
Owen Taylor
d4ae84f397 Fix x2/x1 typo. 2005-02-12 18:23:04 +00:00
Carl Worth
f3f63f3924 Return all-zero extents if string is NULL. 2005-02-12 13:01:39 +00:00
Kristian Høgsberg
b33f37ff04 Make clipping fast path fast. When we have a clipping region set, intersect it against the drawing extents to determine the bounding box for the visible drawing. 2005-02-12 12:59:53 +00:00
Owen Taylor
67ffc273ef src/cairo_gstate.c src/cairo.c: Allow cairo_set_font (cr, NULL) to unset the current font and return the cairo_t to the the "use the font from cairo_select_font() state". 2005-02-06 15:07:17 +00:00
Owen Taylor
b93f42fae1 Return the right status. (Reported by Hans Breuer.) 2005-02-06 12:00:28 +00:00
Owen Taylor
092c5ca558 Free glyph_indices, not glyphs. (Reported by Hans Breuer.) 2005-02-05 21:42:47 +00:00
Owen Taylor
b0ee983a7d Don't free *glyphs when succeeding! (Reported by Øyvind Kolås)
Temporarily disable glitz by default.
2005-02-05 17:01:29 +00:00
Carl Worth
5707a69bfc Generate an error during make install if old cairo headers are found in includedir, (rather than includedir/cairo where the new ones are going). 2005-02-04 08:04:36 +00:00
Owen Taylor
56d84bb856 Fix missing cairo_ft_font_unlock_face().
Fix problem when no entry could be found.
2005-02-03 15:24:35 +00:00
Owen Taylor
913e39b6ee src/cairo_font.c src/cairo.h doc/public/cairo-sections.txt: Add cairo_font_extents().
src/cairo_win32_font.c src/cairo-win32.h doc/public/cairo-sections.txt: Rename cairo_font_create_for_logfont() into cairo_font_create_for_logfontw() to make clear what it takes. Don't add cairo_font_create_for_logfonta() for now.
2005-02-02 23:14:55 +00:00
Owen Taylor
749a8c1e7b src/cairo_win32_font.c doc/public/cairo-sections.txt doc/public/Makefile.am: Add windows functions to the docs. 2005-02-02 19:52:22 +00:00
Owen Taylor
72a4420234 Add some functions to select the font into a device context with the intention to enable callers to use, e.g, Uniscribe.
Use 'hdc' not 'dc' for param/variable name.
Return immediately if height or width is 0.
2005-02-02 18:57:40 +00:00
Owen Taylor
199c41dafe Mostly-functioning Win32 font backend; no glyph paths yet.
Turn on building of the Win32 font backend.
src/cairo-win32-private.h src/Makefile.am: Private header for the Win32 backend.
src/cairo-win32-private.h src/cairo_win32_surface.c: Internally export _cairo_win32_print_gdi_error() for use in the font code.
src/cairo-win32-private.h src/cairo_win32_surface.c: Add _cairo_win32_surface_create_dib to create a DIB surface.
src/cairo-win32-private.h src/cairo_win32_surface.c: Add _cairo_surface_is_win32()
Check for vasnprintf.
Add a simple fixed-buffer size snprintf fallback in the absence of vasnprintf.
2005-02-01 21:45:51 +00:00
Kristian Høgsberg
211d115f18 Pretend we support compositing of solid color or gradient patterns to prevent image fallback. (emit_pattern): New function, code factored out from _cairo_pdf_surface_composite_trapezoids. (_cairo_pdf_surface_show_glyphs): Use emit_pattern here so we get pattern support for text.
Fix typo.
2005-02-01 20:47:43 +00:00
Owen Taylor
32ada34ddb Commit earlier missed new file
src/cairo_unicode.c src/cairoint.h src/Makefile.am: Add _cairo_utf8_to_utf16(), _cairo_utf8_to_ucs4() based on code from GLib.
2005-02-01 16:29:17 +00:00
Owen Taylor
711d7965c8 src/cairo_unicode.c src/cairoint.h src/Makefile.am: Add _cairo_utf8_to_utf16(), _cairo_utf8_to_ucs4() based on code from GLib.
Add CAIRO_STATUS_INVALID_STRING
Use _cairo_utf8_to_ucs4().
Add cairo_bool_t
Add TRUE/FALSE definitions.
src/cairo.[ch] src/cairoint.h src/cairo_gstate.c: switch cairo_in_stroke/cairo_in_fill and all the functions used to implement them over to cairo_bool_t.
2005-02-01 15:06:33 +00:00
Owen Taylor
f4ccbb4615 Forgotten commit:
src/cairo_gdip_font.cpp src/cairo_gdip_surface.cpp: Remove remnants of a GDI+ based backend.
2005-01-31 16:41:06 +00:00
Owen Taylor
86c8755e59 configure.in src/cairo-features.h.in: Add a check for the Windows platform and --enable-win32. Also add some (currently always off) stubs for native Win32 fonts.
Make building the PDF backend conditional on having FreeType.
src/Makefile.am src/cairo_win32_surface.c src/cairo_win32_font.c src/cairo-win32.h: Add a Win32 backend using GDI and software fallbacks Font code is not yet there yet, but it works with the fontconfig backend.
src/cairo_gdip_font.cpp src/cairo_gdip_surface.cpp: Remove remnants of a GDI+ based backend.
Prefer platform-specific font backends to the fontconfig backend.
2005-01-31 16:11:37 +00:00
Owen Taylor
26148a1d15 src/cairoint.h src/cairo_image_surface.c src/cairo_pdf_surface.c src/cairo_png_surface.c src/cairo_surface.c src/cairo_xlib_surface.c: Replace the get_image()/set_image() backend operations with a more specific {acquire,release}_{source,dest}_image() and clone_similar().
src/cairoint.h src/cairo_pattern.c: Replace _cairo_pattern_get_surface() with a _cairo_pattern_begin_draw()/_cairo_pattern_end_draw() pair.
Save the format for which an image is created so we can access it later. (Needed for the _cairo_xlib_surface_clone_similar())
src/cairoint.h src/cairo_image_surface.c: Add _cairo_surface_is_image().
Add CAIRO_OK(status) to check for CAIRO_STATUS_SUCCESS.
In the absence of of RENDER, make cairo_xlib_surface_create_similar() return an image surface.
Don't try to use RENDER to composite glyphs in the absence of the RENDER extension.
2005-01-31 08:50:22 +00:00
Owen Taylor
608a52ff93 Update composite-over-white code to use a pattern, not a surface. (to match _cairo_surface_composite API change.) 2005-01-30 11:37:48 +00:00
Owen Taylor
dca785faaf Fixes from David Reveman:
Don't save to surface part of the union when the pattern isn't a surface pattern. (_cairo_pattern_get_surface): Create the new surface at the width and height of the source.
Add cairo-ft-private.h
2005-01-30 11:28:14 +00:00
Kristian Høgsberg
a24f2f909e Update prototype to eliminate warning.
Remember to reference surfaces when copying patterns.
Don't call _gstate_create_pattern for internally created patterns. (_cairo_gstate_show_surface): Don't change the surface matrix here, it's done later when we set it up as a pattern.
Correct clip_twice-ref.png filename.
Add these.
Fix broken intersection code.
2005-01-28 12:27:23 +00:00
Kristian Høgsberg
4c329eecb9 Make sure we always return a surface similar to dst in the gradient case. 2005-01-27 21:14:04 +00:00
Kristian Høgsberg
79c8b29c3b Fold _cairo_pattern_get_image into _cairo_pattern_get_surface and make sure we always return a surface of the same type as dest.
Use _cairo_pattern_get_surface instead of _cairo_pattern_get_image.
Remove use of _cairo_xlib_surface_clone_similar since _cairo_pattern_get_surface always gives us an xlib surface for the pattern. Clean up error handling code in _cairo_xlib_surface_show_glyphs.
Add missing cairo_surface_destroy and tidy up offset calculations as suggested by Owen.
Simplify code for computing the extents of clipping area, by introducing a couple of cairo_rectangle_t functions.
2005-01-27 19:57:31 +00:00
Kristian Høgsberg
8e90ae2f65 Simplify code for computing the extents of clipping area, by introducing a couple of cairo_rectangle_t functions. 2005-01-27 17:21:13 +00:00
Owen Taylor
e0de000336 src/cairo.[ch] src/cairo_font.c src/cairo_ft_font.c src/cairo_ps_surface.c src/cairo_xlib_surface.c: Move docs from docs/reference, with a fair bit of addition and rewriting.
Remove old-format docs.
Add a AC_PREREQ(2.54) (Jason Dorje Short)
2005-01-27 15:46:16 +00:00
Owen Taylor
0f5b7d82de configure.in Makefile.am docs/Makefile.am docs/public/*: Add framework for doing docs via gtk-doc.
src/cairo.[ch] src/cairo-matrix.c: Add some inline docs for arcs and matrices.
gtk-doc.m4 acinclude.m4: Check in files from gtk-doc to make the dependency on gtk-doc optional.
Add --enable-gtk-doc to the default args.
2005-01-27 11:35:25 +00:00
Kristian Høgsberg
17ec6f1482 The overall idea of this rewrite is that we want to pass the source pattern all the way down into the backends. The motivation for this is that not all backends want a surface for the source operand, and by passing the pattern down, backends can choose to convert it to a surface if they need that.
The patch removes the create_surface function pointer from the surface vtable and moves much of that code into a couple of helper functions. The composite, compsite_trapezoids, and show_glyphs backend functions are updated to take a cairo_pattern_t instead of a surface as the source.
Change these functions to not create a surface for the pattern and just pass the pattern down to the backend functions.
New function to translate a set of trapezoids.
Break out the code to adjust and restore surface transformation and repeat settings into _cairo_pattern_prepare_surface and _cairo_pattern_restore_surface.
Split cairo_pattern_create_for_surface into an init function and a create function.
Utility functions to create a surface from a pattern.
Update these backends to work with the new pattern API. Glitz work by David Reveman.
Update these to pass through the new set of args.
Update this reference image as we now render it correctly.
2005-01-27 10:46:20 +00:00
Alexander Larsson
dfee909d51 Fix access to uninitialized data
key must be first element in cache entry
2005-01-26 06:49:16 +00:00
David Reveman
e5e0880d67 Update mail address 2005-01-25 12:25:29 +00:00
David Reveman
b35c7a3ee5 Track changes to glitz 2005-01-25 12:21:32 +00:00
David Reveman
71f65cbad2 Add missing include directive so xcb backend compile again 2005-01-25 12:11:02 +00:00
Carl Worth
b321202d18 Fixed rounding of glyph positioning. 2005-01-25 11:48:59 +00:00
Owen Taylor
a812c7a066 Chec pdf_font for NULL, not font. 2005-01-25 10:56:50 +00:00
Alexander Larsson
55a8b62ec4 Fix typo that made cairo-ft.h not get installed 2005-01-25 06:50:33 +00:00
Carl Worth
e2afdd1458 Conditionally install header files only for backends that are compiled. Thanks to Shawn T. Amundson <amundson@gtk.org>. 2005-01-24 09:10:51 +00:00
Carl Worth
31f05254ff Qualify color argument as const. Closes bug #2336. 2005-01-24 09:01:52 +00:00
Dave Beckett
c58f6a4bcf Protect switch on hintstyle with #ifdef FC_HINT_STYLE. 2005-01-23 15:16:57 +00:00
Carl Worth
7114a77ce1 Add instructions for handling the new -head suffix of CAIRO_VERSION at release-time.
Append -head to CAIRO_VERSION to indicate state between snapshots.
2005-01-23 12:49:56 +00:00
Owen Taylor
7275be538b Call _cairo_gstate_ensure_font(). Don't reference the returned font. 2005-01-21 15:43:55 +00:00
Owen Taylor
e613961f94 Make dependence on FC_HINT_STYLE conditional. (reported by Abraham Egnor)
Use FT_LOAD_MONOCHROME if FT_LOAD_TARGET_MONO isn't defined for compatibility with older FreeType.
2005-01-21 15:31:15 +00:00
Owen Taylor
97424a3c2a Change cairo_font_t to refer to a font scaled to a particular output device resolution.
src/cairoint.h src/cairo_font.c src/cairo_ft_font.c src/cairo_xlib_surface.c src/cairo_pdf_surface.c src/cairo_gstate.c src/cairo.c: Switch many internal methods from handling cairo_unscaled_font_t and cairo_font_scale_t pairs to handling cairo_font_t.
src/cairo-ft-private.h src/cairo_ft_fontc: Add some internal interfaces for use by the FreeType backend.
Clear the gstate's current font when the transform or target surface changes.
src/cairo.h src/cairo_ft_font.c: Rename cairo_ft_font_pattern to cairo_ft_font_get_pattern().
src/cairo.h src/cairo_ft_font.c: Make cairo_ft_font_create() and cairo_ft_font_create_for_ft_face() take a font scale; make the latter take load_flags for FT_Load_Glyph() as well. Change cairo_ft_font_face() to Xft-style cairo_ft_font_lock_face, cairo_ft_font_unlock_face.
Remove the name/slant/weight=>unscaled font cache, it didn't work with the new cairo_font_t setup. If it turns out to be needed, it can be added back in some other form.
src/cairoint.h src/cairo_font.c: Add a 'flags' field to cairo_glyph_cache_key_t, we use it for load flags with freetype backend.
Switch the caching to be from resolved fontconfig pattern => file; keep only a fixed number of FT_Face objects open at once, similar to FreeType.
src/cairo_gstate.c src/cairoint.h: Add public cairo_font_glyph_extents, use it to implement _cairo_gstate_glyph_extents().
Add refcounting for glyph cache elements; there was an bug where elements got ejected from the cache and freed before they could be used.
src/cairoint.h src/cairo_cache.c (_cairo_cache_random_entry()) New function to return a random entry in the cache matching a predicate; reuse the internals for the previous _random_live_entry().
src/cairoint.h src/cairo_cache.c (_cairo_cache_lookup()): Add an optional created_entry return value.
src/cairo_ft_font.c src/cairo_xlib_surface.c: Adapt to _cairo_cache_lookup() change.
Support max_memory == 0 to indicate an unbounded cache.
src/cairoint.h src/cairo_cache.c (_cairo_cache_remove()): Add a function to manually remove entries from the cache.
Update for changes, document cairo_matrix_t, cairo_glyph_t, etc.
src/cairo.h src/cairo-atsui.h src/cairo-ft.h src/cairo-glitz.h src/cairo-pdf.h src/cairo-png.h src/cairo-ps.h src/cairo-quartz.h src/cairo-xcb.h src/cairo-xlib.h: Add CAIRO_BEGIN/END_DECLS for extern "C", use it on all public headers. Move header guards outermost.
Fix encoding.
2005-01-21 14:33:47 +00:00
Carl Worth
0ad3789985 Created new public header cairo-atsui.h.
Build fixes for Quartz backend courtesy of Geoff Norton <gnorton@customerdna.com>:
Fix check for atsui font backend.
Add conditional compilation for cairo_atsui_font.c and cairo_ft_font.c.
Add missing include of cairo-quartz.h.
Add include of Carbon/Carbon.h.
Advertise availability of Quartz surface.
Install cairo-quartz.h, and conditionally compile cairo_quartz_surface.c.
Add autofoo checks to detect quartz backend.
2005-01-20 20:36:25 +00:00
Carl Worth
b646ecfe08 Track various renamings.
Insert new includes for backend-specific header files.
Remove redundant include of cairo-features.h.
Rename header-exclusion macro from _CAIRO_H_ to CAIRO_H. Remove platform-specific grubbing for cairo-features.h and pixman.h in odd places.
Remove all backend-specific prototypes, (as they are now in their own header files).
Remove deprecated
Remove printf.
Convert to utf-8. Use the proper name for multiple-header exclusion (CAIRO_FEATURES_H). Track rename of FREETYPE_FONT_FEATURE to FT_FONT_FEATURE.
Split cairo.h up into cairo.h, cairo-ft.h, cairo-glitz.h, cairo-pdf.h, cairo-png.h, cairo-ps.h, cairo-xcb.h, cairo-xlib.h. Update for rename of cairo_wideint.h to cairo-wideint.h.
Rename CAIRO_HAS_FREETYPE_FONT to CAIRO_HAS_FT_FONT, (to match cairo_ft_font functions and cairo-ft.h).
Update for public header files now in /cairo.
2005-01-20 08:28:54 +00:00
Carl Worth
68d5ba661d Allow NULL values for return pointers so that the user can easily get partial results from cairo_matrix_get_affine, cairo_current_point, and cairo_current_color_rgb as needed. 2005-01-19 12:12:42 +00:00
Carl Worth
429c1f42b5 Fix int* vs. size_t* confusion, (currently in favor of int* but only because that's easier to implement). Thanks to John Ellson <ellson@research.att.com>. Closes bug #2328. 2005-01-19 11:39:06 +00:00
Kristian Høgsberg
6fb833a84c Add byteswap macros missing for bigendian architectures. 2005-01-19 08:03:53 +00:00
Carl Worth
27532eda85 Remove const qualifiers from the header file as well. 2005-01-19 07:11:14 +00:00
Carl Worth
8605b6ae5a Remove useless const qualifier from functions returning simple values, (quiets the warning in gcc4). Thanks to John Ellson <ellson@research.att.com>. Closes bug #2299. 2005-01-19 07:07:00 +00:00
Kristian Høgsberg
e1eec5cf0e Fix double free in error path. (cairo_pdf_ft_font_create): Reference the unscaled font to keep the FT_Face around. (cairo_pdf_ft_font_generate): Initialize end to avoid compiler warning; bail out if table write fails. Fixes from Owen. 2005-01-17 14:59:49 +00:00