conditionals for older freetype2 without color font feature

suzuki toshiya <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Hi,

FT_HAS_COLOR() macro is unavailable in older freetype2
without color font feature. attached is a quick fix.

or, something like

#ifndef FT_HAS_COLOR
# define FT_HAS_COLOR(x) ( 0 )
#endif

in config header is better?

--

it seems that fontconfig decided to drop old freetype2,
but I wish if cairo can provide (limited) support for
older freetype2.

Regards,
mpsuzuki

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
cairo-ft-font_legacy-ft.diff (text/x-patch, 853 B)
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 79aef78..c1cac17 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -448,7 +448,11 @@ _cairo_ft_unscaled_font_init (cairo_ft_unscaled_font_t *unscaled,
 	_cairo_ft_unscaled_font_init_key (unscaled, TRUE, NULL, face->face_index, face);
 
 
+#ifdef FT_HAS_COLOR
         unscaled->have_color = FT_HAS_COLOR (face) != 0;
+#else
+        unscaled->have_color = FALSE;
+#endif
         unscaled->have_color_set = TRUE;
 
 #ifdef HAVE_FT_GET_VAR_DESIGN_COORDINATES
@@ -744,7 +748,11 @@ _cairo_ft_unscaled_font_lock_face (cairo_ft_unscaled_font_t *unscaled)
 
     unscaled->face = face;
 
+#ifdef FT_HAS_COLOR
     unscaled->have_color = FT_HAS_COLOR (face) != 0;
+#else
+    unscaled->have_color = FALSE;
+#endif
     unscaled->have_color_set = TRUE;
 
     font_map->num_open_faces++;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.