From 5d4738caf610e94abb73d4f65602fb42fae218ac Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Thu, 6 Sep 2012 12:30:56 +0000 Subject: Remove FontConfig dependency Recent XeTeX always passes file name under non-Mac systems now, so FontConfig is no longer needed. git-svn-id: svn://tug.org/texlive/trunk@27605 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/xdvipdfmx/ChangeLog.TL | 5 ++++ Build/source/texk/xdvipdfmx/configure.ac | 16 ++++------ Build/source/texk/xdvipdfmx/src/Makefile.am | 5 +--- Build/source/texk/xdvipdfmx/src/fontmap.c | 46 ++--------------------------- 4 files changed, 14 insertions(+), 58 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/xdvipdfmx/ChangeLog.TL b/Build/source/texk/xdvipdfmx/ChangeLog.TL index 5385ef75110..5173f5c65cd 100644 --- a/Build/source/texk/xdvipdfmx/ChangeLog.TL +++ b/Build/source/texk/xdvipdfmx/ChangeLog.TL @@ -1,6 +1,11 @@ ChangeLog.TL: TeX Live (TL) changes for xdvipdfmx ================================================= +2012-09-06 Khaled Hosny + + * configure.ac, src/fontmap.c, src/Makefile.am: Remove FontConfig + dependency, as it is not needed anymore with recent XeTeX. + 2012-08-26 Khaled Hosny * src/agl.c: Reduce differences with dvipdfmx. diff --git a/Build/source/texk/xdvipdfmx/configure.ac b/Build/source/texk/xdvipdfmx/configure.ac index a7d61f572ca..90afef12e68 100644 --- a/Build/source/texk/xdvipdfmx/configure.ac +++ b/Build/source/texk/xdvipdfmx/configure.ac @@ -82,25 +82,19 @@ if test "x$enable_texlive_build" != xyes || test ! -d $srcdir/../kpathsea; then CHO_CHECK_LIBPAPER fi +dnl XXX we should do the check under Mac only +can_build=yes KPSE_CHECK_FRAMEWORK([ApplicationServices], [ATSFontRef fontRef]) -KPSE_FONTCONFIG_FLAGS if test "x$kpse_cv_have_ApplicationServices" = xyes; then - can_build=yes AC_DEFINE([XETEX_MAC], 1, [Define if part of a TeX Live build for Mac OS X.]) -else - KPSE_ADD_FLAGS([fontconfig]) - CHO_CHECK_LIBFONTCONFIG - KPSE_RESTORE_FLAGS - can_build=$cho_cv_have_fontconfig fi if test "x$can_build" = xyes; then AC_DEFINE([XETEX], 1, [Define if part of a TeX Live build.]) else - AC_MSG_WARN([fontconfig library or ApplicationServices framework not found. -This version of xdvipdfmx requires either ApplicationServices (on Mac OS X) -or the fontconfig library (on other platforms) to be available, otherwise it -cannot support XeTeX output using standard system-installed fonts.]) + AC_MSG_WARN([ApplicationServices framework not found. This version of +xdvipdfmx requires ApplicationServices (on Mac OS X) to be available, otherwise +it cannot support XeTeX output using standard system-installed fonts.]) if test "x$enable_build" != xno; then AC_MSG_ERROR([exiting]) fi diff --git a/Build/source/texk/xdvipdfmx/src/Makefile.am b/Build/source/texk/xdvipdfmx/src/Makefile.am index 59a19de540a..159844a99e8 100644 --- a/Build/source/texk/xdvipdfmx/src/Makefile.am +++ b/Build/source/texk/xdvipdfmx/src/Makefile.am @@ -40,10 +40,7 @@ LDADD = $(KPATHSEA_LIBS) $(FREETYPE2_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) if build_MacOsX AM_LDFLAGS = -framework ApplicationServices -else !build_MacOsX -INCLUDES += $(FONTCONFIG_INCLUDES) -LDADD += $(FONTCONFIG_LIBS) -endif !build_MacOsX +endif ## Rebuild libkpathsea @KPATHSEA_RULE@ diff --git a/Build/source/texk/xdvipdfmx/src/fontmap.c b/Build/source/texk/xdvipdfmx/src/fontmap.c index cb9817b5ffc..f78b8370694 100644 --- a/Build/source/texk/xdvipdfmx/src/fontmap.c +++ b/Build/source/texk/xdvipdfmx/src/fontmap.c @@ -38,15 +38,12 @@ #include "fontmap.h" #ifdef XETEX +#include "ft2build.h" +#include FT_FREETYPE_H #ifdef XETEX_MAC #include #include -#include "ft2build.h" -#include FT_FREETYPE_H #include FT_MAC_H -#else -#include "fontconfig/fontconfig.h" -#include "fontconfig/fcfreetype.h" #endif #endif @@ -1212,17 +1209,7 @@ pdf_load_native_font (const char *ps_name, #else - int i; - - FcObjectSet *os; - FcPattern *pat; - FcFontSet *matches; - if (!sInitialized) { - if (FcInit() == FcFalse) { - WARN("Fontconfig initialization failed."); - return error; - } if (FT_Init_FreeType(&ftLib) != 0) { WARN("FreeType initialization failed."); return error; @@ -1235,34 +1222,7 @@ pdf_load_native_font (const char *ps_name, error = pdf_load_native_font_from_path(ps_name, layout_dir, extend, slant, embolden); } else { - os = FcObjectSetBuild(FC_FILE, FC_INDEX, FC_FAMILY, FC_STYLE, NULL); - pat = FcPatternBuild(0, FC_FAMILY, FcTypeString, fam_name, - FC_STYLE, FcTypeString, sty_name, - FC_OUTLINE, FcTypeBool, FcTrue, NULL); - matches = FcFontList(FcConfigGetCurrent(), pat, os); - FcObjectSetDestroy(os); - FcPatternDestroy(pat); - - for (i = 0; i < matches->nfont; i++) { - FcChar8 *path; - const char *name; - int index; - FT_Face face; - if (FcPatternGetString(matches->fonts[i], - FC_FILE, 0, &path) == FcResultMatch && - FcPatternGetInteger(matches->fonts[i], - FC_INDEX, 0, &index) == FcResultMatch) { - FT_New_Face(ftLib, (char*)path, index, &face); - name = FT_Get_Postscript_Name(face); - if (!strcmp(name, ps_name)) { - error = pdf_insert_native_fontmap_record(ps_name, (char*)path, index, face, - layout_dir, extend, slant, embolden); - /* don't dispose of the FT_Face, as we'll be using it to retrieve font data */ - break; - } - FT_Done_Face(face); - } - } + ERROR("Loading fonts by font name is not supported."); } #endif -- cgit v1.2.3