[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690
Alexandre Julliard
julliard at winehq.org
Sun Jun 17 20:03:10 UTC 2012
The following commit has been merged in the wheezy branch:
commit 60b0432d52c519329c0a4c53609054f87e9a243a
Author: Ken Thomases <ken at codeweavers.com>
Date: Wed Apr 4 17:41:10 2012 -0500
gdi32: On Mac OS X, find fonts using Core Text rather than FontConfig, by default.
(cherry picked from commit 9cb7a97981c8bedcb4425ec22e2b90047b2ccc9a)
diff --git a/configure b/configure
index 39301f3..450f803 100755
--- a/configure
+++ b/configure
@@ -2561,7 +2561,7 @@ fi
# Check whether --with-fontconfig was given.
if test "${with_fontconfig+set}" = set; then :
- withval=$with_fontconfig; if test "x$withval" = "xno"; then ac_cv_header_fontconfig_fontconfig_h=no; fi
+ withval=$with_fontconfig;
fi
@@ -4058,6 +4058,7 @@ case $host in
enable_win16=${enable_win16:-yes}
fi
+ with_fontconfig=${with_fontconfig:-no}
;;
x86_64*)
if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes"
@@ -5278,6 +5279,8 @@ OPENGL_LIBS=""
+test "x$with_fontconfig" != "xno" || ac_cv_header_fontconfig_fontconfig_h=no
+
# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then :
enableval=$enable_largefile;
diff --git a/configure.ac b/configure.ac
index 7bfb3cc..da22688 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,8 +43,7 @@ AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS]))
AC_ARG_WITH(curses, AS_HELP_STRING([--without-curses],[do not use (n)curses]),
[if test "x$withval" = "xno"; then ac_cv_header_ncurses_h=no; ac_cv_header_curses_h=no; fi])
AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic device support)]))
-AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]),
- [if test "x$withval" = "xno"; then ac_cv_header_fontconfig_fontconfig_h=no; fi])
+AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]))
AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library]))
AC_ARG_WITH(gettext, AS_HELP_STRING([--without-gettext],[do not use gettext]))
AC_ARG_WITH(gettextpo, AS_HELP_STRING([--with-gettextpo],[use the GetTextPO library to rebuild po files]),
@@ -142,6 +141,7 @@ case $host in
AC_SUBST(TARGETFLAGS,"-m32")
enable_win16=${enable_win16:-yes}
fi
+ with_fontconfig=${with_fontconfig:-no}
;;
x86_64*)
if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes"
@@ -381,6 +381,8 @@ AC_SUBST(OPENGL_LIBS,"")
dnl **** Check for header files ****
+test "x$with_fontconfig" != "xno" || ac_cv_header_fontconfig_fontconfig_h=no
+
AC_SYS_LARGEFILE()
AC_CHECK_HEADERS(\
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 8a6ed6f..98c0c0b 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -2296,9 +2296,9 @@ static BOOL ReadFontDir(const char *dirname, BOOL external_fonts)
return TRUE;
}
+#ifdef SONAME_LIBFONTCONFIG
static void load_fontconfig_fonts(void)
{
-#ifdef SONAME_LIBFONTCONFIG
void *fc_handle = NULL;
FcConfig *config;
FcPattern *pat;
@@ -2364,10 +2364,126 @@ LOAD_FUNCPTR(FcPatternGetString);
pFcObjectSetDestroy(os);
pFcPatternDestroy(pat);
sym_not_found:
-#endif
return;
}
+#elif defined(HAVE_CARBON_CARBON_H)
+
+static void load_mac_font_callback(const void *value, void *context)
+{
+ CFStringRef pathStr = value;
+ CFIndex len;
+ char* path;
+
+ len = CFStringGetMaximumSizeOfFileSystemRepresentation(pathStr);
+ path = HeapAlloc(GetProcessHeap(), 0, len);
+ if (path && CFStringGetFileSystemRepresentation(pathStr, path, len))
+ {
+ TRACE("font file %s\n", path);
+ AddFontToList(path, NULL, 0, ADDFONT_EXTERNAL_FONT | ADDFONT_ADD_TO_CACHE);
+ }
+ HeapFree(GetProcessHeap(), 0, path);
+}
+
+static void load_mac_fonts(void)
+{
+ CFStringRef removeDupesKey;
+ CFBooleanRef removeDupesValue;
+ CFDictionaryRef options;
+ CTFontCollectionRef col;
+ CFArrayRef descs;
+ CFMutableSetRef paths;
+ CFIndex i;
+
+ removeDupesKey = kCTFontCollectionRemoveDuplicatesOption;
+ removeDupesValue = kCFBooleanTrue;
+ options = CFDictionaryCreate(NULL, (const void**)&removeDupesKey, (const void**)&removeDupesValue, 1,
+ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ col = CTFontCollectionCreateFromAvailableFonts(options);
+ if (options) CFRelease(options);
+ if (!col)
+ {
+ WARN("CTFontCollectionCreateFromAvailableFonts failed\n");
+ return;
+ }
+
+ descs = CTFontCollectionCreateMatchingFontDescriptors(col);
+ CFRelease(col);
+ if (!descs)
+ {
+ WARN("CTFontCollectionCreateMatchingFontDescriptors failed\n");
+ return;
+ }
+
+ paths = CFSetCreateMutable(NULL, 0, &kCFTypeSetCallBacks);
+ if (!paths)
+ {
+ WARN("CFSetCreateMutable failed\n");
+ CFRelease(descs);
+ return;
+ }
+
+ for (i = 0; i < CFArrayGetCount(descs); i++)
+ {
+ CTFontDescriptorRef desc;
+ CTFontRef font;
+ ATSFontRef atsFont;
+ OSStatus status;
+ FSRef fsref;
+ CFURLRef url;
+ CFStringRef ext;
+ CFStringRef path;
+
+ desc = CFArrayGetValueAtIndex(descs, i);
+
+ /* CTFontDescriptor doesn't support kCTFontURLAttribute until 10.6, so
+ we have to go CFFontDescriptor -> CTFont -> ATSFont -> FSRef -> CFURL. */
+ font = CTFontCreateWithFontDescriptor(desc, 0, NULL);
+ if (!font) continue;
+
+ atsFont = CTFontGetPlatformFont(font, NULL);
+ if (!atsFont)
+ {
+ CFRelease(font);
+ continue;
+ }
+
+ status = ATSFontGetFileReference(atsFont, &fsref);
+ CFRelease(font);
+ if (status != noErr) continue;
+
+ url = CFURLCreateFromFSRef(NULL, &fsref);
+ if (!url) continue;
+
+ ext = CFURLCopyPathExtension(url);
+ if (ext)
+ {
+ BOOL skip = (CFStringCompare(ext, CFSTR("pfa"), kCFCompareCaseInsensitive) == kCFCompareEqualTo ||
+ CFStringCompare(ext, CFSTR("pfb"), kCFCompareCaseInsensitive) == kCFCompareEqualTo);
+ CFRelease(ext);
+ if (skip)
+ {
+ CFRelease(url);
+ continue;
+ }
+ }
+
+ path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
+ CFRelease(url);
+ if (!path) continue;
+
+ CFSetAddValue(paths, path);
+ CFRelease(path);
+ }
+
+ CFRelease(descs);
+
+ CFSetApplyFunction(paths, load_mac_font_callback, NULL);
+ CFRelease(paths);
+}
+
+#endif
+
static BOOL load_font_from_data_dir(LPCWSTR file)
{
BOOL ret = FALSE;
@@ -3138,7 +3254,11 @@ static void init_font_list(void)
RegCloseKey(hkey);
}
+#ifdef SONAME_LIBFONTCONFIG
load_fontconfig_fonts();
+#elif defined(HAVE_CARBON_CARBON_H)
+ load_mac_fonts();
+#endif
/* then look in any directories that we've specified in the config file */
/* @@ Wine registry key: HKCU\Software\Wine\Fonts */
--
Debian Wine packaging
More information about the pkg-wine-party
mailing list