From 0eac06cce1d1c27cb7915b8e2b5df3fd760c489a Mon Sep 17 00:00:00 2001 From: Nick Holloway Date: Fri, 10 Sep 1999 14:18:18 +0000 Subject: [PATCH] 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. --- graphics/psdrv/font.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/graphics/psdrv/font.c b/graphics/psdrv/font.c index e3f9b0c699..2ce32d766f 100644 --- a/graphics/psdrv/font.c +++ b/graphics/psdrv/font.c @@ -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; -- 2.32.0.93.g670b81a890