From d48384899ea18a6ec12d6c7ced250814da05802a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 28 Mar 2004 23:31:31 +0000 Subject: [PATCH] Merge from HEAD: If FcConfigHome() is NULL, use the temp folder. (I guess this branch doesn't crash on a NULL config->cache, but still a good idea to have a cache file, for performance, isn't it?) Fix cut&paste error. Remove CRs from the out file before comparing (needed on Windows). Add share/doc directory. Add Fc*.3 man pages. Move the LIBRARY and VERSION lines to the end, not to confuse libtool, which expects the EXPORTS line to be the first. Add FcConfigEnableHome. Check also for DLL_EXPORT as indication of being built as a DLL on Win32. --- ChangeLog | 24 ++++++++++++++++++++++++ configure.in | 12 +++++++++--- fontconfig-zip.in | 5 ++++- src/Makefile.am | 2 +- src/fccfg.c | 29 +++++++++++++++++++++++++++-- src/fontconfig.def.in | 5 +++-- test/run-test.sh | 1 + 7 files changed, 69 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a52b91..7518192 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2004-03-28 Tor Lillqvist + + Merge from HEAD: + + * src/fccfg.c (FcConfigCreate): If FcConfigHome() is NULL, use the + temp folder. (I guess this branch doesn't crash on a NULL + config->cache, but still a good idea to have a cache file, for + performance, isn't it?) + + * src/Makefile.am (install-libtool-import-lib): Fix cut&paste error. + + * test/run-test.sh: Remove CRs from the out file before comparing + (needed on Windows). + + * fontconfig-zip.in (DEVZIP): Add share/doc directory. Add Fc*.3 + man pages. + + * src/fontconfig.def.in: Move the LIBRARY and VERSION lines to the + end, not to confuse libtool, which expects the EXPORTS line to be + the first. Add FcConfigEnableHome. + + * src/fccfg.c: Check also for DLL_EXPORT as indication of being + built as a DLL on Win32. + 2004-03-10 Keith Packard * README: diff --git a/configure.in b/configure.in index 21f3a0b..75912d9 100644 --- a/configure.in +++ b/configure.in @@ -225,9 +225,15 @@ AC_ARG_WITH(default-fonts, [ --with-default-fonts=DIR Use fonts from D case "$default_fonts" in yes) - FC_DEFAULT_FONTS="/usr/share/fonts" - AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts", - [System font directory]) + if test "$os_win32" = "yes"; then + FC_DEFAULT_FONTS="WINDOWSFONTDIR" + AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "WINDOWSFONTDIR", + [Windows font directory]) + else + FC_DEFAULT_FONTS="/usr/share/fonts" + AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts", + [System font directory]) + fi ;; *) FC_DEFAULT_FONTS="$default_fonts" diff --git a/fontconfig-zip.in b/fontconfig-zip.in index d778c4b..fe56e63 100755 --- a/fontconfig-zip.in +++ b/fontconfig-zip.in @@ -26,5 +26,8 @@ bin/fc-list.exe bin/fc-cache.exe man/man1/fc-cache.1 man/man1/fc-list.1 -man/man3/fontconfig.3 +man/man5/fonts-conf.5 +share/doc/fontconfig EOF + +zip $DEVZIP man/man3/Fc*.3 diff --git a/src/Makefile.am b/src/Makefile.am index a30604e..7890e96 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,7 @@ export_symbols = -export-symbols fontconfig.def install-libtool-import-lib: $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir) - $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/glib-2.0.def + $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def uninstall-libtool-import-lib: -rm $(DESTDIR)$(libdir)/libfontconfig.dll.a $(DESTDIR)$(libdir)/fontconfig.def diff --git a/src/fccfg.c b/src/fccfg.c index 8d32db8..d0cf358 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -24,7 +24,7 @@ #include "fcint.h" -#if defined (_WIN32) && defined (PIC) +#if defined (_WIN32) && (defined (PIC) || defined (DLL_EXPORT)) #define STRICT #include #undef STRICT @@ -60,6 +60,31 @@ FcConfigCreate (void) if (!FcConfigSetCache (config, (FcChar8 *) ("~/" FC_USER_CACHE_FILE))) goto bail4; +#ifdef _WIN32 + if (config->cache == 0) + { + /* If no home, use the temp folder. */ + FcChar8 dummy[1]; + int templen = GetTempPath (1, dummy); + FcChar8 *temp = malloc (templen + 1); + + if (temp) + { + FcChar8 *cache_dir; + + GetTempPath (templen + 1, temp); + cache_dir = FcStrPlus (temp, FC_USER_CACHE_FILE); + free (temp); + if (!FcConfigSetCache (config, cache_dir)) + { + FcStrFree (cache_dir); + goto bail4; + } + FcStrFree (cache_dir); + } + } +#endif + config->blanks = 0; config->substPattern = 0; @@ -1355,7 +1380,7 @@ FcConfigSubstitute (FcConfig *config, return FcConfigSubstituteWithPat (config, p, 0, kind); } -#if defined (_WIN32) && defined (PIC) +#if defined (_WIN32) && (defined (PIC) || defined (DLL_EXPORT)) static FcChar8 fontconfig_path[1000] = ""; diff --git a/src/fontconfig.def.in b/src/fontconfig.def.in index cd937f3..bbb07a6 100755 --- a/src/fontconfig.def.in +++ b/src/fontconfig.def.in @@ -1,5 +1,3 @@ -LIBRARY fontconfig -VERSION @LT_CURRENT@.@LT_REVISION@ EXPORTS FcAtomicCreate FcAtomicDeleteNew @@ -34,6 +32,7 @@ EXPORTS FcConfigBuildFonts FcConfigCreate FcConfigDestroy + FcConfigEnableHome FcConfigFilename FcConfigGetBlanks FcConfigGetCache @@ -159,3 +158,5 @@ EXPORTS FcValueEqual FcValuePrint FcValueSave +LIBRARY fontconfig +VERSION @LT_CURRENT@.@LT_REVISION@ diff --git a/test/run-test.sh b/test/run-test.sh index b2600d7..ae5af1e 100644 --- a/test/run-test.sh +++ b/test/run-test.sh @@ -13,6 +13,7 @@ check () { $FCLIST - family pixelsize | sort >> out echo "=" >> out $FCLIST - family pixelsize | sort >> out + tr -d '\015' out.tmp; mv out.tmp out if cmp out out.expected > /dev/null ; then : ; else echo "*** Test failed: $TEST" echo "*** output is in 'out', expected output in 'out.expected'" -- 2.39.5