# some standard header files
AC_HEADER_DIRENT
AC_HEADER_MAJOR
-AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h io.h process.h NewAPIs.h utime.h sys/utime.h)
+AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h io.h process.h NewAPIs.h utime.h sys/utime.h fontconfig/fontconfig.h)
# some standard structures
AC_HEADER_STAT
#include <config.h>
#include "support/os.h"
+#include "debug.h"
#ifdef __APPLE__
-#include "debug.h"
#include <Carbon/Carbon.h>
#include <ApplicationServices/ApplicationServices.h>
-using std::endl;
+#elif defined(HAVE_FONTCONFIG_FONTCONFIG_H)
+#include "support/filetools.h"
+#include "support/Package.h"
+#include <fontconfig/fontconfig.h>
+using lyx::support::addPath;
#endif
+using std::endl;
using std::string;
kFMLocalActivationContext);
if (err)
lyxerr << "FMActivateFonts err = " << err << endl;
+#elif defined(HAVE_FONTCONFIG_FONTCONFIG_H)
+ // Register BaKoMa truetype fonts with fontconfig
+ string const fonts_dir =
+ addPath(package().system_support().absFilename(), "fonts");
+ if (!FcConfigAppFontAddDir(0, (FcChar8 const *)fonts_dir.c_str()))
+ lyxerr << "Unable to register fonts with fontconfig." << endl;
#endif
}
void restoreFontResources()
-{}
+{
+#if defined(HAVE_FONTCONFIG_FONTCONFIG_H) && !defined(__APPLE__)
+ FcConfigAppFontClear(0);
+#endif
+}
} // namespace os
} // namespace support