mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
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:
parent
aa3f71148c
commit
0eac06cce1
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user