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: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Keith Packard 2015-09-01 18:50:55 -07:00 committed by Adam Jackson
parent 950ffb8d6f
commit 05a793f5b3
17 changed files with 231 additions and 212 deletions

View File

@ -437,7 +437,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
#ifdef HAS_SHM #ifdef HAS_SHM
if (pDesc && !badSysCall) { if (pDesc && !badSysCall) {
*(CARD32 *) (pCI + nCharInfos) = signature; *(CARD32 *) (pCI + nCharInfos) = signature;
if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) { if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) {
shmdealloc(pDesc); shmdealloc(pDesc);
return BadAlloc; return BadAlloc;
} }
@ -721,7 +721,7 @@ XFree86BigfontExtensionInit(void)
+ (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); */
FontShmdescIndex = AllocateFontPrivateIndex(); FontShmdescIndex = xfont2_allocate_font_private_index();
#if !defined(CSRG_BASED) && !defined(__CYGWIN__) #if !defined(CSRG_BASED) && !defined(__CYGWIN__)
pagesize = SHMLBA; pagesize = SHMLBA;

View File

@ -833,7 +833,7 @@ LIBEGL="egl"
LIBGBM="gbm >= 10.2.0" LIBGBM="gbm >= 10.2.0"
LIBGL="gl >= 7.1.0" LIBGL="gl >= 7.1.0"
LIBXEXT="xext >= 1.0.99.4" LIBXEXT="xext >= 1.0.99.4"
LIBXFONT="xfont >= 1.4.2" LIBXFONT="xfont2 >= 2.0.0"
LIBXI="xi >= 1.2.99.1" LIBXI="xi >= 1.2.99.1"
LIBXTST="xtst >= 1.0.99.2" LIBXTST="xtst >= 1.0.99.2"
LIBPCIACCESS="pciaccess >= 0.12.901" LIBPCIACCESS="pciaccess >= 0.12.901"

View File

