diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 301b17c87..f44f042ef 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -604,16 +604,24 @@ configFiles(XF86ConfFilesPtr fileconf) char *log_buf; /* FontPath */ - /* Try XF86Config FontPath first */ if (!xf86fpFlag) { if (fileconf) { if (fileconf->file_fontpath) { char *f = xf86ValidateFontPath(fileconf->file_fontpath); pathFrom = X_CONFIG; - if (*f) - defaultFontPath = f; - else { + if (*f) { + if (xf86Info.useDefaultFontPath) { + xf86Msg(X_WARNING, "Including the default font path %s.\n", defaultFontPath); + char *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; @@ -781,6 +789,7 @@ typedef enum { FLAG_AIGLX, FLAG_IGNORE_ABI, FLAG_ALLOW_EMPTY_INPUT, + FLAG_USE_DEFAULT_FONT_PATH } FlagValues; static OptionInfoRec FlagOptions[] = { @@ -856,6 +865,8 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE }, + { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, + {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; @@ -1055,6 +1066,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value)) xf86Info.allowEmptyInput = TRUE; + xf86Info.useDefaultFontPath = TRUE; + xf86Info.useDefaultFontPathFrom = X_DEFAULT; + if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) { + xf86Info.useDefaultFontPath = value; + xf86Info.useDefaultFontPathFrom = X_CONFIG; + } + /* Make sure that timers don't overflow CARD32's after multiplying */ #define MAX_TIME_IN_MIN (0x7fffffff / MILLI_PER_MIN) @@ -2490,9 +2508,9 @@ xf86HandleConfigFile(Bool autoconfig) /* Now process everything else */ - if (!configFiles(xf86configptr->conf_files) || - !configServerFlags(xf86configptr->conf_flags, + if (!configServerFlags(xf86configptr->conf_flags, xf86ConfigLayout.options) || + !configFiles(xf86configptr->conf_files) || !configExtensions(xf86configptr->conf_extensions) #ifdef XF86DRI || !configDRI(xf86configptr->conf_dri) diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 659e566e0..7ca0669a5 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -120,6 +120,8 @@ typedef struct { MessageType randRFrom; Bool aiglx; MessageType aiglxFrom; + Bool useDefaultFontPath; + MessageType useDefaultFontPathFrom; Bool ignoreABI; struct { Bool disabled; /* enable/disable deactivating diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index f96428287..f2cb5ef03 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -604,6 +604,11 @@ the builtin handler will be used. .BI "Option \*qAIGLX\*q \*q" boolean \*q enable or disable AIGLX. AIGLX is enabled by default. .TP 7 +.BI "Option \*qUseDefaultFontPath\*q \*q" boolean \*q +Include the default font path even if other paths are specified in +xorg.conf. If enabled, other font paths are included as well. Enabled by +default. +.TP 7 .BI "Option \*qIgnoreABI\*q \*q" boolean \*q Allow modules built for a different, potentially incompatible version of the X server to load. Disabled by default.