Commit 9b12065f authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

wineps.drv: Use afm FamilyName instead of FullName.

Fixes a regression introduced by a6cb10bb The old logic also used FamilyName, and some applications depend on that Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54993 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54980Signed-off-by: 's avatarFabian Maurer <dark.shadow4@web.de>
parent d24dcb1e
...@@ -206,7 +206,7 @@ static BOOL convert_afm_to_ntf(void) ...@@ -206,7 +206,7 @@ static BOOL convert_afm_to_ntf(void)
off = size; off = size;
metrics_size = sizeof(IFIMETRICS) + metrics_size = sizeof(IFIMETRICS) +
(wcslen(afmle->afm->FullName) + 1) * sizeof(WCHAR); (wcslen(afmle->afm->FamilyName) + 1) * sizeof(WCHAR);
list = (void *)(data + header->font_mtx_off + sizeof(*list) * count); list = (void *)(data + header->font_mtx_off + sizeof(*list) * count);
list->name_off = off + sizeof(*font_mtx); list->name_off = off + sizeof(*font_mtx);
list->size = sizeof(*font_mtx) + strlen(afmle->afm->FontName) + 1 + list->size = sizeof(*font_mtx) + strlen(afmle->afm->FontName) + 1 +
...@@ -237,7 +237,7 @@ static BOOL convert_afm_to_ntf(void) ...@@ -237,7 +237,7 @@ static BOOL convert_afm_to_ntf(void)
strcpy(data + off + font_mtx->glyph_set_name_off, glyph_set_name); strcpy(data + off + font_mtx->glyph_set_name_off, glyph_set_name);
metrics = (void *)(data + off + font_mtx->metrics_off); metrics = (void *)(data + off + font_mtx->metrics_off);
metrics->cjThis = metrics_size; metrics->cjThis = metrics_size;
metrics->dpwszFaceName = sizeof(*metrics); metrics->dpwszFamilyName = sizeof(*metrics);
if (afmle->afm->IsFixedPitch) if (afmle->afm->IsFixedPitch)
metrics->jWinPitchAndFamily |= FIXED_PITCH; metrics->jWinPitchAndFamily |= FIXED_PITCH;
metrics->usWinWeight = afmle->afm->Weight; metrics->usWinWeight = afmle->afm->Weight;
...@@ -256,7 +256,7 @@ static BOOL convert_afm_to_ntf(void) ...@@ -256,7 +256,7 @@ static BOOL convert_afm_to_ntf(void)
metrics->rclFontBox.top = afmle->afm->FontBBox.ury; metrics->rclFontBox.top = afmle->afm->FontBBox.ury;
metrics->rclFontBox.right = afmle->afm->FontBBox.urx; metrics->rclFontBox.right = afmle->afm->FontBBox.urx;
metrics->rclFontBox.bottom = afmle->afm->FontBBox.lly; metrics->rclFontBox.bottom = afmle->afm->FontBBox.lly;
wcscpy((WCHAR *)((char *)metrics + metrics->dpwszFaceName), afmle->afm->FullName); wcscpy((WCHAR *)((char *)metrics + metrics->dpwszFamilyName), afmle->afm->FamilyName);
width_range = (void *)(data + off + font_mtx->width_off); width_range = (void *)(data + off + font_mtx->width_off);
for (i = 0; i < font_mtx->width_count; i++) for (i = 0; i < font_mtx->width_count; i++)
{ {
......
...@@ -1027,7 +1027,7 @@ static struct font_data *find_builtin_font(const PSDRV_DEVMODE *devmode, ...@@ -1027,7 +1027,7 @@ static struct font_data *find_builtin_font(const PSDRV_DEVMODE *devmode,
cur = find_font_data(installed_font[i].name); cur = find_font_data(installed_font[i].name);
if (!cur) continue; if (!cur) continue;
name = (WCHAR *)((char *)cur->metrics + cur->metrics->dpwszFaceName); name = (WCHAR *)((char *)cur->metrics + cur->metrics->dpwszFamilyName);
cur_it = !!(cur->metrics->fsSelection & FM_SEL_ITALIC); cur_it = !!(cur->metrics->fsSelection & FM_SEL_ITALIC);
cur_bd = !!(cur->metrics->fsSelection & FM_SEL_BOLD); cur_bd = !!(cur->metrics->fsSelection & FM_SEL_BOLD);
...@@ -1084,7 +1084,7 @@ static BOOL select_builtin_font(PSDRV_PDEVICE *pdev, HFONT hfont, LOGFONTW *plf) ...@@ -1084,7 +1084,7 @@ static BOOL select_builtin_font(PSDRV_PDEVICE *pdev, HFONT hfont, LOGFONTW *plf)
font_data = find_builtin_font(pdev->devmode, NULL, it, bd); font_data = find_builtin_font(pdev->devmode, NULL, it, bd);
TRACE("Got family %s font '%s'\n", debugstr_w((WCHAR *)((char *)font_data->metrics + TRACE("Got family %s font '%s'\n", debugstr_w((WCHAR *)((char *)font_data->metrics +
font_data->metrics->dpwszFaceName)), font_data->name); font_data->metrics->dpwszFamilyName)), font_data->name);
pdev->builtin = TRUE; pdev->builtin = TRUE;
pdev->font = NULL; pdev->font = NULL;
...@@ -1218,7 +1218,7 @@ static UINT get_font_metric(const struct font_data *font, ...@@ -1218,7 +1218,7 @@ static UINT get_font_metric(const struct font_data *font,
lf->lfPitchAndFamily = font->metrics->jWinPitchAndFamily & FIXED_PITCH ? FIXED_PITCH : VARIABLE_PITCH; lf->lfPitchAndFamily = font->metrics->jWinPitchAndFamily & FIXED_PITCH ? FIXED_PITCH : VARIABLE_PITCH;
lstrcpynW(lf->lfFaceName, (WCHAR *)((char *)font->metrics + font->metrics->dpwszFaceName), LF_FACESIZE); lstrcpynW(lf->lfFaceName, (WCHAR *)((char *)font->metrics + font->metrics->dpwszFamilyName), LF_FACESIZE);
return DEVICE_FONTTYPE; return DEVICE_FONTTYPE;
} }
...@@ -1253,7 +1253,7 @@ static BOOL enum_fonts(PHYSDEV dev, LPLOGFONTW plf, font_enum_proc proc, LPARAM ...@@ -1253,7 +1253,7 @@ static BOOL enum_fonts(PHYSDEV dev, LPLOGFONTW plf, font_enum_proc proc, LPARAM
cur = find_font_data(installed_font[i].name); cur = find_font_data(installed_font[i].name);
if (!cur) continue; if (!cur) continue;
name = (WCHAR *)((char *)cur->metrics + cur->metrics->dpwszFaceName); name = (WCHAR *)((char *)cur->metrics + cur->metrics->dpwszFamilyName);
if (wcsncmp(plf->lfFaceName, name, wcslen(name))) if (wcsncmp(plf->lfFaceName, name, wcslen(name)))
continue; continue;
...@@ -1272,7 +1272,7 @@ static BOOL enum_fonts(PHYSDEV dev, LPLOGFONTW plf, font_enum_proc proc, LPARAM ...@@ -1272,7 +1272,7 @@ static BOOL enum_fonts(PHYSDEV dev, LPLOGFONTW plf, font_enum_proc proc, LPARAM
cur = find_font_data(installed_font[i].name); cur = find_font_data(installed_font[i].name);
if (!cur) continue; if (!cur) continue;
name = (WCHAR *)((char *)cur->metrics + cur->metrics->dpwszFaceName); name = (WCHAR *)((char *)cur->metrics + cur->metrics->dpwszFamilyName);
TRACE("Got '%s'\n", cur->name); TRACE("Got '%s'\n", cur->name);
fm = get_font_metric(cur, &tm, &lf); fm = get_font_metric(cur, &tm, &lf);
if (!(ret = (*proc)(&lf.elfLogFont, (TEXTMETRICW *)&tm, fm, lp))) if (!(ret = (*proc)(&lf.elfLogFont, (TEXTMETRICW *)&tm, fm, lp)))
......
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