@ -108,7 +108,7 @@ int ProcInitialConnection();
#include "windowstr.h" #include "windowstr.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontutil.h> #include <X11/fonts/libxfont2.h>
#include "dixfontstr.h" #include "dixfontstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "selection.h" #include "selection.h"
@ -1285,7 +1285,7 @@ ProcQueryTextExtents(ClientPtr client)
return BadLength; return BadLength;
length--; length--;
} }
if (!QueryTextExtents(pFont, length, (unsigned char *) &stuff[1], &info)) if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info))
return BadAlloc; return BadAlloc;
reply = (xQueryTextExtentsReply) { reply = (xQueryTextExtentsReply) {
.type = X_Reply, .type = X_Reply,

View File

@ -65,6 +65,7 @@ Equipment Corporation.
#include "closestr.h" #include "closestr.h"
#include "dixfont.h" #include "dixfont.h"
#include "xace.h" #include "xace.h"
#include <X11/fonts/libxfont2.h>
#ifdef XF86BIGFONT #ifdef XF86BIGFONT
#include "xf86bigfontsrv.h" #include "xf86bigfontsrv.h"
@ -75,7 +76,7 @@ extern FontPtr defaultFont;
static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0;
static int num_fpes = 0; static int num_fpes = 0;
static FPEFunctions *fpe_functions = (FPEFunctions *) 0; static xfont2_fpe_funcs_rec const **fpe_functions;
static int num_fpe_types = 0; static int num_fpe_types = 0;
static unsigned char *font_path_string; static unsigned char *font_path_string;
@ -83,7 +84,7 @@ static unsigned char *font_path_string;
static int num_slept_fpes = 0; static int num_slept_fpes = 0;
static int size_slept_fpes = 0; static int size_slept_fpes = 0;
static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0;
static FontPatternCachePtr patternCache; static xfont2_pattern_cache_ptr patternCache;
static int static int
FontToXError(int err) FontToXError(int err)
@ -108,18 +109,18 @@ static int
LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size,
unsigned char *data) unsigned char *data)
{ {
if (fpe_functions[pfont->fpe->type].load_glyphs) if (fpe_functions[pfont->fpe->type]->load_glyphs)
return (*fpe_functions[pfont->fpe->type].load_glyphs) return (*fpe_functions[pfont->fpe->type]->load_glyphs)
(client, pfont, 0, nchars, item_size, data); (client, pfont, 0, nchars, item_size, data);
else else
return Successful; return Successful;
} }
void void
dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, GetGlyphs(FontPtr font, unsigned long count, unsigned char *chars,
FontEncoding fontEncoding, FontEncoding fontEncoding,
unsigned long *glyphcount, /* RETURN */ unsigned long *glyphcount, /* RETURN */
CharInfoPtr *glyphs) /* RETURN */ CharInfoPtr *glyphs) /* RETURN */
{ {
(*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs); (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs);
} }
@ -206,7 +207,7 @@ FontWakeup(void *data, int count, void *LastSelectMask)
/* wake up any fpe's that may be waiting for information */ /* wake up any fpe's that may be waiting for information */
for (i = 0; i < num_slept_fpes; i++) { for (i = 0; i < num_slept_fpes; i++) {
fpe = slept_fpes[i]; fpe = slept_fpes[i];
(void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); (void) (*fpe_functions[fpe->type]->wakeup_fpe) (fpe);
} }
} }
@ -222,7 +223,7 @@ FreeFPE(FontPathElementPtr fpe)
{ {
fpe->refcount--; fpe->refcount--;
if (fpe->refcount == 0) { if (fpe->refcount == 0) {
(*fpe_functions[fpe->type].free_fpe) (fpe); (*fpe_functions[fpe->type]->free_fpe) (fpe);
free((void *) fpe->name); free((void *) fpe->name);
free(fpe); free(fpe);
} }
@ -266,14 +267,14 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
if (client->clientGone) { if (client->clientGone) {
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];
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
} }
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];
err = (*fpe_functions[fpe->type].open_font) err = (*fpe_functions[fpe->type]->open_font)
((void *) client, fpe, c->flags, ((void *) client, fpe, c->flags,
c->fontname, c->fnamelen, FontFormat, c->fontname, c->fnamelen, FontFormat,
BitmapFormatMaskByte | BitmapFormatMaskByte |
@ -352,8 +353,8 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
goto bail; goto bail;
} }
if (patternCache && pfont != c->non_cachable_font) if (patternCache && pfont != c->non_cachable_font)
CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, xfont2_cache_font_pattern(patternCache, c->origFontName, c->origFontNameLen,
pfont); pfont);
bail: bail:
if (err != Successful && c->client != serverClient) { if (err != Successful && c->client != serverClient) {
SendErrorToClient(c->client, X_OpenFont, 0, SendErrorToClient(c->client, X_OpenFont, 0,
@ -398,7 +399,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname,
** having to create another instance of a font that already exists. ** having to create another instance of a font that already exists.
*/ */
cached = FindCachedFontPattern(patternCache, pfontname, lenfname); cached = xfont2_find_cached_font_pattern(patternCache, pfontname, lenfname);
if (cached && cached->info.cachable) { if (cached && cached->info.cachable) {
if (!AddResource(fid, RT_FONT, (void *) cached)) if (!AddResource(fid, RT_FONT, (void *) cached))
return BadAlloc; return BadAlloc;
@ -460,7 +461,7 @@ CloseFont(void *value, XID fid)
return Success; return Success;
if (--pfont->refcnt == 0) { if (--pfont->refcnt == 0) {
if (patternCache) if (patternCache)
RemoveCachedFontPattern(patternCache, pfont); xfont2_remove_cached_font_pattern(patternCache, pfont);
/* /*
* since the last reference is gone, ask each screen to free any * since the last reference is gone, ask each screen to free any
* storage it may have allocated locally for it. * storage it may have allocated locally for it.
@ -476,7 +477,7 @@ CloseFont(void *value, XID fid)
XF86BigfontFreeFontShm(pfont); XF86BigfontFreeFontShm(pfont);
#endif #endif
fpe = pfont->fpe; fpe = pfont->fpe;
(*fpe_functions[fpe->type].close_font) (fpe, pfont); (*fpe_functions[fpe->type]->close_font) (fpe, pfont);
FreeFPE(fpe); FreeFPE(fpe);
} }
return Success; return Success;
@ -567,7 +568,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
if (client->clientGone) { if (client->clientGone) {
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];
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
} }
err = Successful; err = Successful;
goto bail; goto bail;
@ -580,10 +581,10 @@ 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;
if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) { if (!fpe_functions[fpe->type]->start_list_fonts_and_aliases) {
/* This FPE doesn't support/require list_fonts_and_aliases */ /* This FPE doesn't support/require list_fonts_and_aliases */
err = (*fpe_functions[fpe->type].list_fonts) err = (*fpe_functions[fpe->type]->list_fonts)
((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);
@ -608,7 +609,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
the FPEs. */ the FPEs. */
if (!c->current.list_started) { if (!c->current.list_started) {
err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) err = (*fpe_functions[fpe->type]->start_list_fonts_and_aliases)
((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);
@ -626,7 +627,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
char *tmpname; char *tmpname;
name = 0; name = 0;
err = (*fpe_functions[fpe->type].list_next_font_or_alias) err = (*fpe_functions[fpe->type]->list_next_font_or_alias)
((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) {
@ -647,11 +648,11 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
if (err == Successful) { if (err == Successful) {
if (c->haveSaved) { if (c->haveSaved) {
if (c->savedName) if (c->savedName)
(void) AddFontNamesName(c->names, c->savedName, (void) xfont2_add_font_names_name(c->names, c->savedName,
c->savedNameLen); c->savedNameLen);
} }
else else
(void) AddFontNamesName(c->names, name, namelen); (void) xfont2_add_font_names_name(c->names, name, namelen);
} }
/* /*
@ -676,7 +677,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
int tmpnamelen; int tmpnamelen;
tmpname = 0; tmpname = 0;
(void) (*fpe_functions[fpe->type].list_next_font_or_alias) (void) (*fpe_functions[fpe->type]->list_next_font_or_alias)
((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) {
@ -782,7 +783,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
FreeFPE(c->fpe_list[i]); FreeFPE(c->fpe_list[i]);
free(c->fpe_list); free(c->fpe_list);
free(c->savedName); free(c->savedName);
FreeFontNames(names); xfont2_free_font_names(names);
free(c); free(c);
free(resolved); free(resolved);
return TRUE; return TRUE;
@ -815,7 +816,7 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
free(c); free(c);
return BadAlloc; return BadAlloc;
} }
c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); c->names = xfont2_make_font_names_record(max_names < 100 ? max_names : 100);
if (!c->names) { if (!c->names) {
free(c->fpe_list); free(c->fpe_list);
free(c); free(c);
@ -858,7 +859,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
if (client->clientGone) { if (client->clientGone) {
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];
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
} }
err = Successful; err = Successful;
goto bail; goto bail;
@ -870,7 +871,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
fpe = c->fpe_list[c->current.current_fpe]; fpe = c->fpe_list[c->current.current_fpe];
err = Successful; err = Successful;
if (!c->current.list_started) { if (!c->current.list_started) {
err = (*fpe_functions[fpe->type].start_list_fonts_with_info) err = (*fpe_functions[fpe->type]->start_list_fonts_with_info)
(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) {
@ -885,7 +886,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
if (err == Successful) { if (err == Successful) {
name = 0; name = 0;
pFontInfo = &fontInfo; pFontInfo = &fontInfo;
err = (*fpe_functions[fpe->type].list_next_font_with_info) err = (*fpe_functions[fpe->type]->list_next_font_with_info)
(client, fpe, &name, &namelen, &pFontInfo, (client, fpe, &name, &namelen, &pFontInfo,
&numFonts, c->current.private); &numFonts, c->current.private);
if (err == Suspended) { if (err == Suspended) {
@ -915,7 +916,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
tmpname = 0; tmpname = 0;
tmpFontInfo = &fontInfo; tmpFontInfo = &fontInfo;
(void) (*fpe_functions[fpe->type].list_next_font_with_info) (void) (*fpe_functions[fpe->type]->list_next_font_with_info)
(client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo,
&numFonts, c->current.private); &numFonts, c->current.private);
if (--aliascount <= 0) { if (--aliascount <= 0) {
@ -1102,7 +1103,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
if (client->clientGone) { if (client->clientGone) {
fpe = c->pGC->font->fpe; fpe = c->pGC->font->fpe;
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
if (ClientIsAsleep(client)) { if (ClientIsAsleep(client)) {
/* Client has died, but we cannot bail out right now. We /* Client has died, but we cannot bail out right now. We
@ -1128,7 +1129,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
the FPE code to clean up after client and avoid further the FPE code to clean up after client and avoid further
rendering while we clean up after ourself. */ rendering while we clean up after ourself. */
fpe = c->pGC->font->fpe; fpe = c->pGC->font->fpe;
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
c->pDraw = (DrawablePtr) 0; c->pDraw = (DrawablePtr) 0;
} }
} }
@ -1380,7 +1381,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
if (client->clientGone) { if (client->clientGone) {
fpe = c->pGC->font->fpe; fpe = c->pGC->font->fpe;
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
err = Success; err = Success;
goto bail; goto bail;
} }
@ -1394,7 +1395,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
/* Our drawable has disappeared. Treat like client died... ask /* Our drawable has disappeared. Treat like client died... ask
the FPE code to clean up after client. */ the FPE code to clean up after client. */
fpe = c->pGC->font->fpe; fpe = c->pGC->font->fpe;
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
err = Success; err = Success;
goto bail; goto bail;
} }
@ -1520,7 +1521,7 @@ DetermineFPEType(const char *pathname)
int i; int i;
for (i = 0; i < num_fpe_types; i++) { for (i = 0; i < num_fpe_types; i++) {
if ((*fpe_functions[i].name_check) (pathname)) if ((*fpe_functions[i]->name_check) (pathname))
return i; return i;
} }
return -1; return -1;
@ -1581,8 +1582,8 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
return BadAlloc; return BadAlloc;
} }
for (i = 0; i < num_fpe_types; i++) { for (i = 0; i < num_fpe_types; i++) {
if (fpe_functions[i].set_path_hook) if (fpe_functions[i]->set_path_hook)
(*fpe_functions[i].set_path_hook) (); (*fpe_functions[i]->set_path_hook) ();
} }
for (i = 0; i < npaths; i++) { for (i = 0; i < npaths; i++) {
len = (unsigned int) (*cp++); len = (unsigned int) (*cp++);
@ -1601,7 +1602,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
*/ */
fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len);
if (fpe) { if (fpe) {
err = (*fpe_functions[fpe->type].reset_fpe) (fpe); err = (*fpe_functions[fpe->type]->reset_fpe) (fpe);
if (err == Successful) { if (err == Successful) {
UseFPE(fpe); /* since it'll be decref'd later when freed UseFPE(fpe); /* since it'll be decref'd later when freed
* from the old list */ * from the old list */
@ -1633,7 +1634,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
if (fpe->type == -1) if (fpe->type == -1)
err = BadValue; err = BadValue;
else else
err = (*fpe_functions[fpe->type].init_fpe) (fpe); err = (*fpe_functions[fpe->type]->init_fpe) (fpe);
if (err != Successful) { if (err != Successful) {
if (persist) { if (persist) {
DebugF DebugF
@ -1658,7 +1659,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
FreeFontPath(font_path_elements, num_fpes, FALSE); FreeFontPath(font_path_elements, num_fpes, FALSE);
font_path_elements = fplist; font_path_elements = fplist;
if (patternCache) if (patternCache)
EmptyFontPatternCache(patternCache); xfont2_empty_font_pattern_cache(patternCache);
num_fpes = valid_paths; num_fpes = valid_paths;
return Success; return Success;
@ -1799,31 +1800,47 @@ DeleteClientFontStuff(ClientPtr client)
for (i = 0; i < num_fpes; i++) { for (i = 0; i < num_fpes; i++) {
fpe = font_path_elements[i]; fpe = font_path_elements[i];
if (fpe_functions[fpe->type].client_died) if (fpe_functions[fpe->type]->client_died)
(*fpe_functions[fpe->type].client_died) ((void *) client, fpe); (*fpe_functions[fpe->type]->client_died) ((void *) client, fpe);
} }
} }
void static int
InitFonts(void) register_fpe_funcs(const xfont2_fpe_funcs_rec *funcs)
{ {
patternCache = MakeFontPatternCache(); xfont2_fpe_funcs_rec const **new;
ResetFontPrivateIndex(); /* grow the list */
new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(xfont2_fpe_funcs_ptr));
if (!new)
return -1;
fpe_functions = new;
register_fpe_functions(); fpe_functions[num_fpe_types] = funcs;
return num_fpe_types++;
} }
_X_EXPORT static unsigned long
int get_server_generation(void)
GetDefaultPointSize(void) {
return serverGeneration;
}
static void *
get_server_client(void)
{
return serverClient;
}
static int
get_default_point_size(void)
{ {
return 120; return 120;
} }
_X_EXPORT static FontResolutionPtr
FontResolutionPtr get_client_resolutions(int *num)
GetClientResolutions(int *num)
{ {
static struct _FontResolution res; static struct _FontResolution res;
ScreenPtr pScreen; ScreenPtr pScreen;
@ -1848,62 +1865,11 @@ GetClientResolutions(int *num)
return &res; return &res;
} }
/*
* returns the type index of the new fpe
*
* should be called (only once!) by each type of fpe when initialized
*/
_X_EXPORT
int
RegisterFPEFunctions(NameCheckFunc name_func,
InitFpeFunc init_func,
FreeFpeFunc free_func,
ResetFpeFunc reset_func,
OpenFontFunc open_func,
CloseFontFunc close_func,
ListFontsFunc list_func,
StartLfwiFunc start_lfwi_func,
NextLfwiFunc next_lfwi_func,
WakeupFpeFunc wakeup_func,
ClientDiedFunc client_died,
LoadGlyphsFunc load_glyphs,
StartLaFunc start_list_alias_func,
NextLaFunc next_list_alias_func, SetPathFunc set_path_func)
{
FPEFunctions *new;
/* grow the list */
new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(FPEFunctions));
if (!new)
return -1;
fpe_functions = new;
fpe_functions[num_fpe_types].name_check = name_func;
fpe_functions[num_fpe_types].open_font = open_func;
fpe_functions[num_fpe_types].close_font = close_func;
fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func;
fpe_functions[num_fpe_types].list_fonts = list_func;
fpe_functions[num_fpe_types].start_list_fonts_with_info = start_lfwi_func;
fpe_functions[num_fpe_types].list_next_font_with_info = next_lfwi_func;
fpe_functions[num_fpe_types].init_fpe = init_func;
fpe_functions[num_fpe_types].free_fpe = free_func;
fpe_functions[num_fpe_types].reset_fpe = reset_func;
fpe_functions[num_fpe_types].client_died = client_died;
fpe_functions[num_fpe_types].load_glyphs = load_glyphs;
fpe_functions[num_fpe_types].start_list_fonts_and_aliases =
start_list_alias_func;
fpe_functions[num_fpe_types].list_next_font_or_alias = next_list_alias_func;
fpe_functions[num_fpe_types].set_path_hook = set_path_func;
return num_fpe_types++;
}
void void
FreeFonts(void) FreeFonts(void)
{ {
if (patternCache) { if (patternCache) {
FreeFontPatternCache(patternCache); xfont2_free_font_pattern_cache(patternCache);
patternCache = 0; patternCache = 0;
} }
FreeFontPath(font_path_elements, num_fpes, TRUE); FreeFontPath(font_path_elements, num_fpes, TRUE);
@ -1911,12 +1877,12 @@ FreeFonts(void)
num_fpes = 0; num_fpes = 0;
free(fpe_functions); free(fpe_functions);
num_fpe_types = 0; num_fpe_types = 0;
fpe_functions = (FPEFunctions *) 0; fpe_functions = NULL;
} }
/* convenience functions for FS interface */ /* convenience functions for FS interface */
FontPtr static FontPtr
find_old_font(XID id) find_old_font(XID id)
{ {
void *pFont; void *pFont;
@ -1925,30 +1891,26 @@ find_old_font(XID id)
return (FontPtr) pFont; return (FontPtr) pFont;
} }
_X_EXPORT static Font
Font get_new_font_client_id(void)
GetNewFontClientID(void)
{ {
return FakeClientID(0); return FakeClientID(0);
} }
_X_EXPORT static int
int store_font_Client_font(FontPtr pfont, Font id)
StoreFontClientFont(FontPtr pfont, Font id)
{ {
return AddResource(id, RT_NONE, (void *) pfont); return AddResource(id, RT_NONE, (void *) pfont);
} }
_X_EXPORT static void
void delete_font_client_id(Font id)
DeleteFontClientID(Font id)
{ {
FreeResource(id, RT_NONE); FreeResource(id, RT_NONE);
} }
_X_EXPORT static int
int _client_auth_generation(ClientPtr client)
client_auth_generation(ClientPtr client)
{ {
return 0; return 0;
} }
@ -1956,9 +1918,73 @@ client_auth_generation(ClientPtr client)
static int fs_handlers_installed = 0; static int fs_handlers_installed = 0;
static unsigned int last_server_gen; static unsigned int last_server_gen;
_X_EXPORT static void
int fs_block_handler(void *blockData, OSTimePtr timeout, void *readmask)
init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) {
FontBlockHandlerProcPtr block_handler = blockData;
(*block_handler)(timeout);
}
struct fs_fd_entry {
struct xorg_list entry;
int fd;
void *data;
FontFdHandlerProcPtr handler;
};
static void
fs_fd_handler(int fd, int ready, void *data)
{
struct fs_fd_entry *entry = data;
entry->handler(fd, entry->data);
}
static struct xorg_list fs_fd_list;
static int
add_fs_fd(int fd, FontFdHandlerProcPtr handler, void *data)
{
struct fs_fd_entry *entry = calloc(1, sizeof (struct fs_fd_entry));
if (!entry)
return FALSE;
entry->fd = fd;
entry->data = data;
entry->handler = handler;
if (!SetNotifyFd(fd, fs_fd_handler, X_NOTIFY_READ, entry)) {
free(entry);
return FALSE;
}
xorg_list_add(&entry->entry, &fs_fd_list);
return TRUE;
}
static void
remove_fs_fd(int fd)
{
struct fs_fd_entry *entry, *temp;
xorg_list_for_each_entry_safe(entry, temp, &fs_fd_list, entry) {
if (entry->fd == fd) {
xorg_list_del(&entry->entry);
free(entry);
break;
}
}
RemoveNotifyFd(fd);
}
static void
adjust_fs_wait_for_delay(void *wt, unsigned long newdelay)
{
AdjustWaitForDelay(wt, newdelay);
}
static int
_init_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler)
{ {
/* if server has reset, make sure the b&w handlers are reinstalled */ /* if server has reset, make sure the b&w handlers are reinstalled */
if (last_server_gen < serverGeneration) { if (last_server_gen < serverGeneration) {
@ -1966,26 +1992,63 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler)
fs_handlers_installed = 0; fs_handlers_installed = 0;
} }
if (fs_handlers_installed == 0) { if (fs_handlers_installed == 0) {
if (!RegisterBlockAndWakeupHandlers(block_handler, if (!RegisterBlockAndWakeupHandlers(fs_block_handler,
FontWakeup, (void *) 0)) FontWakeup, (void *) block_handler))
return AllocError; return AllocError;
xorg_list_init(&fs_fd_list);
fs_handlers_installed++; fs_handlers_installed++;
} }
QueueFontWakeup(fpe); QueueFontWakeup(fpe);
return Successful; return Successful;
} }
_X_EXPORT static void
void _remove_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler,
remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler,
Bool all) Bool all)
{ {
if (all) { if (all) {
/* remove the handlers if no one else is using them */ /* remove the handlers if no one else is using them */
if (--fs_handlers_installed == 0) { if (--fs_handlers_installed == 0) {
RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, RemoveBlockAndWakeupHandlers(fs_block_handler, FontWakeup,
(void *) 0); (void *) block_handler);
} }
} }
RemoveFontWakeup(fpe); RemoveFontWakeup(fpe);
} }
static const xfont2_client_funcs_rec xfont2_client_funcs = {
.version = XFONT2_CLIENT_FUNCS_VERSION,
.client_auth_generation = _client_auth_generation,
.client_signal = ClientSignal,
.delete_font_client_id = delete_font_client_id,
.verrorf = VErrorF,
.find_old_font = find_old_font,
.get_client_resolutions = get_client_resolutions,
.get_default_point_size = get_default_point_size,
.get_new_font_client_id = get_new_font_client_id,
.get_time_in_millis = GetTimeInMillis,
.init_fs_handlers = _init_fs_handlers,
.register_fpe_funcs = register_fpe_funcs,
.remove_fs_handlers = _remove_fs_handlers,
.get_server_client = get_server_client,
.set_font_authorizations = set_font_authorizations,
.store_font_client_font = store_font_Client_font,
.make_atom = MakeAtom,
.valid_atom = ValidAtom,
.name_for_atom = NameForAtom,
.get_server_generation = get_server_generation,
.add_fs_fd = add_fs_fd,
.remove_fs_fd = remove_fs_fd,
.adjust_fs_wait_for_delay = adjust_fs_wait_for_delay,
};
xfont2_pattern_cache_ptr fontPatternCache;
void
InitFonts(void)
{
if (fontPatternCache)
xfont2_free_font_pattern_cache(fontPatternCache);
fontPatternCache = xfont2_make_font_pattern_cache();
xfont2_init(&xfont2_client_funcs);
}

View File

@ -96,7 +96,7 @@ Equipment Corporation.
#include "selection.h" #include "selection.h"
#include <X11/fonts/font.h> #include <X11/fonts/font.h>
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontutil.h> #include <X11/fonts/libxfont2.h>
#include "opaque.h" #include "opaque.h"
#include "servermd.h" #include "servermd.h"
#include "hotplug.h" #include "hotplug.h"
@ -196,7 +196,7 @@ dix_main(int argc, char *argv[], char *envp[])
InitAtoms(); InitAtoms();
InitEvents(); InitEvents();
InitGlyphCaching(); xfont2_init_glyph_caching();
dixResetRegistry(); dixResetRegistry();
InitFonts(); InitFonts();
InitCallbackManager(); InitCallbackManager();

View File

@ -55,7 +55,7 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
privates = calloc(glamor_font_screen_count, sizeof (glamor_font_t)); privates = calloc(glamor_font_screen_count, sizeof (glamor_font_t));
if (!privates) if (!privates)
return NULL; return NULL;
FontSetPrivate(font, glamor_font_private_index, privates); xfont2_font_set_private(font, glamor_font_private_index, privates);
} }
glamor_font = &privates[screen->myNum]; glamor_font = &privates[screen->myNum];
@ -201,7 +201,7 @@ glamor_unrealize_font(ScreenPtr screen, FontPtr font)
return TRUE; return TRUE;
free(privates); free(privates);
FontSetPrivate(font, glamor_font_private_index, NULL); xfont2_font_set_private(font, glamor_font_private_index, NULL);
return TRUE; return TRUE;
} }
@ -214,7 +214,7 @@ glamor_font_init(ScreenPtr screen)
return TRUE; return TRUE;
if (glamor_font_generation != serverGeneration) { if (glamor_font_generation != serverGeneration) {
glamor_font_private_index = AllocateFontPrivateIndex(); glamor_font_private_index = xfont2_allocate_font_private_index();
if (glamor_font_private_index == -1) if (glamor_font_private_index == -1)
return FALSE; return FALSE;
glamor_font_screen_count = 0; glamor_font_screen_count = 0;

View File

@ -46,6 +46,7 @@
#include "dmxlog.h" #include "dmxlog.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include <X11/fonts/libxfont2.h>
#include "dixfont.h" #include "dixfont.h"
#include "dixstruct.h" #include "dixstruct.h"
@ -447,7 +448,7 @@ dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont)
dmxFontPrivPtr pFontPriv; dmxFontPrivPtr pFontPriv;
if (!(pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) { if (!(pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) {
FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL);
pFontPriv = malloc(sizeof(dmxFontPrivRec)); pFontPriv = malloc(sizeof(dmxFontPrivRec));
if (!pFontPriv) if (!pFontPriv)
return FALSE; return FALSE;
@ -460,7 +461,7 @@ dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont)
pFontPriv->refcnt = 0; pFontPriv->refcnt = 0;
} }
FontSetPrivate(pFont, dmxFontPrivateIndex, (void *) pFontPriv); xfont2_font_set_private(pFont, dmxFontPrivateIndex, (void *) pFontPriv);
if (dmxScreen->beDisplay) { if (dmxScreen->beDisplay) {
if (!dmxBELoadFont(pScreen, pFont)) if (!dmxBELoadFont(pScreen, pFont))
@ -504,7 +505,7 @@ dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (!pFontPriv->refcnt) { if (!pFontPriv->refcnt) {
MAXSCREENSFREE(pFontPriv->font); MAXSCREENSFREE(pFontPriv->font);
free(pFontPriv); free(pFontPriv);
FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL);
} }
else if (pFontPriv->font[pScreen->myNum]) { else if (pFontPriv->font[pScreen->myNum]) {
if (dmxScreen->beDisplay) if (dmxScreen->beDisplay)
@ -563,7 +564,7 @@ dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
) { ) {
MAXSCREENSFREE(pFontPriv->font); MAXSCREENSFREE(pFontPriv->font);
free(pFontPriv); free(pFontPriv);
FontSetPrivate(pFont, dmxFontPrivateIndex, NULL); xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL);
} }
} }
} }

