Commit 550b2f76 authored by Jeremy Huddleston's avatar Jeremy Huddleston

Remove fontconfig and freetype ifdef-fu and instead require non-ancinet versions of both

Signed-off-by: Jeremy Huddleston's avatarJeremy Huddleston <jeremyhu@apple.com>
parent 21a59c10
......@@ -67,29 +67,10 @@ AC_SUBST([XFT_LT_VERSION])
PKG_CHECK_MODULES(XRENDER, xrender >= 0.8.2 x11)
# Check freetype configuration
AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=auto)
if test "$freetype_config" = "auto"; then
PKG_CHECK_MODULES(FREETYPE, freetype2,
freetype_config=no, freetype_config=yes)
fi
if test "$freetype_config" = "yes"; then
AC_PATH_PROG(ft_config,freetype-config,no)
if test "$ft_config" = "no"; then
AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
fi
else
ft_config="$freetype_config"
fi
if test "$freetype_config" != "no"; then
FREETYPE_CFLAGS="`$ft_config --cflags`"
FREETYPE_LIBS="`$ft_config --libs`"
fi
PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.1.6)
# Check fontconfig configuration
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.5.92)
AC_SUBST(XRENDER_CFLAGS)
AC_SUBST(XRENDER_LIBS)
......@@ -98,22 +79,6 @@ AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FONTCONFIG_CFLAGS)
AC_SUBST(FONTCONFIG_LIBS)
fontconfig_save_libs="$LIBS"
fontconfig_save_cflags="$CFLAGS"
LIBS="$LIBS $FREETYPE_LIBS"
CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
AC_CHECK_FUNCS(FT_Get_Next_Char FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names FT_GlyphSlot_Embolden)
AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
HAVE_FT_BITMAP_SIZE_Y_PPEM=1,
HAVE_FT_BITMAP_SIZE_Y_PPEM=0,
[#include <ft2build.h>
#include FT_FREETYPE_H])
AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
[FT_Bitmap_Size structure includes y_ppem field])
LIBS="$fontconfig_save_libs"
CFLAGS="$fontconfig_save_cflags"
if test "$VERSION" = "" ; then
VERSION=$PACKAGE_VERSION;
fi
......
......@@ -369,22 +369,16 @@ _XftDefaultInit (Display *dpy)
goto bail1;
if (!_XftDefaultInitInteger (dpy, pat, FC_RGBA))
goto bail1;
#ifdef FC_LCD_FILTER
if (!_XftDefaultInitInteger (dpy, pat, FC_LCD_FILTER))
goto bail1;
#endif
if (!_XftDefaultInitBool (dpy, pat, FC_ANTIALIAS))
goto bail1;
#ifdef FC_EMBOLDEN
if (!_XftDefaultInitBool (dpy, pat, FC_EMBOLDEN))
goto bail1;
#endif
if (!_XftDefaultInitBool (dpy, pat, FC_AUTOHINT))
goto bail1;
#ifdef FC_HINT_STYLE
if (!_XftDefaultInitInteger (dpy, pat, FC_HINT_STYLE))
goto bail1;
#endif
if (!_XftDefaultInitBool (dpy, pat, FC_HINTING))
goto bail1;
if (!_XftDefaultInitBool (dpy, pat, FC_MINSPACE))
......@@ -475,28 +469,24 @@ XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern)
XftDefaultGetBool (dpy, FC_ANTIALIAS, screen,
True));
}
#ifdef FC_EMBOLDEN
if (FcPatternGet (pattern, FC_EMBOLDEN, 0, &v) == FcResultNoMatch)
{
FcPatternAddBool (pattern, FC_EMBOLDEN,
XftDefaultGetBool (dpy, FC_EMBOLDEN, screen,
False));
}
#endif
if (FcPatternGet (pattern, FC_HINTING, 0, &v) == FcResultNoMatch)
{
FcPatternAddBool (pattern, FC_HINTING,
XftDefaultGetBool (dpy, FC_HINTING, screen,
True));
}
#ifdef FC_HINT_STYLE
if (FcPatternGet (pattern, FC_HINT_STYLE, 0, &v) == FcResultNoMatch)
{
FcPatternAddInteger (pattern, FC_HINT_STYLE,
XftDefaultGetInteger (dpy, FC_HINT_STYLE, screen,
FC_HINT_FULL));
}
#endif
if (FcPatternGet (pattern, FC_AUTOHINT, 0, &v) == FcResultNoMatch)
{
FcPatternAddBool (pattern, FC_AUTOHINT,
......@@ -525,14 +515,12 @@ XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern)
XftDefaultGetInteger (dpy, FC_RGBA, screen,
subpixel));
}
#ifdef FC_LCD_FILTER
if (FcPatternGet (pattern, FC_LCD_FILTER, 0, &v) == FcResultNoMatch)
{
FcPatternAddInteger (pattern, FC_LCD_FILTER,
XftDefaultGetInteger (dpy, FC_LCD_FILTER, screen,
FC_LCD_DEFAULT));
}
#endif
if (FcPatternGet (pattern, FC_MINSPACE, 0, &v) == FcResultNoMatch)
{
FcPatternAddBool (pattern, FC_MINSPACE,
......
......@@ -176,13 +176,8 @@ _XftUnlockFile (XftFtFile *f)
_XftLockError ("too many file unlocks");
}
#if HAVE_FT_BITMAP_SIZE_Y_PPEM
#define X_SIZE(face,i) ((face)->available_sizes[i].x_ppem)
#define Y_SIZE(face,i) ((face)->available_sizes[i].y_ppem)
#else
#define X_SIZE(face,i) ((face)->available_sizes[i].width << 6)
#define Y_SIZE(face,i) ((face)->available_sizes[i].height << 6)
#endif
_X_HIDDEN FcBool
_XftSetFace (XftFtFile *f, FT_F26Dot6 xsize, FT_F26Dot6 ysize, FT_Matrix *matrix)
......@@ -224,12 +219,9 @@ _XftSetFace (XftFtFile *f, FT_F26Dot6 xsize, FT_F26Dot6 ysize, FT_Matrix *matrix
* files have but a single strike per file, we can
* simply try both sizes.
*/
if (
#if HAVE_FT_BITMAP_SIZE_Y_PPEM
FT_Set_Char_Size (face, face->available_sizes[best].x_ppem,
if (FT_Set_Char_Size (face, face->available_sizes[best].x_ppem,
face->available_sizes[best].y_ppem, 0, 0) != 0
&&
#endif
FT_Set_Char_Size (face, face->available_sizes[best].width << 6,
face->available_sizes[best].height << 6,
0, 0) != 0)
......@@ -379,9 +371,7 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
double aspect;
FcMatrix *font_matrix;
FcBool hinting, vertical_layout, autohint, global_advance;
#ifdef FC_HINT_STYLE
int hint_style;
#endif
FcChar32 hash, *hashp;
FT_Face face;
int nhash;
......@@ -469,7 +459,6 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
goto bail1;
}
#ifdef FC_LCD_FILTER
/*
* Get lcd_filter value
*/
......@@ -482,7 +471,6 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
default:
goto bail1;
}
#endif
/*
* Get matrix and transform values
......@@ -557,7 +545,6 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
goto bail1;
}
#ifdef FC_EMBOLDEN
switch (FcPatternGetBool (pattern, FC_EMBOLDEN, 0, &fi->embolden)) {
case FcResultNoMatch:
fi->embolden = FcFalse;
......@@ -567,11 +554,7 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
default:
goto bail1;
}
#else
fi->embolden = FcFalse;
#endif
#ifdef FC_HINT_STYLE
switch (FcPatternGetInteger (pattern, FC_HINT_STYLE, 0, &hint_style)) {
case FcResultNoMatch:
hint_style = FC_HINT_FULL;
......@@ -581,12 +564,9 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
default:
goto bail1;
}
#endif
if (!hinting
#ifdef FC_HINT_STYLE
|| hint_style == FC_HINT_NONE
#endif
)
{
fi->load_flags |= FT_LOAD_NO_HINTING;
......@@ -597,15 +577,11 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
*/
if (fi->antialias)
{
#ifdef FC_HINT_STYLE
#ifdef FT_LOAD_TARGET_LIGHT
if (FC_HINT_NONE < hint_style && hint_style < FC_HINT_FULL)
{
fi->load_flags |= FT_LOAD_TARGET_LIGHT;
}
else
#endif
#endif
{
/* autohinter will snap stems to integer widths, when
* the LCD targets are used.
......@@ -613,23 +589,17 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
switch (fi->rgba) {
case FC_RGBA_RGB:
case FC_RGBA_BGR:
#ifdef FT_LOAD_TARGET_LCD
fi->load_flags |= FT_LOAD_TARGET_LCD;
#endif
break;
case FC_RGBA_VRGB:
case FC_RGBA_VBGR:
#ifdef FT_LOAD_TARGET_LCD_V
fi->load_flags |= FT_LOAD_TARGET_LCD_V;
#endif
break;
}
}
}
#ifdef FT_LOAD_TARGET_MONO
else
fi->load_flags |= FT_LOAD_TARGET_MONO;
#endif
/* set vertical layout if requested */
switch (FcPatternGetBool (pattern, FC_VERTICAL_LAYOUT, 0, &vertical_layout)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment