Default to use standard bitmap fonts, with builtins as fallback
The builtin-fonts configure option was removed, as it at best should have been a runtime option. Instead, now it always register all "font path element" backends, and adds built-ins fonts at the end of the default font path. This should be a more reasonable solution, to "correct" the most common Xorg FAQ (could not open default font 'fixed'), and also don't break by default applications that use only the standard/historical X Font rendering.
This commit is contained in:
parent
4f00423187
commit
49b93df8a3
|
@ -507,9 +507,6 @@ AC_ARG_ENABLE(install-libxf86config,
|
||||||
[Install libxf86config (default: disabled)]),
|
[Install libxf86config (default: disabled)]),
|
||||||
[INSTALL_LIBXF86CONFIG=$enableval],
|
[INSTALL_LIBXF86CONFIG=$enableval],
|
||||||
[INSTALL_LIBXF86CONFIG=no])
|
[INSTALL_LIBXF86CONFIG=no])
|
||||||
AC_ARG_ENABLE(builtin-fonts, AS_HELP_STRING([--enable-builtin-fonts], [Use only built-in fonts (default: yes)]),
|
|
||||||
[BUILTIN_FONTS=$enableval],
|
|
||||||
[BUILTIN_FONTS=yes])
|
|
||||||
AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]),
|
AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]),
|
||||||
[NULL_ROOT_CURSOR=$enableval],
|
[NULL_ROOT_CURSOR=$enableval],
|
||||||
[NULL_ROOT_CURSOR=no])
|
[NULL_ROOT_CURSOR=no])
|
||||||
|
@ -963,11 +960,6 @@ if test "x$DPMSExtension" = xyes; then
|
||||||
AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
|
AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$BUILTIN_FONTS" = xyes; then
|
|
||||||
AC_DEFINE(BUILTIN_FONTS, 1, [Use only built-in fonts])
|
|
||||||
FONTPATH="built-ins"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then
|
if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then
|
||||||
AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension])
|
AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension])
|
||||||
REQUIRED_MODULES="$REQUIRED_MODULES xcalibrateproto"
|
REQUIRED_MODULES="$REQUIRED_MODULES xcalibrateproto"
|
||||||
|
|
|
@ -1906,12 +1906,9 @@ InitFonts (void)
|
||||||
{
|
{
|
||||||
patternCache = MakeFontPatternCache();
|
patternCache = MakeFontPatternCache();
|
||||||
|
|
||||||
#ifdef BUILTIN_FONTS
|
|
||||||
BuiltinRegisterFpeFunctions();
|
BuiltinRegisterFpeFunctions();
|
||||||
#else
|
|
||||||
FontFileRegisterFpeFunctions();
|
FontFileRegisterFpeFunctions();
|
||||||
fs_register_fpe_functions();
|
fs_register_fpe_functions();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -110,8 +110,6 @@ extern DeviceAssocRec mouse_assoc;
|
||||||
#define PROJECTROOT "/usr/X11R6"
|
#define PROJECTROOT "/usr/X11R6"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *fontPath = NULL;
|
|
||||||
|
|
||||||
static ModuleDefault ModuleDefaults[] = {
|
static ModuleDefault ModuleDefaults[] = {
|
||||||
{.name = "extmod", .toLoad = TRUE, .load_opt=NULL},
|
{.name = "extmod", .toLoad = TRUE, .load_opt=NULL},
|
||||||
{.name = "dbe", .toLoad = TRUE, .load_opt=NULL},
|
{.name = "dbe", .toLoad = TRUE, .load_opt=NULL},
|
||||||
|
@ -586,76 +584,45 @@ xf86ConfigError(char *msg, ...)
|
||||||
static void
|
static void
|
||||||
configFiles(XF86ConfFilesPtr fileconf)
|
configFiles(XF86ConfFilesPtr fileconf)
|
||||||
{
|
{
|
||||||
MessageType pathFrom = X_DEFAULT;
|
MessageType pathFrom;
|
||||||
int countDirs;
|
Bool must_copy;
|
||||||
char *temp_path;
|
int size, countDirs;
|
||||||
char *log_buf;
|
char *temp_path, *log_buf, *start, *end;
|
||||||
|
|
||||||
/* FontPath */
|
/* FontPath */
|
||||||
/* Try XF86Config FontPath first */
|
must_copy = TRUE;
|
||||||
if (!xf86fpFlag) {
|
|
||||||
if (fileconf) {
|
temp_path = defaultFontPath ? defaultFontPath : "";
|
||||||
if (fileconf->file_fontpath) {
|
if (xf86fpFlag)
|
||||||
char *f = xf86ValidateFontPath(fileconf->file_fontpath);
|
|
||||||
pathFrom = X_CONFIG;
|
|
||||||
if (*f) {
|
|
||||||
if (xf86Info.useDefaultFontPath) {
|
|
||||||
char *g;
|
|
||||||
xf86Msg(X_DEFAULT, "Including the default font path %s.\n", defaultFontPath);
|
|
||||||
g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3);
|
|
||||||
strcpy(g, f);
|
|
||||||
strcat(g, ",");
|
|
||||||
defaultFontPath = strcat(g, defaultFontPath);
|
|
||||||
xfree(f);
|
|
||||||
} else {
|
|
||||||
defaultFontPath = f;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
xf86Msg(X_WARNING,
|
|
||||||
"FontPath is completely invalid. Using compiled-in default.\n");
|
|
||||||
fontPath = NULL;
|
|
||||||
pathFrom = X_DEFAULT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
xf86Msg(X_DEFAULT,
|
|
||||||
"No FontPath specified. Using compiled-in default.\n");
|
|
||||||
pathFrom = X_DEFAULT;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Use fontpath specified with '-fp' */
|
|
||||||
if (fontPath)
|
|
||||||
{
|
|
||||||
fontPath = NULL;
|
|
||||||
}
|
|
||||||
pathFrom = X_CMDLINE;
|
pathFrom = X_CMDLINE;
|
||||||
|
else if (fileconf && fileconf->file_fontpath) {
|
||||||
|
pathFrom = X_CONFIG;
|
||||||
|
if (xf86Info.useDefaultFontPath) {
|
||||||
|
defaultFontPath = Xprintf("%s%s%s",
|
||||||
|
fileconf->file_fontpath,
|
||||||
|
*temp_path ? "," : "", temp_path);
|
||||||
|
must_copy = FALSE;
|
||||||
}
|
}
|
||||||
if (!fileconf) {
|
else
|
||||||
/* xf86ValidateFontPath will write into it's arg, but defaultFontPath
|
defaultFontPath = fileconf->file_fontpath;
|
||||||
could be static, so we make a copy. */
|
|
||||||
char *f = xnfalloc(strlen(defaultFontPath) + 1);
|
|
||||||
f[0] = '\0';
|
|
||||||
strcpy (f, defaultFontPath);
|
|
||||||
defaultFontPath = xf86ValidateFontPath(f);
|
|
||||||
xfree(f);
|
|
||||||
} else {
|
|
||||||
if (fileconf) {
|
|
||||||
if (!fileconf->file_fontpath) {
|
|
||||||
/* xf86ValidateFontPath will write into it's arg, but defaultFontPath
|
|
||||||
could be static, so we make a copy. */
|
|
||||||
char *f = xnfalloc(strlen(defaultFontPath) + 1);
|
|
||||||
f[0] = '\0';
|
|
||||||
strcpy (f, defaultFontPath);
|
|
||||||
defaultFontPath = xf86ValidateFontPath(f);
|
|
||||||
xfree(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
pathFrom = X_DEFAULT;
|
||||||
|
temp_path = defaultFontPath ? defaultFontPath : "";
|
||||||
|
|
||||||
/* If defaultFontPath is still empty, exit here */
|
/* ensure defaultFontPath contains "built-ins" */
|
||||||
|
start = strstr(temp_path, "built-ins");
|
||||||
if (! *defaultFontPath)
|
end = start + strlen("built-ins");
|
||||||
FatalError("No valid FontPath could be found.");
|
if (start == NULL ||
|
||||||
|
!((start == temp_path || start[-1] == ',') && (!*end || *end == ','))) {
|
||||||
|
defaultFontPath = Xprintf("%s%sbuilt-ins",
|
||||||
|
temp_path, *temp_path ? "," : "");
|
||||||
|
must_copy = FALSE;
|
||||||
|
}
|
||||||
|
/* xf86ValidateFontPath modifies its argument, but returns a copy of it. */
|
||||||
|
temp_path = must_copy ? XNFstrdup(defaultFontPath) : defaultFontPath;
|
||||||
|
defaultFontPath = xf86ValidateFontPath(temp_path);
|
||||||
|
free(temp_path);
|
||||||
|
|
||||||
/* make fontpath more readable in the logfiles */
|
/* make fontpath more readable in the logfiles */
|
||||||
countDirs = 1;
|
countDirs = 1;
|
||||||
|
@ -664,12 +631,8 @@ configFiles(XF86ConfFilesPtr fileconf)
|
||||||
countDirs++;
|
countDirs++;
|
||||||
temp_path++;
|
temp_path++;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1);
|
log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1);
|
||||||
if(!log_buf) /* fallback to old method */
|
|
||||||
xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath);
|
|
||||||
else {
|
|
||||||
char *start, *end;
|
|
||||||
int size;
|
|
||||||
temp_path = log_buf;
|
temp_path = log_buf;
|
||||||
start = defaultFontPath;
|
start = defaultFontPath;
|
||||||
while((end = index(start, ',')) != NULL) {
|
while((end = index(start, ',')) != NULL) {
|
||||||
|
@ -685,7 +648,6 @@ configFiles(XF86ConfFilesPtr fileconf)
|
||||||
strcpy(temp_path, start);
|
strcpy(temp_path, start);
|
||||||
xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf);
|
xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf);
|
||||||
xfree(log_buf);
|
xfree(log_buf);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (fileconf && fileconf->file_inputdevs) {
|
if (fileconf && fileconf->file_inputdevs) {
|
||||||
|
|
|
@ -142,6 +142,11 @@ extern _X_EXPORT void InitGlyphCaching(void);
|
||||||
|
|
||||||
extern _X_EXPORT void SetGlyphCachingMode(int /*newmode*/);
|
extern _X_EXPORT void SetGlyphCachingMode(int /*newmode*/);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* libXfont/src/builtins/builtin.h
|
||||||
|
*/
|
||||||
|
extern _X_EXPORT void BuiltinRegisterFpeFunctions(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libXfont stubs.
|
* libXfont stubs.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue