diff options
author | Adam Jackson <ajax@redhat.com> | 2009-01-20 23:23:40 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2009-01-20 23:23:40 -0500 |
commit | f431b4eb4dc743ccdf94b1b2ed858cc21f63c091 (patch) | |
tree | f45d7a7cff109a85dcade997e2cbc3d1404a615a | |
parent | 903d39aeea73a973fb8b05ca1ac147c2cca146cb (diff) |
Allow case insensitive filename matching in fontfile.
Simplify the freetype renderer list to match.
-rw-r--r-- | src/FreeType/ftfuncs.c | 16 | ||||
-rw-r--r-- | src/fontfile/renderers.c | 8 |
2 files changed, 3 insertions, 21 deletions
diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c index 35d58d5..47ebac7 100644 --- a/src/FreeType/ftfuncs.c +++ b/src/FreeType/ftfuncs.c @@ -3898,40 +3898,24 @@ FreeTypeGetInfoScalable(FontPathElementPtr fpe, FontInfoPtr info, static FontRendererRec renderers[] = { {".ttf", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".TTF", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, {".ttc", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".TTC", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, {".otf", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".OTF", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, {".otc", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".OTC", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, {".pfa", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".PFA", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, {".pfb", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".PFB", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, }; static int num_renderers = sizeof(renderers) / sizeof(renderers[0]); static FontRendererRec alt_renderers[] = { {".bdf", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".BDF", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, {".pcf", 4, 0, FreeTypeOpenScalable, 0, FreeTypeGetInfoScalable, 0, CAPABILITIES}, - {".PCF", 4, 0, FreeTypeOpenScalable, 0, - FreeTypeGetInfoScalable, 0, CAPABILITIES}, }; static int num_alt_renderers = diff --git a/src/fontfile/renderers.c b/src/fontfile/renderers.c index bdbdab0..bf82c1c 100644 --- a/src/fontfile/renderers.c +++ b/src/fontfile/renderers.c @@ -1,5 +1,3 @@ -/* $Xorg: renderers.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - /* Copyright 1991, 1998 The Open Group @@ -67,8 +65,8 @@ FontFilePriorityRegisterRenderer (FontRendererPtr renderer, int priority) } for (i = 0; i < renderers.number; i++) { - if (!strcmp (renderers.renderers[i].renderer->fileSuffix, - renderer->fileSuffix)) { + if (!strcasecmp (renderers.renderers[i].renderer->fileSuffix, + renderer->fileSuffix)) { if(renderers.renderers[i].priority >= priority) { if(renderers.renderers[i].priority == priority) { if (rendererGeneration == 1) @@ -108,7 +106,7 @@ FontFileMatchRenderer (char *fileName) { r = renderers.renderers[i].renderer; if (fileLen >= r->fileSuffixLen && - !strcmp (fileName + fileLen - r->fileSuffixLen, r->fileSuffix)) + !strcasecmp (fileName + fileLen - r->fileSuffixLen, r->fileSuffix)) { return r; } |