mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Register math fonts with fontconfig
* src/support/os_unix.cpp (addFontResources): add the system fonts dir to the paths scanned by fontconfig. (restoreFontResources): remove the system fonts dir from the fontconfig configuration. * configure.ac: add check for the fontconfig devel headers. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20034 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
413d246fe7
commit
960af8f370
@ -236,7 +236,7 @@ AC_LANG_POP(C)
|
|||||||
# some standard header files
|
# some standard header files
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_HEADER_MAJOR
|
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
|
# some standard structures
|
||||||
AC_HEADER_STAT
|
AC_HEADER_STAT
|
||||||
|
@ -13,14 +13,19 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include "support/os.h"
|
#include "support/os.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include "debug.h"
|
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#include <ApplicationServices/ApplicationServices.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
|
#endif
|
||||||
|
|
||||||
|
using std::endl;
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
|
||||||
@ -224,12 +229,22 @@ void addFontResources()
|
|||||||
kFMLocalActivationContext);
|
kFMLocalActivationContext);
|
||||||
if (err)
|
if (err)
|
||||||
lyxerr << "FMActivateFonts err = " << err << endl;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void restoreFontResources()
|
void restoreFontResources()
|
||||||
{}
|
{
|
||||||
|
#if defined(HAVE_FONTCONFIG_FONTCONFIG_H) && !defined(__APPLE__)
|
||||||
|
FcConfigAppFontClear(0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace os
|
} // namespace os
|
||||||
} // namespace support
|
} // namespace support
|
||||||
|
Loading…
Reference in New Issue
Block a user