diff options
author | Vladimir Vukicevic <vladimir@pobox.com> | 2008-03-17 17:37:19 -0700 |
---|---|---|
committer | Vladimir Vukicevic <vladimir@sleet.local> | 2008-03-17 17:37:19 -0700 |
commit | 9d61f7db8082baf3a223c4ea41a53de372676e40 (patch) | |
tree | 3918bc7f0941ad87cdb3397f26622baf288cf014 | |
parent | e4f087b8b944a26d688afeef4b9ea7a0d0a6e9ec (diff) |
[quartz] Rename ATSUI font to Quartz font
-rw-r--r-- | configure.in | 35 | ||||
-rw-r--r-- | src/Makefile.am | 17 | ||||
-rw-r--r-- | src/cairo-atsui-font.c | 39 | ||||
-rw-r--r-- | src/cairo-atsui.h | 58 | ||||
-rw-r--r-- | src/cairo-deprecated.h | 2 | ||||
-rw-r--r-- | src/cairo-quartz-private.h | 14 | ||||
-rw-r--r-- | src/cairo-quartz-surface.c | 14 | ||||
-rw-r--r-- | src/cairo-quartz.h | 15 | ||||
-rw-r--r-- | src/cairo.h | 4 | ||||
-rw-r--r-- | src/cairoint.h | 10 |
10 files changed, 65 insertions, 143 deletions
diff --git a/configure.in b/configure.in index a47c193b4..0c6d8bdee 100644 --- a/configure.in +++ b/configure.in @@ -360,14 +360,12 @@ CAIRO_BACKEND_ENABLE(quartz, Quartz, quartz, QUARTZ_SURFACE, no, [ quartz_LIBS="-Xlinker -framework -Xlinker Carbon" ]) +CAIRO_BACKEND_ENABLE(quartz_font, Quartz font, quartz-font, QUARTZ_FONT, auto, [ + use_quartz_font=$use_quartz +]) + CAIRO_BACKEND_ENABLE(quartz_image, Quartz Image, quartz-image, QUARTZ_IMAGE_SURFACE, no, [ - dnl There is no pkgconfig for quartz; lets do a header check - if test "x$use_quartz" != "xyes"; then - use_quartz_image="no (requires --enable-quartz)" - else - dnl we already have the header check and libs required from the quartz surface - use_quartz_image="yes" - fi + use_quartz_image=$use_quartz ]) dnl =========================================================================== @@ -703,17 +701,6 @@ AC_SUBST(LIBRSVG_CFLAGS) AC_SUBST(LIBRSVG_LIBS) dnl =========================================================================== - -dnl This check should default to 'auto' once we have code to actually -dnl check for the atsui font backend. - -CAIRO_BACKEND_ENABLE(atsui, ATSUI font, atsui, ATSUI_FONT, no, [ - dnl There is no pkgconfig for atsui; lets do a header check - AC_CHECK_HEADER(Carbon/Carbon.h, , [use_atsui="no (Carbon headers not found)"]) - atsui_LIBS="-Xlinker -framework -Xlinker Carbon" -]) - -dnl =========================================================================== dnl dump backend checking results AC_CACHE_SAVE @@ -1102,7 +1089,7 @@ echo "" echo "the following font backends:" echo " FreeType: $use_ft" echo " Win32: $use_win32_font" -echo " ATSUI: $use_atsui" +echo " Quartz: $use_quartz_font" echo "" echo "the following features:" echo " PNG functions: $use_png" @@ -1121,9 +1108,9 @@ echo "using CFLAGS:" echo $CAIRO_CFLAGS echo "" -if test x"$use_ft" != "xyes" && \ - test x"$use_win32_font" != "xyes" && \ - test x"$use_atsui" != "xyes" ; then +if test x"$use_ft" != "xyes" && \ + test x"$use_win32_font" != "xyes" && \ + test x"$use_quartz_font" != "xyes" ; then AC_MSG_ERROR([Cairo requires at least one font backend. Please install freetype and fontconfig, then try again: @@ -1154,10 +1141,6 @@ if test x"$use_quartz_image" = "xyes" ; then echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/Quartz Image/' fi -if test x"$use_atsui" = "xyes" ; then - echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/ATSUI/' -fi - if test x"$use_os2" = "xyes" ; then echo "$WARNING_MESSAGE" | sed 's,@BACKEND@,OS/2,' fi diff --git a/src/Makefile.am b/src/Makefile.am index 79e387703..f16fd8757 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -185,12 +185,18 @@ cairo_headers += $(quartz_headers) cairo_sources += $(quartz_sources) backend_pkgconfigs += cairo-quartz.pc endif - if CAIRO_HAS_QUARTZ_IMAGE_SURFACE cairo_headers += cairo-quartz-image.h backend_pkgconfigs += cairo-quartz-image.pc endif +quartz_font_sources = cairo-atsui-font.c +cairo_all_sources += $(quartz_font_sources) +if CAIRO_HAS_QUARTZ_FONT +cairo_sources += $(quartz_font_sources) +backend_pkgconfigs += cairo-quartz-font.pc +endif + os_win32_sources = cairo-win32.c cairo_all_sources += $(os_win32_sources) if OS_WIN32 @@ -265,15 +271,6 @@ cairo_sources += $(ft_sources) backend_pkgconfigs += cairo-ft.pc endif -atsui_headers = cairo-atsui.h -atsui_sources = cairo-atsui-font.c -cairo_all_sources += $(atsui_headers) $(atsui_sources) -if CAIRO_HAS_ATSUI_FONT -cairo_headers += $(atsui_headers) -cairo_sources += $(atsui_sources) -backend_pkgconfigs += cairo-atsui.pc -endif - # These names match automake style variable definition conventions so # without these lines, automake will complain during the handling of # the libcairo_la_LIBADD below. (The INCLUDES is an autoconf only diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c index 2d585ea46..6866bb5c7 100644 --- a/src/cairo-atsui-font.c +++ b/src/cairo-atsui-font.c @@ -37,7 +37,7 @@ #include "cairoint.h" #include "cairo.h" -#include "cairo-atsui.h" +#include "cairo-quartz.h" #include "cairo-quartz-private.h" /* @@ -140,7 +140,7 @@ _cairo_atsui_font_face_scaled_font_create (void *abstract_face, } static const cairo_font_face_backend_t _cairo_atsui_font_face_backend = { - CAIRO_FONT_TYPE_ATSUI, + CAIRO_FONT_TYPE_QUARTZ, _cairo_atsui_font_face_destroy, _cairo_atsui_font_face_scaled_font_create }; @@ -149,17 +149,17 @@ static const cairo_font_face_backend_t _cairo_atsui_font_face_backend = { * cairo_atsui_font_face_create_for_atsu_font_id * @font_id: an ATSUFontID for the font. * - * Creates a new font for the ATSUI font backend based on an + * Creates a new font for the Quartz font backend based on an * #ATSUFontID. This font can then be used with * cairo_set_font_face() or cairo_scaled_font_create(). * * Return value: a newly created #cairo_font_face_t. Free with * cairo_font_face_destroy() when you are done using it. * - * Since: 1.4 + * Since: 1.6 **/ cairo_font_face_t * -cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id) +cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id) { cairo_atsui_font_face_t *font_face; @@ -176,6 +176,15 @@ cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id) return &font_face->base; } +/* This is the old name for the above function, exported for compat purposes */ +cairo_font_face_t *cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id); + +cairo_font_face_t * +cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id) +{ + return cairo_quartz_font_face_create_for_atsu_font_id (font_id); +} + static OSStatus CreateSizedCopyOfStyle(ATSUStyle inStyle, const Fixed *theSize, @@ -968,24 +977,8 @@ _cairo_atsui_font_text_to_glyphs (void *abstract_font, return status; } -ATSUStyle -_cairo_atsui_scaled_font_get_atsu_style (cairo_scaled_font_t *sfont) -{ - cairo_atsui_font_t *afont = (cairo_atsui_font_t *) sfont; - - return afont->style; -} - -ATSUFontID -_cairo_atsui_scaled_font_get_atsu_font_id (cairo_scaled_font_t *sfont) -{ - cairo_atsui_font_t *afont = (cairo_atsui_font_t *) sfont; - - return afont->fontID; -} - CGFontRef -_cairo_atsui_scaled_font_get_cg_font_ref (cairo_scaled_font_t *sfont) +_cairo_quartz_scaled_font_get_cg_font_ref (cairo_scaled_font_t *sfont) { cairo_atsui_font_t *afont = (cairo_atsui_font_t *) sfont; @@ -1022,7 +1015,7 @@ _cairo_atsui_load_truetype_table (void *abstract_font, } const cairo_scaled_font_backend_t cairo_atsui_scaled_font_backend = { - CAIRO_FONT_TYPE_ATSUI, + CAIRO_FONT_TYPE_QUARTZ, _cairo_atsui_font_create_toy, _cairo_atsui_font_fini, _cairo_atsui_font_scaled_glyph_init, diff --git a/src/cairo-atsui.h b/src/cairo-atsui.h deleted file mode 100644 index 9f39176d7..000000000 --- a/src/cairo-atsui.h +++ /dev/null @@ -1,58 +0,0 @@ -/* cairo - a vector graphics library with display and print output - * - * Copyright © 2004 Calum Robinson - * - * This library is free software; you can redistribute it and/or - * modify it either under the terms of the GNU Lesser General Public - * License version 2.1 as published by the Free Software Foundation - * (the "LGPL") or, at your option, under the terms of the Mozilla - * Public License Version 1.1 (the "MPL"). If you do not alter this - * notice, a recipient may use your version of this file under either - * the MPL or the LGPL. - * - * You should have received a copy of the LGPL along with this library - * in the file COPYING-LGPL-2.1; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * You should have received a copy of the MPL along with this library - * in the file COPYING-MPL-1.1 - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY - * OF ANY KIND, either express or implied. See the LGPL or the MPL for - * the specific language governing rights and limitations. - * - * The Original Code is the cairo graphics library. - * - * The Initial Developer of the Original Code is Calum Robinson - * - * Contributor(s): - * Calum Robinson <calumr@mac.com> - */ - -#ifndef CAIRO_ATSUI_H -#define CAIRO_ATSUI_H - -#include <cairo.h> - -#if CAIRO_HAS_ATSUI_FONT - -/* ATSUI platform-specific font interface */ - -#include <Carbon/Carbon.h> - -CAIRO_BEGIN_DECLS - -cairo_public cairo_font_face_t * -cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id); - -CAIRO_END_DECLS - -#else /* CAIRO_HAS_ATSUI_FONT */ -# error Cairo was not compiled with support for the atsui font backend -#endif /* CAIRO_HAS_ATSUI_FONT */ - -#endif /* CAIRO_ATSUI_H */ diff --git a/src/cairo-deprecated.h b/src/cairo-deprecated.h index 35a4eb995..49aab8bb2 100644 --- a/src/cairo-deprecated.h +++ b/src/cairo-deprecated.h @@ -104,6 +104,8 @@ #define cairo_ps_surface_set_dpi cairo_ps_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution #define cairo_pdf_surface_set_dpi cairo_pdf_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution #define cairo_svg_surface_set_dpi cairo_svg_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution +#define cairo_atsui_font_face_create_for_atsu_font_id cairo_atsui_font_face_create_for_atsu_font_id_REPLACED_BY_cairo_quartz_font_face_create_for_atsu_font_id +#define CAIRO_FONT_TYPE_ATSUI CAIRO_FONT_TYPE_ATSUI_replaced_by_CAIRO_FONT_TYPE_QUARTZ #define cairo_current_path cairo_current_path_DEPRECATED_BY_cairo_copy_path #define cairo_current_path_flat cairo_current_path_flat_DEPRECATED_BY_cairo_copy_path_flat diff --git a/src/cairo-quartz-private.h b/src/cairo-quartz-private.h index 41732fbb5..0ab9bc0e1 100644 --- a/src/cairo-quartz-private.h +++ b/src/cairo-quartz-private.h @@ -92,17 +92,9 @@ _cairo_quartz_create_cgimage (cairo_format_t format, CGDataProviderReleaseDataCallback releaseCallback, void *releaseInfo); -#endif /* CAIRO_HAS_QUARTZ_SURFACE */ - -#if CAIRO_HAS_ATSUI_FONT -ATSUStyle -_cairo_atsui_scaled_font_get_atsu_style (cairo_scaled_font_t *sfont); - -ATSUFontID -_cairo_atsui_scaled_font_get_atsu_font_id (cairo_scaled_font_t *sfont); - CGFontRef -_cairo_atsui_scaled_font_get_cg_font_ref (cairo_scaled_font_t *sfont); -#endif /* CAIRO_HAS_ATSUI_FONT */ +_cairo_quartz_scaled_font_get_cg_font_ref (cairo_scaled_font_t *sfont); + +#endif /* CAIRO_HAS_QUARTZ_SURFACE */ #endif /* CAIRO_QUARTZ_PRIVATE_H */ diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c index 257c5daa0..c0e8a6e37 100644 --- a/src/cairo-quartz-surface.c +++ b/src/cairo-quartz-surface.c @@ -1817,7 +1817,7 @@ _cairo_quartz_surface_stroke (void *abstract_surface, return rv; } -#if CAIRO_HAS_ATSUI_FONT +#if CAIRO_HAS_QUARTZ_FONT static cairo_int_status_t _cairo_quartz_surface_show_glyphs (void *abstract_surface, cairo_operator_t op, @@ -1852,7 +1852,7 @@ _cairo_quartz_surface_show_glyphs (void *abstract_surface, if (op == CAIRO_OPERATOR_DEST) return CAIRO_STATUS_SUCCESS; - if (cairo_scaled_font_get_type (scaled_font) != CAIRO_FONT_TYPE_ATSUI) + if (cairo_scaled_font_get_type (scaled_font) != CAIRO_FONT_TYPE_QUARTZ) return CAIRO_INT_STATUS_UNSUPPORTED; CGContextSaveGState (surface->cgContext); @@ -1872,7 +1872,7 @@ _cairo_quartz_surface_show_glyphs (void *abstract_surface, CGContextSetCompositeOperation (surface->cgContext, _cairo_quartz_cairo_operator_to_quartz (op)); /* this doesn't addref */ - cgfref = _cairo_atsui_scaled_font_get_cg_font_ref (scaled_font); + cgfref = _cairo_quartz_scaled_font_get_cg_font_ref (scaled_font); CGContextSetFont (surface->cgContext, cgfref); CGContextSetFontSize (surface->cgContext, 1.0); @@ -2023,7 +2023,7 @@ BAIL: return rv; } -#endif /* CAIRO_HAS_ATSUI_FONT */ +#endif /* CAIRO_HAS_QUARTZ_FONT */ static cairo_int_status_t _cairo_quartz_surface_mask_with_surface (cairo_quartz_surface_t *surface, @@ -2256,11 +2256,11 @@ static const struct _cairo_surface_backend cairo_quartz_surface_backend = { _cairo_quartz_surface_mask, _cairo_quartz_surface_stroke, _cairo_quartz_surface_fill, -#if CAIRO_HAS_ATSUI_FONT +#if CAIRO_HAS_QUARTZ_FONT _cairo_quartz_surface_show_glyphs, #else - NULL, /* surface_show_glyphs */ -#endif /* CAIRO_HAS_ATSUI_FONT */ + NULL, /* show_glyphs */ +#endif NULL, /* snapshot */ NULL, /* is_similar */ diff --git a/src/cairo-quartz.h b/src/cairo-quartz.h index 5d78d3913..b5c20e631 100644 --- a/src/cairo-quartz.h +++ b/src/cairo-quartz.h @@ -57,10 +57,23 @@ cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext, cairo_public CGContextRef cairo_quartz_surface_get_cg_context (cairo_surface_t *surface); +/* + * Quartz font support + */ + +#ifdef CAIRO_HAS_QUARTZ_FONT + +cairo_public cairo_font_face_t * +cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id); + +#endif /* CAIRO_HAS_QUARTZ_FONT */ + CAIRO_END_DECLS -#else /* CAIRO_HAS_QUARTZ_SURFACE */ +#else + # error Cairo was not compiled with support for the quartz backend + #endif /* CAIRO_HAS_QUARTZ_SURFACE */ #endif /* CAIRO_QUARTZ_H */ diff --git a/src/cairo.h b/src/cairo.h index cf14e6f4a..ab730e7ad 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -1148,7 +1148,7 @@ cairo_font_face_status (cairo_font_face_t *font_face); * @CAIRO_FONT_TYPE_TOY: The font was created using cairo's toy font api * @CAIRO_FONT_TYPE_FT: The font is of type FreeType * @CAIRO_FONT_TYPE_WIN32: The font is of type Win32 - * @CAIRO_FONT_TYPE_ATSUI: The font is of type ATSUI + * @CAIRO_FONT_TYPE_QUARTZ: The font is of type Quartz (Since: 1.6) * * #cairo_font_type_t is used to describe the type of a given font * face or scaled font. The font types are also known as "font @@ -1183,7 +1183,7 @@ typedef enum _cairo_font_type { CAIRO_FONT_TYPE_TOY, CAIRO_FONT_TYPE_FT, CAIRO_FONT_TYPE_WIN32, - CAIRO_FONT_TYPE_ATSUI + CAIRO_FONT_TYPE_QUARTZ } cairo_font_type_t; cairo_public cairo_font_type_t diff --git a/src/cairoint.h b/src/cairoint.h index 9108d19ee..c36a2a8fe 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -432,7 +432,7 @@ extern const cairo_private struct _cairo_scaled_font_backend cairo_win32_scaled_ #endif -#if CAIRO_HAS_ATSUI_FONT +#if CAIRO_HAS_QUARTZ_FONT extern const cairo_private struct _cairo_scaled_font_backend cairo_atsui_scaled_font_backend; @@ -841,7 +841,7 @@ typedef struct _cairo_traps { #define CAIRO_FONT_WEIGHT_DEFAULT CAIRO_FONT_WEIGHT_NORMAL #define CAIRO_WIN32_FONT_FAMILY_DEFAULT "Arial" -#define CAIRO_ATSUI_FONT_FAMILY_DEFAULT "Helvetica" +#define CAIRO_QUARTZ_FONT_FAMILY_DEFAULT "Helvetica" #define CAIRO_FT_FONT_FAMILY_DEFAULT "" #if CAIRO_HAS_WIN32_FONT @@ -849,9 +849,9 @@ typedef struct _cairo_traps { #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_win32_scaled_font_backend -#elif CAIRO_HAS_ATSUI_FONT +#elif CAIRO_HAS_QUARTZ_FONT -#define CAIRO_FONT_FAMILY_DEFAULT CAIRO_ATSUI_FONT_FAMILY_DEFAULT +#define CAIRO_FONT_FAMILY_DEFAULT CAIRO_QUARTZ_FONT_FAMILY_DEFAULT #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_atsui_scaled_font_backend #elif CAIRO_HAS_FT_FONT @@ -2202,7 +2202,7 @@ _cairo_utf8_to_ucs4 (const unsigned char *str, uint32_t **result, int *items_written); -#if CAIRO_HAS_WIN32_FONT+0 || CAIRO_HAS_ATSUI_FONT+0 +#if CAIRO_HAS_WIN32_FONT+0 || CAIRO_HAS_QUARTZ_FONT+0 # define CAIRO_HAS_UTF8_TO_UTF16 1 #endif #if CAIRO_HAS_UTF8_TO_UTF16 |