wineps: Move the installed font list to a standard list.

oldstable
Huw Davies 2012-04-11 12:36:14 +01:00 committed by Alexandre Julliard
parent 4f819f8efc
commit 4ff9b7f11a
3 changed files with 18 additions and 24 deletions

View File

@ -773,7 +773,8 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
pi->Fonts = NULL;
for(font = pi->ppd->InstalledFonts; font; font = font->next) {
LIST_FOR_EACH_ENTRY( font, &pi->ppd->InstalledFonts, FONTNAME, entry )
{
afm = PSDRV_FindAFMinList(PSDRV_AFMFontList, font->Name);
if(!afm) {
TRACE( "Couldn't find AFM file for installed printer font '%s' - "

View File

@ -631,7 +631,9 @@ PPD *PSDRV_ParsePPD(char *fname)
}
ppd->ColorDevice = CD_NotSpecified;
list_init(&ppd->PageSizes);
list_init( &ppd->InstalledFonts );
list_init( &ppd->PageSizes );
/*
* The Windows PostScript drivers create the following "virtual bin" for
@ -678,23 +680,13 @@ PPD *PSDRV_ParsePPD(char *fname)
WARN("failed to parse DefaultResolution %s\n", debugstr_a(tuple.value));
}
else if(!strcmp("*Font", tuple.key)) {
FONTNAME *fn;
for(fn = ppd->InstalledFonts; fn && fn->next; fn = fn->next)
;
if(!fn) {
ppd->InstalledFonts = HeapAlloc(PSDRV_Heap,
HEAP_ZERO_MEMORY, sizeof(*fn));
fn = ppd->InstalledFonts;
} else {
fn->next = HeapAlloc(PSDRV_Heap,
HEAP_ZERO_MEMORY, sizeof(*fn));
fn = fn->next;
}
fn->Name = tuple.option;
tuple.option = NULL;
}
else if(!strcmp("*Font", tuple.key))
{
FONTNAME *fn = HeapAlloc( PSDRV_Heap, 0, sizeof(*fn) );
fn->Name = tuple.option;
tuple.option = NULL;
list_add_tail( &ppd->InstalledFonts, &fn->entry );
}
else if(!strcmp("*DefaultFont", tuple.key)) {
ppd->DefaultFont = tuple.value;
@ -985,8 +977,8 @@ PPD *PSDRV_ParsePPD(char *fname)
OPTION *option;
OPTIONENTRY *optionEntry;
for(fn = ppd->InstalledFonts; fn; fn = fn->next)
TRACE("'%s'\n", fn->Name);
LIST_FOR_EACH_ENTRY( fn, &ppd->InstalledFonts, FONTNAME, entry )
TRACE("'%s'\n", fn->Name);
LIST_FOR_EACH_ENTRY(page, &ppd->PageSizes, PAGESIZE, entry) {
TRACE("'%s' aka '%s' (%d) invoked by '%s'\n", page->Name,

View File

@ -118,9 +118,10 @@ typedef struct _tagFONTFAMILY {
extern FONTFAMILY *PSDRV_AFMFontList DECLSPEC_HIDDEN;
extern const AFM *const PSDRV_BuiltinAFMs[] DECLSPEC_HIDDEN; /* last element is NULL */
typedef struct _tagFONTNAME {
typedef struct
{
struct list entry;
char *Name;
struct _tagFONTNAME *next;
} FONTNAME;
typedef struct {
@ -213,7 +214,7 @@ typedef struct {
char *JCLToPSInterpreter;
char *JCLEnd;
char *DefaultFont;
FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
struct list InstalledFonts;
struct list PageSizes;
PAGESIZE *DefaultPageSize;
OPTION *InstalledOptions;