View File

@ -58,6 +58,8 @@
#include "mipointer.h" #include "mipointer.h"
#include "micmap.h" #include "micmap.h"
#include <X11/fonts/libxfont2.h>
extern Bool dmxCloseScreen(ScreenPtr pScreen); extern Bool dmxCloseScreen(ScreenPtr pScreen);
static Bool dmxSaveScreen(ScreenPtr pScreen, int what); static Bool dmxSaveScreen(ScreenPtr pScreen, int what);
@ -187,7 +189,7 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
if (dmxGeneration != serverGeneration) { if (dmxGeneration != serverGeneration) {
/* Allocate font private index */ /* Allocate font private index */
dmxFontPrivateIndex = AllocateFontPrivateIndex(); dmxFontPrivateIndex = xfont2_allocate_font_private_index();
if (dmxFontPrivateIndex == -1) if (dmxFontPrivateIndex == -1)
return FALSE; return FALSE;

View File

@ -251,7 +251,6 @@ cat > sdksyms.c << EOF
#define _FONTPROTO_H #define _FONTPROTO_H
#include "dixfont.h" #include "dixfont.h"
#include "dixfontstr.h" #include "dixfontstr.h"
#include "dixfontstubs.h"
#include "dixgrabs.h" #include "dixgrabs.h"
#include "dixstruct.h" #include "dixstruct.h"
#include "exevents.h" #include "exevents.h"

View File

@ -23,6 +23,7 @@ is" without express or implied warranty.
#include "regionstr.h" #include "regionstr.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 "scrnintstr.h" #include "scrnintstr.h"
#include "Xnest.h" #include "Xnest.h"
@ -42,7 +43,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
int i; int i;
const char *name; const char *name;
FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL);
name_atom = MakeAtom("FONT", 4, True); name_atom = MakeAtom("FONT", 4, True);
value_atom = 0L; value_atom = 0L;
@ -65,7 +66,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
return False; return False;
priv = (void *) malloc(sizeof(xnestPrivFont)); priv = (void *) malloc(sizeof(xnestPrivFont));
FontSetPrivate(pFont, xnestFontPrivateIndex, priv); xfont2_font_set_private(pFont, xnestFontPrivateIndex, priv);
xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name); xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name);
@ -82,7 +83,7 @@ xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (xnestFontStruct(pFont)) if (xnestFontStruct(pFont))
XFreeFont(xnestDisplay, xnestFontStruct(pFont)); XFreeFont(xnestDisplay, xnestFontStruct(pFont));
free(xnestFontPriv(pFont)); free(xnestFontPriv(pFont));
FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL);
} }
return True; return True;
} }

