Only index glyph names when necessary.
This commit is contained in:
parent
f899ef07a6
commit
7dd9ad72be
|
@ -664,6 +664,8 @@ static BOOL SortFontMetrics()
|
|||
|
||||
if (strcmp(afm->EncodingScheme, "FontSpecific") != 0)
|
||||
{
|
||||
PSDRV_IndexGlyphList(); /* enable searching by name index */
|
||||
|
||||
for (i = 0; i < afm->NumofMetrics; ++i)
|
||||
{
|
||||
UNICODEGLYPH ug, *pug;
|
||||
|
@ -1009,7 +1011,6 @@ no_afmfiles:
|
|||
|
||||
no_afmdirs:
|
||||
|
||||
PSDRV_IndexGlyphList(); /* So SortFontMetrics will work */
|
||||
if (SortFontMetrics() == FALSE)
|
||||
return FALSE;
|
||||
CalcWindowsMetrics();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -18,6 +18,7 @@ DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
|
||||
static GLYPHNAME **glyphList = NULL;
|
||||
static INT glyphListSize = 0;
|
||||
static BOOL glyphNamesIndexed = TRUE;
|
||||
|
||||
/*******************************************************************************
|
||||
* PSDRV_GlyphListInit
|
||||
|
@ -61,9 +62,6 @@ INT PSDRV_GlyphListInit()
|
|||
* Inserts a copy of the glyph name into the list at the index, growing the
|
||||
* list if necessary; returns index on success (-1 on failure)
|
||||
*
|
||||
* _glyphname is a version of GLYPHNAME with non-constant members, so it can
|
||||
* be initialized without generating compiler warnings
|
||||
*
|
||||
*/
|
||||
inline static INT GlyphListInsert(LPCSTR szName, INT index)
|
||||
{
|
||||
|
@ -109,6 +107,7 @@ inline static INT GlyphListInsert(LPCSTR szName, INT index)
|
|||
|
||||
glyphList[index] = g;
|
||||
++glyphListSize;
|
||||
glyphNamesIndexed = FALSE;
|
||||
|
||||
TRACE("Added '%s' at glyphList[%i] (glyphListSize now %i)\n",
|
||||
glyphList[index]->sz, index, glyphListSize);
|
||||
|
@ -181,6 +180,9 @@ VOID PSDRV_IndexGlyphList()
|
|||
{
|
||||
INT i;
|
||||
|
||||
if (glyphNamesIndexed == TRUE)
|
||||
return;
|
||||
|
||||
TRACE("%i glyph names:\n", glyphListSize);
|
||||
|
||||
for (i = 0; i < glyphListSize; ++i)
|
||||
|
@ -188,4 +190,6 @@ VOID PSDRV_IndexGlyphList()
|
|||
glyphList[i]->index = i;
|
||||
TRACE(" glyphList[%i] -> '%s'\n", i, glyphList[i]->sz);
|
||||
}
|
||||
|
||||
glyphNamesIndexed = TRUE;
|
||||
}
|
||||
|
|
|
@ -333,7 +333,7 @@ static void write_header(FILE *f)
|
|||
|
||||
static void write_glyph_names(FILE *f_c, FILE *f_h)
|
||||
{
|
||||
int i, num_names = 0, index = 0, list_index = 0x00010000;
|
||||
int i, num_names = 0, index = 0;
|
||||
|
||||
for (i = 0; i < num_glyphs; ++i)
|
||||
if (i == 0 || strcmp(glyphs[i - 1].name, glyphs[i].name) != 0)
|
||||
|
@ -357,17 +357,16 @@ static void write_glyph_names(FILE *f_c, FILE *f_h)
|
|||
fcpto(f_h, 32, fprintf(f_h, "#define GN_%s", glyphs[i].name));
|
||||
fprintf(f_h, "(PSDRV_AGLGlyphNames + %i)\n", index);
|
||||
|
||||
cp = fprintf(f_c, " { -1, \"%s\" },", glyphs[i].name);
|
||||
cp = fprintf(f_c, " { %4i, \"%s\" },", index, glyphs[i].name);
|
||||
glyphs[i].index = index;
|
||||
++index;
|
||||
list_index += 0x00010000;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs[i].index = glyphs[i - 1].index;
|
||||
}
|
||||
|
||||
fcpto(f_c, 36, cp);
|
||||
fcpto(f_c, 40, cp);
|
||||
|
||||
fprintf(f_c, "/* %s */\n", glyphs[i].comment);
|
||||
}
|
||||
|
@ -376,7 +375,7 @@ static void write_glyph_names(FILE *f_c, FILE *f_h)
|
|||
fprintf(f_h, "(PSDRV_AGLGlyphNames + %i)\n", index);
|
||||
|
||||
glyphs[i].index = index;
|
||||
fcpto(f_c, 36, fprintf(f_c, " { -1, \"%s\" }", glyphs[i].name));
|
||||
fcpto(f_c, 40, fprintf(f_c, " { %4i, \"%s\" }", index, glyphs[i].name));
|
||||
fprintf(f_c, "/* %s */\n};\n", glyphs[i].comment);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue