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.
This commit is contained in:
Nick Holloway 1999-09-10 14:18:18 +00:00 committed by Alexandre Julliard
parent aa3f71148c
commit 0eac06cce1

View File

@ -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;