View File

@ -26,6 +26,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 "Xnest.h" #include "Xnest.h"
@ -72,7 +73,7 @@ InitOutput(ScreenInfo * screen_info, int argc, char *argv[])
break; break;
} }
xnestFontPrivateIndex = AllocateFontPrivateIndex(); xnestFontPrivateIndex = xfont2_allocate_font_private_index();
if (!xnestNumScreens) if (!xnestNumScreens)
xnestNumScreens = 1; xnestNumScreens = 1;

View File

@ -29,7 +29,6 @@ SOFTWARE.
#include "closure.h" #include "closure.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontproto.h> #include <X11/fonts/fontproto.h>
#include <X11/fonts/fontutil.h>
#define NullDIXFontProp ((DIXFontPropPtr)0) #define NullDIXFontProp ((DIXFontPropPtr)0)
@ -98,16 +97,11 @@ extern _X_EXPORT void InitFonts(void);
extern _X_EXPORT void FreeFonts(void); extern _X_EXPORT void FreeFonts(void);
extern _X_EXPORT FontPtr find_old_font(XID /*id */ ); extern _X_EXPORT void GetGlyphs(FontPtr /*font */ ,
unsigned long /*count */ ,
#define GetGlyphs dixGetGlyphs unsigned char * /*chars */ ,
extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ , FontEncoding /*fontEncoding */ ,
unsigned long /*count */ , unsigned long * /*glyphcount */ ,
unsigned char * /*chars */ , CharInfoPtr * /*glyphs */ );
FontEncoding /*fontEncoding */ ,
unsigned long * /*glyphcount */ ,
CharInfoPtr * /*glyphs */ );
extern _X_EXPORT void register_fpe_functions(void);
#endif /* DIXFONT_H */ #endif /* DIXFONT_H */

