Commit f4c80a78 authored by Mike Gabriel's avatar Mike Gabriel

Xserver: Support building against libXfont2 (v2) API and old libXfont(1) API alike.

Fixes ArcticaProject/nx-libs#296. Inspired by the following X.org commit. Other than X.org, we will continue support for building nx-libs against libXfont1 for a while. commit 05a793f5b3c40747d5a92a076def7f4fb673c7e7 Author: Keith Packard <keithp@keithp.com> Date: Tue Sep 1 18:50:55 2015 -0700 dix: Switch to the libXfont2 API (v2) This new libXfont API eliminates exposing internal X server symbols to the font library, replacing those with a struct full of the entire API needed to use that library. v2: Use libXfont2 instead of libXfont_2 Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
parent f743f9f7
...@@ -564,6 +564,9 @@ X_BYTE_ORDER = ByteOrder ...@@ -564,6 +564,9 @@ X_BYTE_ORDER = ByteOrder
#ifndef HasFfs #ifndef HasFfs
#define HasFfs YES #define HasFfs YES
#endif #endif
#ifndef HasXfont2
#define HasXfont2 NO
#endif
#ifndef GzipLibrary /* if OS config didn't define it, assume it's -lz */ #ifndef GzipLibrary /* if OS config didn't define it, assume it's -lz */
#define GzipLibrary -lz #define GzipLibrary -lz
#endif #endif
......
...@@ -70,3 +70,11 @@ GLX_DEFINES = GlxDefines ...@@ -70,3 +70,11 @@ GLX_DEFINES = GlxDefines
#ifdef XorgVersion #ifdef XorgVersion
#include <xorg.tmpl> #include <xorg.tmpl>
#endif #endif
#if HasXfont2
FONT_DEFINES = -DHAS_XFONT2
XFONTLIB = -lXfont2
#else
FONT_DEFINES =
XFONTLIB = -lXfont
#endif
...@@ -390,6 +390,12 @@ ...@@ -390,6 +390,12 @@
#define BuildXKBlib YES #define BuildXKBlib YES
/* /*
* If you want to build against libXfont2, rather than libXfont(1), uncomment this.
*
#define HasXfont2 YES
*/
/*
* If you are running NetBSD 0.9C or later, and have the aperture driver * If you are running NetBSD 0.9C or later, and have the aperture driver
* installed, uncomment this. * installed, uncomment this.
* *
......
...@@ -424,6 +424,10 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 ...@@ -424,6 +424,10 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
# define BuildXKBlib YES # define BuildXKBlib YES
#endif #endif
#ifndef HasXfont2
# define HasXfont2 NO
#endif
#ifndef BuildScreenSaverExt #ifndef BuildScreenSaverExt
# define BuildScreenSaverExt YES # define BuildScreenSaverExt YES
#endif #endif
......
...@@ -323,7 +323,7 @@ NXAGENTNXLIBS = -L/usr/sfw/lib \ ...@@ -323,7 +323,7 @@ NXAGENTNXLIBS = -L/usr/sfw/lib \
-lXcompshad \ -lXcompshad \
-lXrender \ -lXrender \
-lXfixes \ -lXfixes \
-lXfont \ $(XFONTLIB) \
-lXcomposite \ -lXcomposite \
-lXinerama \ -lXinerama \
-lXdmcp \ -lXdmcp \
...@@ -338,7 +338,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \ ...@@ -338,7 +338,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \
-lXcompshad \ -lXcompshad \
-lXrender \ -lXrender \
-lXfixes \ -lXfixes \
-lXfont \ $(XFONTLIB) \
-lXcomposite \ -lXcomposite \
-lXdmcp \ -lXdmcp \
-lNX_X11 \ -lNX_X11 \
...@@ -353,7 +353,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \ ...@@ -353,7 +353,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \
-lXcompshad \ -lXcompshad \
-lXrender \ -lXrender \
-lXfixes \ -lXfixes \
-lXfont \ $(XFONTLIB) \
-lXcomposite \ -lXcomposite \
-lXinerama \ -lXinerama \
-lXdmcp \ -lXdmcp \
...@@ -368,7 +368,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \ ...@@ -368,7 +368,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \
-lXcompshad \ -lXcompshad \
-lXrender \ -lXrender \
-lXfixes \ -lXfixes \
-lXfont \ $(XFONTLIB) \
-lXcomposite \ -lXcomposite \
-lXinerama \ -lXinerama \
-lXdmcp \ -lXdmcp \
......
...@@ -119,7 +119,7 @@ LintLibraryTarget(ext,$(SRCS)) ...@@ -119,7 +119,7 @@ LintLibraryTarget(ext,$(SRCS))
NormalLintTarget($(SRCS)) NormalLintTarget($(SRCS))
#if BuildXF86BigfontExt #if BuildXF86BigfontExt
SpecialCObjectRule(xf86bigfont,$(ICONFIGFILES),$(SHM_DEFINES)) SpecialCObjectRule(xf86bigfont,$(ICONFIGFILES),$(SHM_DEFINES) $(FONT_DEFINES))
#endif #endif
#if BuildXCSecurity #if BuildXCSecurity
SpecialCObjectRule(security,$(ICONFIGFILES),$(POLICYFILEDEF)) SpecialCObjectRule(security,$(ICONFIGFILES),$(POLICYFILEDEF))
......
...@@ -75,6 +75,10 @@ ...@@ -75,6 +75,10 @@
#define _XF86BIGFONT_SERVER_ #define _XF86BIGFONT_SERVER_
#include <nx-X11/extensions/xf86bigfproto.h> #include <nx-X11/extensions/xf86bigfproto.h>
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#endif /* HAS_XFONT2 */
static void XF86BigfontResetProc( static void XF86BigfontResetProc(
ExtensionEntry * /* extEntry */ ExtensionEntry * /* extEntry */
); );
...@@ -186,7 +190,11 @@ XFree86BigfontExtensionInit() ...@@ -186,7 +190,11 @@ XFree86BigfontExtensionInit()
+ (unsigned int) (65536.0/(RAND_MAX+1.0) * rand()); + (unsigned int) (65536.0/(RAND_MAX+1.0) * rand());
/* fprintf(stderr, "signature = 0x%08X\n", signature); */ /* fprintf(stderr, "signature = 0x%08X\n", signature); */
#ifdef HAS_XFONT2
FontShmdescIndex = xfont2_allocate_font_private_index();
#else
FontShmdescIndex = AllocateFontPrivateIndex(); FontShmdescIndex = AllocateFontPrivateIndex();
#endif /* HAS_XFONT2 */
#if !defined(CSRG_BASED) && !defined(__CYGWIN__) #if !defined(CSRG_BASED) && !defined(__CYGWIN__)
pagesize = SHMLBA; pagesize = SHMLBA;
...@@ -526,7 +534,11 @@ ProcXF86BigfontQueryFont( ...@@ -526,7 +534,11 @@ ProcXF86BigfontQueryFont(
#ifdef HAS_SHM #ifdef HAS_SHM
if (pDesc && !badSysCall) { if (pDesc && !badSysCall) {
*(CARD32 *)(pCI + nCharInfos) = signature; *(CARD32 *)(pCI + nCharInfos) = signature;
#ifdef HAS_XFONT2
if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) {
#else
if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) { if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) {
#endif /* HAS_XFONT2 */
shmdealloc(pDesc); shmdealloc(pDesc);
return BadAlloc; return BadAlloc;
} }
......
...@@ -133,7 +133,9 @@ LintLibraryTarget(dix,$(SRCS) $(XPSRC)) ...@@ -133,7 +133,9 @@ LintLibraryTarget(dix,$(SRCS) $(XPSRC))
NormalLintTarget($(SRCS) $(XPSRC)) NormalLintTarget($(SRCS) $(XPSRC))
SpecialCObjectRule(globals,$(ICONFIGFILES),$(SITE_DEFINES)) SpecialCObjectRule(globals,$(ICONFIGFILES),$(SITE_DEFINES))
SpecialCObjectRule(main,$(ICONFIGFILES),$(VENDOR_DEFINES)) SpecialCObjectRule(main,$(ICONFIGFILES),$(VENDOR_DEFINES) $(FONT_DEFINES))
SpecialCObjectRule(dispatch,$(ICONFIGFILES),$(FONT_DEFINES))
SpecialCObjectRule(dixfonts,$(ICONFIGFILES),$(FONT_DEFINES))
SpecialCObjectRule(pixmap,$(ICONFIGFILES),$(_NOOP_)) SpecialCObjectRule(pixmap,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(privates,$(ICONFIGFILES),$(_NOOP_)) SpecialCObjectRule(privates,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(window,$(ICONFIGFILES),$(QUARTZ_DEFINES)) SpecialCObjectRule(window,$(ICONFIGFILES),$(QUARTZ_DEFINES))
......
...@@ -86,6 +86,11 @@ int ProcInitialConnection(); ...@@ -86,6 +86,11 @@ int ProcInitialConnection();
#include "windowstr.h" #include "windowstr.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#else
# include <X11/fonts/fontutil.h>
#endif /* HAS_XFONT2 */
#include "dixfontstr.h" #include "dixfontstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "selection.h" #include "selection.h"
...@@ -1399,7 +1404,11 @@ ProcQueryTextExtents(register ClientPtr client) ...@@ -1399,7 +1404,11 @@ ProcQueryTextExtents(register ClientPtr client)
return(BadLength); return(BadLength);
length--; length--;
} }
#ifdef HAS_XFONT2
if (!xfont2_query_text_extents(pFont, length, (unsigned char *)&stuff[1], &info))
#else
if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info)) if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info))
#endif /* HAS_XFONT2 */
return(BadAlloc); return(BadAlloc);
reply.type = X_Reply; reply.type = X_Reply;
reply.length = 0; reply.length = 0;
......
...@@ -95,6 +95,12 @@ Equipment Corporation. ...@@ -95,6 +95,12 @@ Equipment Corporation.
#include "colormapst.h" #include "colormapst.h"
#include "cursorstr.h" #include "cursorstr.h"
#include <X11/fonts/font.h> #include <X11/fonts/font.h>
#include <X11/fonts/fontstruct.h>
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#else
# include <X11/fonts/fontutil.h>
#endif /* HAS_XFONT2 */
#include "opaque.h" #include "opaque.h"
#include "servermd.h" #include "servermd.h"
#include "site.h" #include "site.h"
...@@ -252,7 +258,11 @@ main(int argc, char *argv[], char *envp[]) ...@@ -252,7 +258,11 @@ main(int argc, char *argv[], char *envp[])
InitAtoms(); InitAtoms();
InitEvents(); InitEvents();
#ifdef HAS_XFONT2
xfont2_init_glyph_caching();
#else
InitGlyphCaching(); InitGlyphCaching();
#endif /* of HAS_XFONT2 */
ResetClientPrivates(); ResetClientPrivates();
ResetScreenPrivates(); ResetScreenPrivates();
ResetWindowPrivates(); ResetWindowPrivates();
......
...@@ -41,6 +41,7 @@ is" without express or implied warranty. ...@@ -41,6 +41,7 @@ is" without express or implied warranty.
#include "dixstruct.h" #include "dixstruct.h"
#include <X11/fonts/font.h> #include <X11/fonts/font.h>
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "misc.h" #include "misc.h"
#include "miscstruct.h" #include "miscstruct.h"
#include "opaque.h" #include "opaque.h"
...@@ -495,7 +496,11 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) ...@@ -495,7 +496,11 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
const char *name; const char *name;
char *origName = (char*) pScreen; char *origName = (char*) pScreen;
#ifdef HAS_XFONT2
xfont2_font_set_private(pFont, nxagentFontPrivateIndex, NULL);
#else
FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL); FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL);
#endif /* HAS_XFONT2 */
if (requestingClient && XpClientIsPrintClient(requestingClient, NULL)) if (requestingClient && XpClientIsPrintClient(requestingClient, NULL))
return True; return True;
...@@ -540,7 +545,11 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) ...@@ -540,7 +545,11 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
} }
priv = (void *)malloc(sizeof(nxagentPrivFont)); priv = (void *)malloc(sizeof(nxagentPrivFont));
#ifdef HAS_XFONT2
xfont2_font_set_private(pFont, nxagentFontPrivateIndex, priv);
#else
FontSetPrivate(pFont, nxagentFontPrivateIndex, priv); FontSetPrivate(pFont, nxagentFontPrivateIndex, priv);
#endif /* HAS_XFONT2 */
nxagentFontPriv(pFont) -> mirrorID = 0; nxagentFontPriv(pFont) -> mirrorID = 0;
...@@ -688,7 +697,11 @@ Bool nxagentUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) ...@@ -688,7 +697,11 @@ Bool nxagentUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
FreeResource(nxagentFontPriv(pFont) -> mirrorID, RT_NONE); FreeResource(nxagentFontPriv(pFont) -> mirrorID, RT_NONE);
free(nxagentFontPriv(pFont)); free(nxagentFontPriv(pFont));
#ifdef HAS_XFONT2
xfont2_font_set_private(pFont, nxagentFontPrivateIndex, NULL);
#else
FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL); FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL);
#endif /* HAS_XFONT2 */
} }
return True; return True;
......
...@@ -257,7 +257,11 @@ all:: $(OBJS) ...@@ -257,7 +257,11 @@ all:: $(OBJS)
LinkSourceFile(stubs.c,$(SERVERSRC)/Xi) LinkSourceFile(stubs.c,$(SERVERSRC)/Xi)
LinkSourceFile(xpstubs.c,$(SERVERSRC)/dix) LinkSourceFile(xpstubs.c,$(SERVERSRC)/dix)
SpecialCObjectRule(Init,$(ICONFIGFILES),$(_NOOP_)) SpecialCObjectRule(Init,$(ICONFIGFILES),$(FONT_DEFINES))
SpecialCObjectRule(Font,$(ICONFIGFILES),$(FONT_DEFINES))
SpecialCObjectRule(NXdamage,$(ICONFIGFILES),$(FONT_DEFINES))
SpecialCObjectRule(NXdispatch,$(ICONFIGFILES),$(FONT_DEFINES))
SpecialCObjectRule(NXdixfonts,$(ICONFIGFILES),$(FONT_DEFINES))
LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) LinkSourceFile(miinitext.c,$(SERVERSRC)/mi)
SpecialCObjectRule(miinitext,$(ICONFIGFILES), $(_NOOP_)) SpecialCObjectRule(miinitext,$(ICONFIGFILES), $(_NOOP_))
......
...@@ -51,6 +51,7 @@ is" without express or implied warranty. ...@@ -51,6 +51,7 @@ is" without express or implied warranty.
#include "servermd.h" #include "servermd.h"
#include "mi.h" #include "mi.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "Agent.h" #include "Agent.h"
#include "Display.h" #include "Display.h"
...@@ -367,7 +368,11 @@ FIXME: These variables, if not removed at all because have probably ...@@ -367,7 +368,11 @@ FIXME: These variables, if not removed at all because have probably
nxagentWindowPrivateIndex = AllocateWindowPrivateIndex(); nxagentWindowPrivateIndex = AllocateWindowPrivateIndex();
nxagentGCPrivateIndex = AllocateGCPrivateIndex(); nxagentGCPrivateIndex = AllocateGCPrivateIndex();
RT_NX_GC = CreateNewResourceType(nxagentDestroyNewGCResourceType); RT_NX_GC = CreateNewResourceType(nxagentDestroyNewGCResourceType);
#ifdef HAS_XFONT2
nxagentFontPrivateIndex = xfont2_allocate_font_private_index();
#else
nxagentFontPrivateIndex = AllocateFontPrivateIndex(); nxagentFontPrivateIndex = AllocateFontPrivateIndex();
#endif /* HAS_XFONT2 */
RT_NX_FONT = CreateNewResourceType(nxagentDestroyNewFontResourceType); RT_NX_FONT = CreateNewResourceType(nxagentDestroyNewFontResourceType);
nxagentClientPrivateIndex = AllocateClientPrivateIndex(); nxagentClientPrivateIndex = AllocateClientPrivateIndex();
nxagentPixmapPrivateIndex = AllocatePixmapPrivateIndex(); nxagentPixmapPrivateIndex = AllocatePixmapPrivateIndex();
......
...@@ -210,14 +210,22 @@ doOpenFont(ClientPtr client, OFclosurePtr c) ...@@ -210,14 +210,22 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
if (c->current_fpe < c->num_fpes) if (c->current_fpe < c->num_fpes)
{ {
fpe = c->fpe_list[c->current_fpe]; fpe = c->fpe_list[c->current_fpe];
#ifdef HAS_XFONT2
(*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
#else
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type].client_died) ((void *) client, fpe);
#endif /* HAS_XFONT2 */
} }
err = Successful; err = Successful;
goto bail; goto bail;
} }
while (c->current_fpe < c->num_fpes) { while (c->current_fpe < c->num_fpes) {
fpe = c->fpe_list[c->current_fpe]; fpe = c->fpe_list[c->current_fpe];
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->open_font)
#else
err = (*fpe_functions[fpe->type].open_font) err = (*fpe_functions[fpe->type].open_font)
#endif /* HAS_XFONT2 */
((void *) client, fpe, c->flags, ((void *) client, fpe, c->flags,
c->fontname, c->fnamelen, FontFormat, c->fontname, c->fnamelen, FontFormat,
BitmapFormatMaskByte | BitmapFormatMaskByte |
...@@ -314,7 +322,11 @@ doOpenFont(ClientPtr client, OFclosurePtr c) ...@@ -314,7 +322,11 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
} }
} }
if (patternCache && pfont != c->non_cachable_font) if (patternCache && pfont != c->non_cachable_font)
#ifdef HAS_XFONT2
xfont2_cache_font_pattern(patternCache, nxagentOrigFontName, nxagentOrigFontNameLen,
#else
CacheFontPattern(patternCache, nxagentOrigFontName, nxagentOrigFontNameLen, CacheFontPattern(patternCache, nxagentOrigFontName, nxagentOrigFontNameLen,
#endif /* HAS_XFONT2 */
pfont); pfont);
bail: bail:
if (err != Successful && c->client != serverClient) { if (err != Successful && c->client != serverClient) {
...@@ -359,7 +371,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ...@@ -359,7 +371,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
if (c->current.current_fpe < c->num_fpes) if (c->current.current_fpe < c->num_fpes)
{ {
fpe = c->fpe_list[c->current.current_fpe]; fpe = c->fpe_list[c->current.current_fpe];
#ifdef HAS_XFONT2
(*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
#else
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type].client_died) ((void *) client, fpe);
#endif /* HAS_XFONT2 */
} }
err = Successful; err = Successful;
goto bail; goto bail;
...@@ -372,11 +388,19 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ...@@ -372,11 +388,19 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
fpe = c->fpe_list[c->current.current_fpe]; fpe = c->fpe_list[c->current.current_fpe];
err = Successful; err = Successful;
#ifdef HAS_XFONT2
if (!fpe_functions[fpe->type]->start_list_fonts_and_aliases)
#else
if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) if (!fpe_functions[fpe->type].start_list_fonts_and_aliases)
#endif /* HAS_XFONT2 */
{ {
/* This FPE doesn't support/require list_fonts_and_aliases */ /* This FPE doesn't support/require list_fonts_and_aliases */
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->list_fonts)
#else
err = (*fpe_functions[fpe->type].list_fonts) err = (*fpe_functions[fpe->type].list_fonts)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, c->current.pattern, ((void *) c->client, fpe, c->current.pattern,
c->current.patlen, c->current.max_names - c->names->nnames, c->current.patlen, c->current.max_names - c->names->nnames,
c->names); c->names);
...@@ -408,7 +432,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ...@@ -408,7 +432,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
the FPEs. */ the FPEs. */
if (!c->current.list_started) { if (!c->current.list_started) {
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->start_list_fonts_and_aliases)
#else
err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, c->current.pattern, ((void *) c->client, fpe, c->current.pattern,
c->current.patlen, c->current.max_names - c->names->nnames, c->current.patlen, c->current.max_names - c->names->nnames,
&c->current.private); &c->current.private);
...@@ -427,7 +455,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ...@@ -427,7 +455,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
if (err == Successful) { if (err == Successful) {
char *tmpname; char *tmpname;
name = 0; name = 0;
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->list_next_font_or_alias)
#else
err = (*fpe_functions[fpe->type].list_next_font_or_alias) err = (*fpe_functions[fpe->type].list_next_font_or_alias)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, &name, &namelen, &tmpname, ((void *) c->client, fpe, &name, &namelen, &tmpname,
&resolvedlen, c->current.private); &resolvedlen, c->current.private);
if (err == Suspended) { if (err == Suspended) {
...@@ -458,11 +490,19 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ...@@ -458,11 +490,19 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
if (c->haveSaved) if (c->haveSaved)
{ {
if (c->savedName) if (c->savedName)
#ifdef HAS_XFONT2
(void)xfont2_add_font_names_name(c->names, c->savedName,
#else
(void)AddFontNamesName(c->names, c->savedName, (void)AddFontNamesName(c->names, c->savedName,
#endif /* HAS_XFONT2 */
c->savedNameLen); c->savedNameLen);
} }
else else
#ifdef HAS_XFONT2
(void)xfont2_add_font_names_name(c->names, name, namelen);
#else
(void)AddFontNamesName(c->names, name, namelen); (void)AddFontNamesName(c->names, name, namelen);
#endif /* HAS_XFONT2 */
} }
/* /*
...@@ -487,7 +527,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ...@@ -487,7 +527,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
int tmpnamelen; int tmpnamelen;
tmpname = 0; tmpname = 0;
#ifdef HAS_XFONT2
(void) (*fpe_functions[fpe->type]->list_next_font_or_alias)
#else
(void) (*fpe_functions[fpe->type].list_next_font_or_alias) (void) (*fpe_functions[fpe->type].list_next_font_or_alias)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, &tmpname, &tmpnamelen, ((void *) c->client, fpe, &tmpname, &tmpnamelen,
&tmpname, &tmpnamelen, c->current.private); &tmpname, &tmpnamelen, c->current.private);
if (--aliascount <= 0) if (--aliascount <= 0)
...@@ -621,7 +665,11 @@ bail: ...@@ -621,7 +665,11 @@ bail:
FreeFPE(c->fpe_list[i]); FreeFPE(c->fpe_list[i]);
free(c->fpe_list); free(c->fpe_list);
if (c->savedName) free(c->savedName); if (c->savedName) free(c->savedName);
#ifdef HAS_XFONT2
xfont2_free_font_names(names);
#else
FreeFontNames(names); FreeFontNames(names);
#endif /* HAS_XFONT2 */
free(c); free(c);
if (resolved) free(resolved); if (resolved) free(resolved);
return TRUE; return TRUE;
...@@ -651,7 +699,11 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, ...@@ -651,7 +699,11 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
free(c); free(c);
return BadAlloc; return BadAlloc;
} }
#ifdef HAS_XFONT2
c->names = xfont2_make_font_names_record(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames);
#else
c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames); c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames);
#endif /* HAS_XFONT2 */
if (!c->names) if (!c->names)
{ {
free(c->fpe_list); free(c->fpe_list);
...@@ -699,7 +751,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) ...@@ -699,7 +751,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
if (c->current.current_fpe < c->num_fpes) if (c->current.current_fpe < c->num_fpes)
{ {
fpe = c->fpe_list[c->current.current_fpe]; fpe = c->fpe_list[c->current.current_fpe];
#ifdef HAS_XFONT2
(*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
#else
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type].client_died) ((void *) client, fpe);
#endif /* HAS_XFONT2 */
} }
err = Successful; err = Successful;
goto bail; goto bail;
...@@ -713,7 +769,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) ...@@ -713,7 +769,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
err = Successful; err = Successful;
if (!c->current.list_started) if (!c->current.list_started)
{ {
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->start_list_fonts_with_info)
#else
err = (*fpe_functions[fpe->type].start_list_fonts_with_info) err = (*fpe_functions[fpe->type].start_list_fonts_with_info)
#endif /* HAS_XFONT2 */
(client, fpe, c->current.pattern, c->current.patlen, (client, fpe, c->current.pattern, c->current.patlen,
c->current.max_names, &c->current.private); c->current.max_names, &c->current.private);
if (err == Suspended) if (err == Suspended)
...@@ -735,7 +795,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) ...@@ -735,7 +795,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
{ {
name = 0; name = 0;
pFontInfo = &fontInfo; pFontInfo = &fontInfo;
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->list_next_font_with_info)
#else
err = (*fpe_functions[fpe->type].list_next_font_with_info) err = (*fpe_functions[fpe->type].list_next_font_with_info)
#endif /* HAS_XFONT2 */
(client, fpe, &name, &namelen, &pFontInfo, (client, fpe, &name, &namelen, &pFontInfo,
&numFonts, c->current.private); &numFonts, c->current.private);
if (err == Suspended) if (err == Suspended)
...@@ -775,7 +839,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) ...@@ -775,7 +839,11 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
tmpname = 0; tmpname = 0;
tmpFontInfo = &fontInfo; tmpFontInfo = &fontInfo;
#ifdef HAS_XFONT2
(void) (*fpe_functions[fpe->type]->list_next_font_with_info)
#else
(void) (*fpe_functions[fpe->type].list_next_font_with_info) (void) (*fpe_functions[fpe->type].list_next_font_with_info)
#endif /* HAS_XFONT2 */
(client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo,
&numFonts, c->current.private); &numFonts, c->current.private);
if (--aliascount <= 0) if (--aliascount <= 0)
...@@ -1028,7 +1096,11 @@ nxdoListFontsAndAliases(client, fss) ...@@ -1028,7 +1096,11 @@ nxdoListFontsAndAliases(client, fss)
if (c->current.current_fpe < c->num_fpes) if (c->current.current_fpe < c->num_fpes)
{ {
fpe = c->fpe_list[c->current.current_fpe]; fpe = c->fpe_list[c->current.current_fpe];
#ifdef HAS_XFONT2
(*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
#else
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type].client_died) ((void *) client, fpe);
#endif /* HAS_XFONT2 */
} }
err = Successful; err = Successful;
goto bail; goto bail;
...@@ -1041,11 +1113,19 @@ nxdoListFontsAndAliases(client, fss) ...@@ -1041,11 +1113,19 @@ nxdoListFontsAndAliases(client, fss)
fpe = c->fpe_list[c->current.current_fpe]; fpe = c->fpe_list[c->current.current_fpe];
err = Successful; err = Successful;
#ifdef HAS_XFONT2
if (!fpe_functions[fpe->type]->start_list_fonts_and_aliases)
#else
if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) if (!fpe_functions[fpe->type].start_list_fonts_and_aliases)
#endif /* HAS_XFONT2 */
{ {
/* This FPE doesn't support/require list_fonts_and_aliases */ /* This FPE doesn't support/require list_fonts_and_aliases */
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->list_fonts)
#else
err = (*fpe_functions[fpe->type].list_fonts) err = (*fpe_functions[fpe->type].list_fonts)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, c->current.pattern, ((void *) c->client, fpe, c->current.pattern,
c->current.patlen, c->current.max_names - c->names->nnames, c->current.patlen, c->current.max_names - c->names->nnames,
c->names); c->names);
...@@ -1077,7 +1157,11 @@ nxdoListFontsAndAliases(client, fss) ...@@ -1077,7 +1157,11 @@ nxdoListFontsAndAliases(client, fss)
the FPEs. */ the FPEs. */
if (!c->current.list_started) { if (!c->current.list_started) {
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->start_list_fonts_and_aliases)
#else
err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, c->current.pattern, ((void *) c->client, fpe, c->current.pattern,
c->current.patlen, c->current.max_names - c->names->nnames, c->current.patlen, c->current.max_names - c->names->nnames,
&c->current.private); &c->current.private);
...@@ -1099,7 +1183,11 @@ nxdoListFontsAndAliases(client, fss) ...@@ -1099,7 +1183,11 @@ nxdoListFontsAndAliases(client, fss)
if (err == Successful) { if (err == Successful) {
char *tmpname; char *tmpname;
name = 0; name = 0;
#ifdef HAS_XFONT2
err = (*fpe_functions[fpe->type]->list_next_font_or_alias)
#else
err = (*fpe_functions[fpe->type].list_next_font_or_alias) err = (*fpe_functions[fpe->type].list_next_font_or_alias)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, &name, &namelen, &tmpname, ((void *) c->client, fpe, &name, &namelen, &tmpname,
&resolvedlen, c->current.private); &resolvedlen, c->current.private);
if (err == Suspended) { if (err == Suspended) {
...@@ -1170,7 +1258,11 @@ nxdoListFontsAndAliases(client, fss) ...@@ -1170,7 +1258,11 @@ nxdoListFontsAndAliases(client, fss)
int tmpnamelen; int tmpnamelen;
tmpname = 0; tmpname = 0;
#ifdef HAS_XFONT2
(void) (*fpe_functions[fpe->type]->list_next_font_or_alias)
#else
(void) (*fpe_functions[fpe->type].list_next_font_or_alias) (void) (*fpe_functions[fpe->type].list_next_font_or_alias)
#endif /* HAS_XFONT2 */
((void *) c->client, fpe, &tmpname, &tmpnamelen, ((void *) c->client, fpe, &tmpname, &tmpnamelen,
&tmpname, &tmpnamelen, c->current.private); &tmpname, &tmpnamelen, c->current.private);
if (--aliascount <= 0) if (--aliascount <= 0)
...@@ -1281,7 +1373,11 @@ finish: ...@@ -1281,7 +1373,11 @@ finish:
FreeFPE(c->fpe_list[i]); FreeFPE(c->fpe_list[i]);
free(c->fpe_list); free(c->fpe_list);
if (c->savedName) free(c->savedName); if (c->savedName) free(c->savedName);
#ifdef HAS_XFONT2
xfont2_free_font_names(c->names);
#else
FreeFontNames(c->names); FreeFontNames(c->names);
#endif /* HAS_XFONT2 */
free(c); free(c);
free(fss); free(fss);
if (resolved) free(resolved); if (resolved) free(resolved);
...@@ -1333,7 +1429,11 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) ...@@ -1333,7 +1429,11 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
** having to create another instance of a font that already exists. ** having to create another instance of a font that already exists.
*/ */
#ifdef HAS_XFONT2
cached = xfont2_find_cached_font_pattern(patternCache, pfontname, lenfname);
#else
cached = FindCachedFontPattern(patternCache, pfontname, lenfname); cached = FindCachedFontPattern(patternCache, pfontname, lenfname);
#endif /* HAS_XFONT2 */
if (cached && cached->info.cachable) if (cached && cached->info.cachable)
{ {
if (!AddResource(fid, RT_FONT, (void *) cached)) if (!AddResource(fid, RT_FONT, (void *) cached))
...@@ -1357,7 +1457,11 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) ...@@ -1357,7 +1457,11 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
free(fss); free(fss);
return BadAlloc; return BadAlloc;
} }
#ifdef HAS_XFONT2
c->names = xfont2_make_font_names_record(100);
#else
c->names = MakeFontNamesRecord(100); c->names = MakeFontNamesRecord(100);
#endif /* HAS_XFONT2 */
if (!c->names) if (!c->names)
{ {
free(c->fpe_list); free(c->fpe_list);
......
...@@ -29,11 +29,21 @@ SOFTWARE. ...@@ -29,11 +29,21 @@ SOFTWARE.
#include "closure.h" #include "closure.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#else
# include <X11/fonts/fontutil.h>
#endif /* HAS XFONT2 */
#define NullDIXFontProp ((DIXFontPropPtr)0) #define NullDIXFontProp ((DIXFontPropPtr)0)
typedef struct _DIXFontProp *DIXFontPropPtr; typedef struct _DIXFontProp *DIXFontPropPtr;
#ifdef HAS_XFONT2
xfont2_fpe_funcs_rec const **fpe_functions;
#else
extern FPEFunctions *fpe_functions; extern FPEFunctions *fpe_functions;
#endif /* HAS_XFONT2 */
extern int FontToXError(int /*err*/); extern int FontToXError(int /*err*/);
...@@ -124,15 +134,26 @@ extern void InitFonts(void); ...@@ -124,15 +134,26 @@ extern void InitFonts(void);
extern void FreeFonts(void); extern void FreeFonts(void);
#ifdef HAS_XFONT2
extern void GetGlyphs(FontPtr /*font */ ,
unsigned long /*count */ ,
unsigned char * /*chars */ ,
FontEncoding /*fontEncoding */ ,
unsigned long * /*glyphcount */ ,
CharInfoPtr * /*glyphs */ );
#else
extern FontPtr find_old_font(XID /*id*/); extern FontPtr find_old_font(XID /*id*/);
extern void GetGlyphs(FontPtr /*font*/, #define GetGlyphs dixGetGlyphs
extern void dixGetGlyphs(FontPtr /*font*/,
unsigned long /*count*/, unsigned long /*count*/,
unsigned char * /*chars*/, unsigned char * /*chars*/,
FontEncoding /*fontEncoding*/, FontEncoding /*fontEncoding*/,
unsigned long * /*glyphcount*/, unsigned long * /*glyphcount*/,
CharInfoPtr * /*glyphs*/); CharInfoPtr * /*glyphs*/);
extern void register_fpe_functions(void);
extern void QueryGlyphExtents(FontPtr /*pFont*/, extern void QueryGlyphExtents(FontPtr /*pFont*/,
CharInfoPtr * /*charinfo*/, CharInfoPtr * /*charinfo*/,
unsigned long /*count*/, unsigned long /*count*/,
...@@ -142,6 +163,7 @@ extern Bool QueryTextExtents(FontPtr /*pFont*/, ...@@ -142,6 +163,7 @@ extern Bool QueryTextExtents(FontPtr /*pFont*/,
unsigned long /*count*/, unsigned long /*count*/,
unsigned char * /*chars*/, unsigned char * /*chars*/,
ExtentInfoPtr /*info*/); ExtentInfoPtr /*info*/);
#endif /* HAS_XFONT2 */
extern Bool ParseGlyphCachingMode(char * /*str*/); extern Bool ParseGlyphCachingMode(char * /*str*/);
...@@ -149,6 +171,4 @@ extern void InitGlyphCaching(void); ...@@ -149,6 +171,4 @@ extern void InitGlyphCaching(void);
extern void SetGlyphCachingMode(int /*newmode*/); extern void SetGlyphCachingMode(int /*newmode*/);
extern void register_fpe_functions(void);
#endif /* DIXFONT_H */ #endif /* DIXFONT_H */
...@@ -27,6 +27,9 @@ SOFTWARE. ...@@ -27,6 +27,9 @@ SOFTWARE.
#include "servermd.h" #include "servermd.h"
#include "dixfont.h" #include "dixfont.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#endif /* HAS_XFONT2 */
#include "closure.h" #include "closure.h"
#include <nx-X11/Xproto.h> /* for xQueryFontReply */ #include <nx-X11/Xproto.h> /* for xQueryFontReply */
......
...@@ -179,6 +179,9 @@ NormalLibraryTarget(cbrt,cbrt.o) ...@@ -179,6 +179,9 @@ NormalLibraryTarget(cbrt,cbrt.o)
SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES)) SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES))
SpecialCObjectRule(miscrinit,$(ICONFIGFILES),$(EXT_DEFINES)) SpecialCObjectRule(miscrinit,$(ICONFIGFILES),$(EXT_DEFINES))
SpecialCObjectRule(miglblt,$(ICONFIGFILES),$(FONT_DEFINES))
SpecialCObjectRule(mipolytext,$(ICONFIGFILES),$(FONT_DEFINES))
#ifdef ItsyCompilerBug #ifdef ItsyCompilerBug
SpecialCObjectRule(mipolycon,$(_NOOP_),-O0) SpecialCObjectRule(mipolycon,$(_NOOP_),-O0)
#endif #endif
......
...@@ -55,6 +55,11 @@ SOFTWARE. ...@@ -55,6 +55,11 @@ SOFTWARE.
#include <nx-X11/Xproto.h> #include <nx-X11/Xproto.h>
#include "misc.h" #include "misc.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#else
# include <X11/fonts/fontutil.h>
#endif /* HAS_XFONT2 */
#include "dixfontstr.h" #include "dixfontstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "windowstr.h" #include "windowstr.h"
...@@ -203,13 +208,18 @@ miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) ...@@ -203,13 +208,18 @@ miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
CharInfoPtr *ppci; /* array of character info */ CharInfoPtr *ppci; /* array of character info */
void *pglyphBase; /* start of array of glyphs */ void *pglyphBase; /* start of array of glyphs */
{ {
ExtentInfoRec info; /* used by QueryGlyphExtents() */ ExtentInfoRec info; /* used by xfont2_query_glyph_extents (libXfont2)
resp. QueryGlyphExtents() (libXfont1) */
XID gcvals[3]; XID gcvals[3];
int oldAlu, oldFS; int oldAlu, oldFS;
unsigned long oldFG; unsigned long oldFG;
xRectangle backrect; xRectangle backrect;
#ifdef HAS_XFONT2
xfont2_query_glyph_extents(pGC->font, ppci, (unsigned long) nglyph, &info);
#else
QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info); QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
#endif /* HAS_XFONT2 */
if (info.overallWidth >= 0) if (info.overallWidth >= 0)
{ {
......
...@@ -22,6 +22,8 @@ NormalLibraryTarget(damage,$(OBJS)) ...@@ -22,6 +22,8 @@ NormalLibraryTarget(damage,$(OBJS))
LintLibraryTarget(damage,$(SRCS)) LintLibraryTarget(damage,$(SRCS))
NormalLintTarget($(SRCS)) NormalLintTarget($(SRCS))
SpecialCObjectRule(damage,$(ICONFIGFILES),$(FONT_DEFINES))
#endif #endif
DependTarget() DependTarget()
......
...@@ -34,6 +34,11 @@ ...@@ -34,6 +34,11 @@
#include <X11/fonts/font.h> #include <X11/fonts/font.h>
#include "dixfontstr.h" #include "dixfontstr.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#else
# include <X11/fonts/fontutil.h>
#endif /* HAS_XFONT2 */
#include "mi.h" #include "mi.h"
#include "regionstr.h" #include "regionstr.h"
#include "globals.h" #include "globals.h"
...@@ -1297,7 +1302,11 @@ damageDamageChars (DrawablePtr pDrawable, ...@@ -1297,7 +1302,11 @@ damageDamageChars (DrawablePtr pDrawable,
ExtentInfoRec extents; ExtentInfoRec extents;
BoxRec box; BoxRec box;
#ifdef HAS_XFONT2
xfont2_query_glyph_extents(font, charinfo, n, &extents);
#else
QueryGlyphExtents(font, charinfo, n, &extents); QueryGlyphExtents(font, charinfo, n, &extents);
#endif /* HAS_XFONT2 */
if (imageblt) if (imageblt)
{ {
if (extents.overallWidth > extents.overallRight) if (extents.overallWidth > extents.overallRight)
......
...@@ -248,7 +248,7 @@ SpecialCObjectRule(connection,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES)) ...@@ -248,7 +248,7 @@ SpecialCObjectRule(connection,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES))
SpecialCObjectRule(osinit,$(ICONFIGFILES),$(ADM_DEFINES)) SpecialCObjectRule(osinit,$(ICONFIGFILES),$(ADM_DEFINES))
SpecialCObjectRule(WaitFor,$(ICONFIGFILES),$(EXT_DEFINES)) SpecialCObjectRule(WaitFor,$(ICONFIGFILES),$(EXT_DEFINES))
SpecialCObjectRule(io,$(ICONFIGFILES),$(EXT_DEFINES)) SpecialCObjectRule(io,$(ICONFIGFILES),$(EXT_DEFINES))
SpecialCObjectRule(utils,$(ICONFIGFILES),$(XDMCP_DEFINES) $(EXT_DEFINES) $(ERROR_DEFINES) $(PAM_DEFINES)) SpecialCObjectRule(utils,$(ICONFIGFILES),$(XDMCP_DEFINES) $(EXT_DEFINES) $(ERROR_DEFINES) $(PAM_DEFINES) $(FONT_DEFINES))
#if defined(SparcArchitecture) && HasGcc && !HasGcc2 #if defined(SparcArchitecture) && HasGcc && !HasGcc2
oscolor.o: oscolor.c $(ICONFIGFILES) oscolor.o: oscolor.c $(ICONFIGFILES)
$(RM) $@ $(RM) $@
......
...@@ -96,6 +96,11 @@ OR PERFORMANCE OF THIS SOFTWARE. ...@@ -96,6 +96,11 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/Xtrans/Xtrans.h> #include <nx-X11/Xtrans/Xtrans.h>
#include "input.h" #include "input.h"
#include "dixfont.h" #include "dixfont.h"
#ifdef HAS_XFONT2
# include <X11/fonts/libxfont2.h>
#else
# include <X11/fonts/fontutil.h>
#endif /* HAS_XFONT2 */
#include "osdep.h" #include "osdep.h"
#ifdef X_POSIX_C_SOURCE #ifdef X_POSIX_C_SOURCE
#define _POSIX_C_SOURCE X_POSIX_C_SOURCE #define _POSIX_C_SOURCE X_POSIX_C_SOURCE
...@@ -797,7 +802,11 @@ ProcessCommandLine(int argc, char *argv[]) ...@@ -797,7 +802,11 @@ ProcessCommandLine(int argc, char *argv[])
#endif #endif
else if ( strcmp( argv[i], "-deferglyphs") == 0) else if ( strcmp( argv[i], "-deferglyphs") == 0)
{ {
#ifdef HAS_XFONT2
if(++i >= argc || !!xfont2_parse_glyph_caching_mode(argv[i]))
#else
if(++i >= argc || !ParseGlyphCachingMode(argv[i])) if(++i >= argc || !ParseGlyphCachingMode(argv[i]))
#endif /* HAS_XFONT2 */
UseMsg(); UseMsg();
} }
else if ( strcmp( argv[i], "-f") == 0) else if ( strcmp( argv[i], "-f") == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment