Commit 4ff9b7f1 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

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

parent 4f819f8e
......@@ -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' - "
......
......@@ -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,
......
......@@ -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;
......
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