diff --git a/configure.ac b/configure.ac index 7a979704e..815f1f4ad 100644 --- a/configure.ac +++ b/configure.ac @@ -392,6 +392,9 @@ AC_ARG_ENABLE(install-libxf86config, [Install libxf86config (default: disabled)]), [INSTALL_LIBXF86CONFIG=$enableval], [INSTALL_LIBXF86CONFIG=no]) +AC_ARG_ENABLE(builtin-fonts, AS_HELP_STRING([--enable-builtin-fonts], [Use only built-in fonts (default: use external)]), + [BUILTIN_FONTS=$enableval], + [BUILTIN_FONTS=no]) dnl Extensions. AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) @@ -710,6 +713,11 @@ if test "x$XPRINT" = xyes; then REQUIRED_MODULES="$REQUIRED_MODULES printproto" fi +if test "x$BUILTIN_FONTS" = xyes; then + AC_DEFINE(BUILTIN_FONTS, 1, [Use only built-in fonts]) + AC_DEFINE(NOFONTSERVERACCESS, 1, [Avoid using a font server]) +fi + AC_DEFINE(RENDER, 1, [Support RENDER extension]) RENDER_LIB='$(top_builddir)/render/librender.la' RENDER_INC='-I$(top_srcdir)/render' diff --git a/dix/dixfonts.c b/dix/dixfonts.c index cb0df3c30..ef23fa8d4 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1889,7 +1889,7 @@ InitFonts () { patternCache = MakeFontPatternCache(); -#ifndef KDRIVESERVER +#ifndef BUILTIN_FONTS if (screenInfo.numScreens > screenInfo.numVideoScreens) { PrinterFontRegisterFpeFunctions(); FontFileCheckRegisterFpeFunctions(); @@ -1897,10 +1897,11 @@ InitFonts () } else #endif { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif +#ifdef BUILTIN_FONTS + BuiltinRegisterFpeFunctions(); +#else FontFileRegisterFpeFunctions(); +#endif #ifndef NOFONTSERVERACCESS fs_register_fpe_functions(); #endif diff --git a/dix/main.c b/dix/main.c index 5f539895e..e186e896b 100644 --- a/dix/main.c +++ b/dix/main.c @@ -403,9 +403,14 @@ main(int argc, char *argv[], char *envp[]) FatalError("failed to initialize core devices"); InitFonts(); +#ifdef BUILTIN_FONTS + defaultFontPath = "built-ins"; +#else if (loadableFonts) { SetFontPath(0, 0, (unsigned char *)defaultFontPath, &error); - } else { + } else +#endif + { if (SetDefaultFontPath(defaultFontPath) != Success) ErrorF("failed to set default font path '%s'", defaultFontPath); diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 72a329c03..14164fbeb 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -439,4 +439,7 @@ /* Support D-BUS */ #undef HAVE_DBUS +/* Use only built-in fonts */ +#undef BUILTIN_FONTS + #endif /* _DIX_CONFIG_H_ */