summaryrefslogtreecommitdiff
path: root/src/fontfile
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-03-23 15:57:29 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-03-23 15:57:29 -0700
commitcc824e4f2c9a53a00b36a6f83bf065c363027087 (patch)
tree92ba2a6a2dba2bb4c53eff98a06681561f5ff255 /src/fontfile
parentfc6e22f238d34918156ded34148730075b7b9cc2 (diff)
Actually use loadable font modules
Loadable font modules were not being initialized, and all font renderers known at build time were always being initialized, regardless of Xorg module configuration.
Diffstat (limited to 'src/fontfile')
-rw-r--r--src/fontfile/ffcheck.c60
-rw-r--r--src/fontfile/register.c60
2 files changed, 80 insertions, 40 deletions
diff --git a/src/fontfile/ffcheck.c b/src/fontfile/ffcheck.c
index d03be4f..ea0b3b4 100644
--- a/src/fontfile/ffcheck.c
+++ b/src/fontfile/ffcheck.c
@@ -37,9 +37,7 @@ in this Software without prior written authorization from The Open Group.
#endif
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/bitmap.h>
-#ifdef LOADABLEFONTS
#include <X11/fonts/fontmod.h>
-#endif
/*
* Map FPE functions to renderer functions
@@ -118,37 +116,59 @@ FontFileCheckListNextFontOrAlias(pointer client, FontPathElementPtr fpe,
return BadFontName;
}
-void
-FontFileCheckRegisterFpeFunctions (void)
-{
-#ifndef LOADABLEFONTS
- BitmapRegisterFontFileFunctions ();
-
-
+/* Font renderers to initialize when not linked into something like
+ Xorg that provides its own module configuration options */
+static const FontModule builtinFontModuleList[] = {
#ifdef XFONT_SPEEDO
- SpeedoRegisterFontFileFunctions ();
+ {
+ SpeedoRegisterFontFileFunctions,
+ "speedo",
+ NULL
+ },
#endif
#ifdef XFONT_TYPE1
- Type1RegisterFontFileFunctions();
+ {
+ Type1RegisterFontFileFunctions,
+ "type1",
+ NULL
+ },
#endif
-#ifdef XFONT_FREETYPE
- FreeTypeRegisterFontFileFunctions();
+#ifdef XFONT_FREETYPE
+ {
+ FreeTypeRegisterFontFileFunctions,
+ "freetype",
+ NULL
+ },
#endif
+ /* List terminator - must be last entry */
+ { NULL, NULL, NULL }
+};
+void
+FontFileCheckRegisterFpeFunctions (void)
+{
+ FontModule *fmlist = builtinFontModuleList;
+
+#ifdef XFONT_BITMAP
+ /* bitmap is always builtin to libXfont now */
+ BitmapRegisterFontFileFunctions ();
+#endif
-#else
+#ifdef LOADABLEFONTS
+ if (FontModuleList) {
+ fmlist = FontModuleList;
+ }
+#endif
- {
+ if (fmlist) {
int i;
- if (FontModuleList) {
- for (i = 0; FontModuleList[i].name; i++) {
- if (FontModuleList[i].initFunc)
- FontModuleList[i].initFunc();
+ for (i = 0; fmlist[i].name; i++) {
+ if (fmlist[i].initFunc) {
+ fmlist[i].initFunc();
}
}
}
-#endif
RegisterFPEFunctions(FontFileNameCheck,
FontFileInitFPE,
diff --git a/src/fontfile/register.c b/src/fontfile/register.c
index 53016b2..a591838 100644
--- a/src/fontfile/register.c
+++ b/src/fontfile/register.c
@@ -42,10 +42,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/fonts/fontmisc.h>
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/bitmap.h>
-
-#ifdef LOADABLEFONTS
#include <X11/fonts/fontmod.h>
-#endif
/*
* Translate monolithic build symbols to modular build symbols.
@@ -67,36 +64,59 @@ in this Software without prior written authorization from The Open Group.
# define XFONT_FREETYPE 1
#endif
+/* Font renderers to initialize when not linked into something like
+ Xorg that provides its own module configuration options */
+static const FontModule builtinFontModuleList[] = {
+#ifdef XFONT_SPEEDO
+ {
+ SpeedoRegisterFontFileFunctions,
+ "speedo",
+ NULL
+ },
+#endif
+#ifdef XFONT_TYPE1
+ {
+ Type1RegisterFontFileFunctions,
+ "type1",
+ NULL
+ },
+#endif
+#ifdef XFONT_FREETYPE
+ {
+ FreeTypeRegisterFontFileFunctions,
+ "freetype",
+ NULL
+ },
+#endif
+ /* List terminator - must be last entry */
+ { NULL, NULL, NULL }
+};
+
void
FontFileRegisterFpeFunctions(void)
{
-#ifndef LOADABLEFONTS
+ FontModule *fmlist = builtinFontModuleList;
#ifdef XFONT_BITMAP
+ /* bitmap is always builtin to libXfont now */
BitmapRegisterFontFileFunctions ();
#endif
-#ifdef XFONT_SPEEDO
- SpeedoRegisterFontFileFunctions ();
-#endif
-#ifdef XFONT_TYPE1
- Type1RegisterFontFileFunctions();
-#endif
-#ifdef XFONT_FREETYPE
- FreeTypeRegisterFontFileFunctions();
-#endif
-#else
- {
+#ifdef LOADABLEFONTS
+ if (FontModuleList) {
+ fmlist = FontModuleList;
+ }
+#endif
+
+ if (fmlist) {
int i;
- if (FontModuleList) {
- for (i = 0; FontModuleList[i].name; i++) {
- if (FontModuleList[i].initFunc)
- FontModuleList[i].initFunc();
+ for (i = 0; fmlist[i].name; i++) {
+ if (fmlist[i].initFunc) {
+ fmlist[i].initFunc();
}
}
}
-#endif
FontFileRegisterLocalFpeFunctions ();
}