View File

@ -27,6 +27,7 @@ SOFTWARE.
#include "servermd.h" #include "servermd.h"
#include "dixfont.h" #include "dixfont.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include <X11/fonts/libxfont2.h>
#include "closure.h" #include "closure.h"
#include <X11/Xproto.h> /* for xQueryFontReply */ #include <X11/Xproto.h> /* for xQueryFontReply */

View File

@ -1,43 +0,0 @@
#ifndef DIXFONTSTUBS_H
#define DIXFONTSTUBS_H 1
/*
* libXfont stubs replacements
* This header exists solely for the purpose of sdksyms generation;
* source code should #include "dixfonts.h" instead, which pulls in these
* declarations from <X11/fonts/fontproto.h>
*/
extern _X_EXPORT int client_auth_generation(ClientPtr client);
extern _X_EXPORT void DeleteFontClientID(Font id);
extern _X_EXPORT int GetDefaultPointSize(void);
extern _X_EXPORT Font GetNewFontClientID(void);
extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe,
BlockHandlerProcPtr block_handler);
extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func,
InitFpeFunc init_func,
FreeFpeFunc free_func,
ResetFpeFunc reset_func,
OpenFontFunc open_func,
CloseFontFunc close_func,
ListFontsFunc list_func,
StartLfwiFunc start_lfwi_func,
NextLfwiFunc next_lfwi_func,
WakeupFpeFunc wakeup_func,
ClientDiedFunc client_died,
LoadGlyphsFunc load_glyphs,
StartLaFunc start_list_alias_func,
NextLaFunc next_list_alias_func,
SetPathFunc set_path_func);
extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe,
BlockHandlerProcPtr blockHandler,
Bool all);
extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id);
#endif

