Commit 0eac06cc authored by Nick Holloway's avatar Nick Holloway Committed by Alexandre Julliard

If there is not an exact match found for the requested font name,

instead of using the first font defined for the printer, map some common font families (e.g. Arial -> Helvetica), and search again.
parent aa3f7114
......@@ -73,10 +73,25 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
TRACE("Trying to find facename '%s'\n", FaceName);
/* Look for a matching font family */
for(family = physDev->pi->Fonts; family; family = family->next) {
if(!strcmp(FaceName, family->FamilyName))
break;
}
if(!family) {
/* Fallback for Window's font families to common PostScript families */
if(!strcmp(FaceName, "Arial"))
strcpy(FaceName, "Helvetica");
else if(!strcmp(FaceName, "System"))
strcpy(FaceName, "Helvetica");
else if(!strcmp(FaceName, "Times New Roman"))
strcpy(FaceName, "Times");
for(family = physDev->pi->Fonts; family; family = family->next) {
if(!strcmp(FaceName, family->FamilyName))
break;
}
}
/* If all else fails, use the first font defined for the printer */
if(!family)
family = physDev->pi->Fonts;
......
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