[cairo] conditionals for older freetype2 without color font feature
mpsuzuki at hiroshima-u.ac.jp
Tue Apr 3 16:15:41 UTC 2018
Here is revised patch. Please let me explain for your review
diff --git a/configure.ac b/configure.ac
index d78b2ed..ebc31d9 100644
@@ -580,6 +580,17 @@ if test "x$use_ft" = "xyes"; then
FT_GlyphSlot_Oblique FT_Load_Sfnt_Table FT_Library_SetLcdFilter
+ AC_MSG_CHECKING(for FT_HAS_COLOR)
+FT_Long has_color = FT_HAS_COLOR( ((FT_Face)NULL) );
+ AC_DEFINE([FT_HAS_COLOR(x)], [(0)], [define nothing if freetype2 supports
+ AC_MSG_RESULT([no, disable color font (freetype2 >= 2.5.1 is required)])
* the patched part tries to compile & link a source including FT_HAS_COLOR()
which is defined as a macro function. basically, the functions whose names
are in all upper cases in FreeType2 are macro functions, so the availability
check could be simplified to the check of C preprocessor macro, but I did
like this, to minimize the assumption.
* for newer FreeType2 with FT_HAS_COLOR(), config.h defines nothing about it.
(note: config.h.in looks like as if "#undef FT_HAS_COLOR" is executed
for newer FreeType2, but it is not - please check the result on the
platform with newer FreeType2, it would be commented out)
* for older FreeType2 without FT_HAS_COLOR(), config.h defines as
#define FT_HAS_COLOR(x) (0)
suzuki toshiya wrote:
> Dear Bryce,
> Thank you for prompt review!
> >> #ifndef FT_HAS_COLOR
> >> # define FT_HAS_COLOR(x) ( 0 )
> >> #endif
> >> in config header is better?
> > Offhand I prefer this latter approach, just feels a bit cleaner. Would
> > you mind respinning your patch with this approach?
> OK! I would revise and resubmit.
> On 4/3/2018 12:30 PM, Bryce Harrington wrote:
>> On Tue, Apr 03, 2018 at 10:34:20AM +0900, suzuki toshiya wrote:
>>> 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 )
>>> in config header is better?
>> Offhand I prefer this latter approach, just feels a bit cleaner. Would
>> you mind respinning your patch with this approach?
>>> it seems that fontconfig decided to drop old freetype2,
>>> but I wish if cairo can provide (limited) support for
>>> older freetype2.
>> Sounds ok, I don't see a problem with doing this.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 775 bytes
Desc: not available
More information about the cairo