View File

@ -53,7 +53,7 @@ SOFTWARE.
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include "misc.h" #include "misc.h"
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontutil.h> #include <X11/fonts/libxfont2.h>
#include "dixfontstr.h" #include "dixfontstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "windowstr.h" #include "windowstr.h"
@ -186,13 +186,13 @@ miImageGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int ngly
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() */
ChangeGCVal gcvals[3]; ChangeGCVal gcvals[3];
int oldAlu, oldFS; int oldAlu, oldFS;
unsigned long oldFG; unsigned long oldFG;
xRectangle backrect; xRectangle backrect;
QueryGlyphExtents(pGC->font, ppci, (unsigned long) nglyph, &info); xfont2_query_glyph_extents(pGC->font, ppci, (unsigned long) nglyph, &info);
if (info.overallWidth >= 0) { if (info.overallWidth >= 0) {
backrect.x = x; backrect.x = x;

View File

@ -32,7 +32,7 @@
#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>
#include <X11/fonts/fontutil.h> #include <X11/fonts/libxfont2.h>
#include "mi.h" #include "mi.h"
#include "regionstr.h" #include "regionstr.h"
#include "globals.h" #include "globals.h"
@ -1249,7 +1249,7 @@ damageDamageChars(DrawablePtr pDrawable,
ExtentInfoRec extents; ExtentInfoRec extents;
BoxRec box; BoxRec box;
QueryGlyphExtents(font, charinfo, n, &extents); xfont2_query_glyph_extents(font, charinfo, n, &extents);
if (imageblt) { if (imageblt) {
if (extents.overallWidth > extents.overallRight) if (extents.overallWidth > extents.overallRight)
extents.overallRight = extents.overallWidth; extents.overallRight = extents.overallWidth;

View File

@ -80,7 +80,7 @@ __stdcall unsigned long GetTickCount(void);
#include <X11/Xtrans/Xtrans.h> #include <X11/Xtrans/Xtrans.h>
#include "input.h" #include "input.h"
#include "dixfont.h" #include "dixfont.h"
#include <X11/fonts/fontutil.h> #include <X11/fonts/libxfont2.h>
#include "osdep.h" #include "osdep.h"
#include "extension.h" #include "extension.h"
#ifdef X_POSIX_C_SOURCE #ifdef X_POSIX_C_SOURCE
@ -798,7 +798,7 @@ ProcessCommandLine(int argc, char *argv[])
DPMSDisabledSwitch = TRUE; DPMSDisabledSwitch = TRUE;
#endif #endif
else if (strcmp(argv[i], "-deferglyphs") == 0) { else if (strcmp(argv[i], "-deferglyphs") == 0) {
if (++i >= argc || !ParseGlyphCachingMode(argv[i])) if (++i >= argc || !xfont2_parse_glyph_caching_mode(argv[i]))
UseMsg(); UseMsg();
} }
else if (strcmp(argv[i], "-f") == 0) { else if (strcmp(argv[i], "-f") == 0) {