Commit 11ab927a authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wineps: Store font related strings in unicode.

parent 8cfa8c15
...@@ -99,7 +99,7 @@ BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, BOOL *p_added) ...@@ -99,7 +99,7 @@ BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, BOOL *p_added)
newafmle->afm = afm; newafmle->afm = afm;
while(family) { while(family) {
if(!strcmp(family->FamilyName, afm->FamilyName)) if(!wcscmp(family->FamilyName, afm->FamilyName))
break; break;
insert = &(family->next); insert = &(family->next);
family = family->next; family = family->next;
...@@ -113,12 +113,12 @@ BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, BOOL *p_added) ...@@ -113,12 +113,12 @@ BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, BOOL *p_added)
return FALSE; return FALSE;
} }
*insert = family; *insert = family;
if (!(family->FamilyName = HeapAlloc(PSDRV_Heap, 0, strlen(afm->FamilyName)+1 ))) { if (!(family->FamilyName = HeapAlloc(PSDRV_Heap, 0, (wcslen(afm->FamilyName)+1)*sizeof(WCHAR) ))) {
HeapFree(PSDRV_Heap, 0, family); HeapFree(PSDRV_Heap, 0, family);
HeapFree(PSDRV_Heap, 0, newafmle); HeapFree(PSDRV_Heap, 0, newafmle);
return FALSE; return FALSE;
} }
strcpy( family->FamilyName, afm->FamilyName ); wcscpy( family->FamilyName, afm->FamilyName );
family->afmlist = newafmle; family->afmlist = newafmle;
*p_added = TRUE; *p_added = TRUE;
return TRUE; return TRUE;
...@@ -158,16 +158,16 @@ static void PSDRV_DumpFontList(void) ...@@ -158,16 +158,16 @@ static void PSDRV_DumpFontList(void)
AFMLISTENTRY *afmle; AFMLISTENTRY *afmle;
for(family = PSDRV_AFMFontList; family; family = family->next) { for(family = PSDRV_AFMFontList; family; family = family->next) {
TRACE("Family '%s'\n", family->FamilyName); TRACE("Family %s\n", debugstr_w(family->FamilyName));
for(afmle = family->afmlist; afmle; afmle = afmle->next) for(afmle = family->afmlist; afmle; afmle = afmle->next)
{ {
#if 0 #if 0
INT i; INT i;
#endif #endif
TRACE("\tFontName '%s' (%i glyphs) - '%s' encoding:\n", TRACE("\tFontName '%s' (%i glyphs) - %s encoding:\n",
afmle->afm->FontName, afmle->afm->NumofMetrics, afmle->afm->FontName, afmle->afm->NumofMetrics,
afmle->afm->EncodingScheme); debugstr_w(afmle->afm->EncodingScheme));
/* Uncomment to regenerate font data; see afm2c.c */ /* Uncomment to regenerate font data; see afm2c.c */
......
...@@ -81,7 +81,7 @@ static void writeHeader(FILE *of, const AFM *afm, const char *buffer) ...@@ -81,7 +81,7 @@ static void writeHeader(FILE *of, const AFM *afm, const char *buffer)
fputc('*', of); fputc('*', of);
fprintf(of, "\n" fprintf(of, "\n"
" *\n" " *\n"
" *\tFont metric data for %s\n" " *\tFont metric data for %S\n"
" *\n" " *\n"
" *\tCopyright 2001 Ian Pilcher\n" " *\tCopyright 2001 Ian Pilcher\n"
" *\n" " *\n"
...@@ -121,11 +121,11 @@ static void writeAFM(FILE *of, const AFM *afm, const char *buffer) ...@@ -121,11 +121,11 @@ static void writeAFM(FILE *of, const AFM *afm, const char *buffer)
fprintf(of, "const AFM PSDRV_%s =\n{\n", buffer); fprintf(of, "const AFM PSDRV_%s =\n{\n", buffer);
cursorto(of, 44, fprintf(of, " \"%s\",", afm->FontName)); cursorto(of, 44, fprintf(of, " \"%s\",", afm->FontName));
fputs("/* FontName */\n", of); fputs("/* FontName */\n", of);
cursorto(of, 44, fprintf(of, " \"%s\",", afm->FullName)); cursorto(of, 44, fprintf(of, " L\"%S\",", afm->FullName));
fputs("/* FullName */\n", of); fputs("/* FullName */\n", of);
cursorto(of, 44, fprintf(of, " \"%s\",", afm->FamilyName)); cursorto(of, 44, fprintf(of, " L\"%S\",", afm->FamilyName));
fputs("/* FamilyName */\n", of); fputs("/* FamilyName */\n", of);
cursorto(of, 44, fprintf(of, " \"%s\",", afm->EncodingScheme)); cursorto(of, 44, fprintf(of, " L\"%S\",", afm->EncodingScheme));
fputs("/* EncodingScheme */\n", of); fputs("/* EncodingScheme */\n", of);
cursorto(of, 44, fprintf(of, " %s,", cursorto(of, 44, fprintf(of, " %s,",
(afm->Weight > 550) ? "FW_BOLD" : "FW_NORMAL")); (afm->Weight > 550) ? "FW_BOLD" : "FW_NORMAL"));
......
...@@ -157,7 +157,7 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, ...@@ -157,7 +157,7 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
* *
*/ */
BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont, BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
LOGFONTW *plf, LPSTR FaceName) LOGFONTW *plf, WCHAR *face_name)
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev ); PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
AFMLISTENTRY *afmle; AFMLISTENTRY *afmle;
...@@ -165,27 +165,27 @@ BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont, ...@@ -165,27 +165,27 @@ BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
BOOL bd = FALSE, it = FALSE; BOOL bd = FALSE, it = FALSE;
LONG height; LONG height;
TRACE("Trying to find facename '%s'\n", FaceName); TRACE("Trying to find facename %s\n", debugstr_w(face_name));
/* Look for a matching font family */ /* Look for a matching font family */
for(family = physDev->pi->Fonts; family; family = family->next) { for(family = physDev->pi->Fonts; family; family = family->next) {
if(!stricmp(FaceName, family->FamilyName)) if(!wcsicmp(face_name, family->FamilyName))
break; break;
} }
if(!family) { if(!family) {
/* Fallback for Window's font families to common PostScript families */ /* Fallback for Window's font families to common PostScript families */
if(!strcmp(FaceName, "Arial")) if(!wcscmp(face_name, L"Arial"))
strcpy(FaceName, "Helvetica"); wcscpy(face_name, L"Helvetica");
else if(!strcmp(FaceName, "System")) else if(!wcscmp(face_name, L"System"))
strcpy(FaceName, "Helvetica"); wcscpy(face_name, L"Helvetica");
else if(!strcmp(FaceName, "Times New Roman")) else if(!wcscmp(face_name, L"Times New Roman"))
strcpy(FaceName, "Times"); wcscpy(face_name, L"Times");
else if(!strcmp(FaceName, "Courier New")) else if(!wcscmp(face_name, L"Courier New"))
strcpy(FaceName, "Courier"); wcscpy(face_name, L"Courier");
for(family = physDev->pi->Fonts; family; family = family->next) { for(family = physDev->pi->Fonts; family; family = family->next) {
if(!strcmp(FaceName, family->FamilyName)) if(!wcscmp(face_name, family->FamilyName))
break; break;
} }
} }
...@@ -193,7 +193,7 @@ BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont, ...@@ -193,7 +193,7 @@ BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
if(!family) if(!family)
family = physDev->pi->Fonts; family = physDev->pi->Fonts;
TRACE("Got family '%s'\n", family->FamilyName); TRACE("Got family %s\n", debugstr_w(family->FamilyName));
if(plf->lfItalic) if(plf->lfItalic)
it = TRUE; it = TRUE;
...@@ -401,8 +401,7 @@ static UINT PSDRV_GetFontMetric(HDC hdc, const AFM *afm, ...@@ -401,8 +401,7 @@ static UINT PSDRV_GetFontMetric(HDC hdc, const AFM *afm,
lf->lfPitchAndFamily = (afm->IsFixedPitch) ? FIXED_PITCH : VARIABLE_PITCH; lf->lfPitchAndFamily = (afm->IsFixedPitch) ? FIXED_PITCH : VARIABLE_PITCH;
MultiByteToWideChar(CP_ACP, 0, afm->FamilyName, -1, lf->lfFaceName, lstrcpynW(lf->lfFaceName, afm->FamilyName, LF_FACESIZE);
LF_FACESIZE);
return DEVICE_FONTTYPE; return DEVICE_FONTTYPE;
} }
...@@ -419,18 +418,15 @@ BOOL CDECL PSDRV_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPA ...@@ -419,18 +418,15 @@ BOOL CDECL PSDRV_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPA
BOOL ret; BOOL ret;
AFMLISTENTRY *afmle; AFMLISTENTRY *afmle;
FONTFAMILY *family; FONTFAMILY *family;
char FaceName[LF_FACESIZE];
ret = next->funcs->pEnumFonts( next, plf, proc, lp ); ret = next->funcs->pEnumFonts( next, plf, proc, lp );
if (!ret) return FALSE; if (!ret) return FALSE;
if( plf && plf->lfFaceName[0] ) { if( plf && plf->lfFaceName[0] ) {
WideCharToMultiByte(CP_ACP, 0, plf->lfFaceName, -1, TRACE("lfFaceName = %s\n", debugstr_w(plf->lfFaceName));
FaceName, sizeof(FaceName), NULL, NULL);
TRACE("lfFaceName = '%s'\n", FaceName);
for(family = physDev->pi->Fonts; family; family = family->next) { for(family = physDev->pi->Fonts; family; family = family->next) {
if(!strncmp(FaceName, family->FamilyName, if(!wcsncmp(plf->lfFaceName, family->FamilyName,
strlen(family->FamilyName))) wcslen(family->FamilyName)))
break; break;
} }
if(family) { if(family) {
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_AvantGarde_Book = const AFM PSDRV_AvantGarde_Book =
{ {
"AvantGarde-Book", /* FontName */ "AvantGarde-Book", /* FontName */
"ITC Avant Garde Gothic Book", /* FullName */ L"ITC Avant Garde Gothic Book", /* FullName */
"ITC Avant Garde Gothic", /* FamilyName */ L"ITC Avant Garde Gothic", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_AvantGarde_BookOblique = const AFM PSDRV_AvantGarde_BookOblique =
{ {
"AvantGarde-BookOblique", /* FontName */ "AvantGarde-BookOblique", /* FontName */
"ITC Avant Garde Gothic Book Oblique", /* FullName */ L"ITC Avant Garde Gothic Book Oblique", /* FullName */
"ITC Avant Garde Gothic", /* FamilyName */ L"ITC Avant Garde Gothic", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-10.5, /* ItalicAngle */ -10.5, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_AvantGarde_Demi = const AFM PSDRV_AvantGarde_Demi =
{ {
"AvantGarde-Demi", /* FontName */ "AvantGarde-Demi", /* FontName */
"ITC Avant Garde Gothic Demi", /* FullName */ L"ITC Avant Garde Gothic Demi", /* FullName */
"ITC Avant Garde Gothic", /* FamilyName */ L"ITC Avant Garde Gothic", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_AvantGarde_DemiOblique = const AFM PSDRV_AvantGarde_DemiOblique =
{ {
"AvantGarde-DemiOblique", /* FontName */ "AvantGarde-DemiOblique", /* FontName */
"ITC Avant Garde Gothic Demi Oblique", /* FullName */ L"ITC Avant Garde Gothic Demi Oblique", /* FullName */
"ITC Avant Garde Gothic", /* FamilyName */ L"ITC Avant Garde Gothic", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-10.5, /* ItalicAngle */ -10.5, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Bookman_Demi = const AFM PSDRV_Bookman_Demi =
{ {
"Bookman-Demi", /* FontName */ "Bookman-Demi", /* FontName */
"ITC Bookman Demi", /* FullName */ L"ITC Bookman Demi", /* FullName */
"ITC Bookman", /* FamilyName */ L"ITC Bookman", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Bookman_DemiItalic = const AFM PSDRV_Bookman_DemiItalic =
{ {
"Bookman-DemiItalic", /* FontName */ "Bookman-DemiItalic", /* FontName */
"ITC Bookman Demi Italic", /* FullName */ L"ITC Bookman Demi Italic", /* FullName */
"ITC Bookman", /* FamilyName */ L"ITC Bookman", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-10, /* ItalicAngle */ -10, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Bookman_Light = const AFM PSDRV_Bookman_Light =
{ {
"Bookman-Light", /* FontName */ "Bookman-Light", /* FontName */
"ITC Bookman Light", /* FullName */ L"ITC Bookman Light", /* FullName */
"ITC Bookman", /* FamilyName */ L"ITC Bookman", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Bookman_LightItalic = const AFM PSDRV_Bookman_LightItalic =
{ {
"Bookman-LightItalic", /* FontName */ "Bookman-LightItalic", /* FontName */
"ITC Bookman Light Italic", /* FullName */ L"ITC Bookman Light Italic", /* FullName */
"ITC Bookman", /* FamilyName */ L"ITC Bookman", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-10, /* ItalicAngle */ -10, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] = ...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] =
const AFM PSDRV_Courier = const AFM PSDRV_Courier =
{ {
"Courier", /* FontName */ "Courier", /* FontName */
"Courier", /* FullName */ L"Courier", /* FullName */
"Courier", /* FamilyName */ L"Courier", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
TRUE, /* IsFixedPitch */ TRUE, /* IsFixedPitch */
......
...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] = ...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] =
const AFM PSDRV_Courier_Bold = const AFM PSDRV_Courier_Bold =
{ {
"Courier-Bold", /* FontName */ "Courier-Bold", /* FontName */
"Courier Bold", /* FullName */ L"Courier Bold", /* FullName */
"Courier", /* FamilyName */ L"Courier", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
TRUE, /* IsFixedPitch */ TRUE, /* IsFixedPitch */
......
...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] = ...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] =
const AFM PSDRV_Courier_BoldOblique = const AFM PSDRV_Courier_BoldOblique =
{ {
"Courier-BoldOblique", /* FontName */ "Courier-BoldOblique", /* FontName */
"Courier Bold Oblique", /* FullName */ L"Courier Bold Oblique", /* FullName */
"Courier", /* FamilyName */ L"Courier", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-12, /* ItalicAngle */ -12, /* ItalicAngle */
TRUE, /* IsFixedPitch */ TRUE, /* IsFixedPitch */
......
...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] = ...@@ -272,9 +272,9 @@ static const AFMMETRICS metrics[243] =
const AFM PSDRV_Courier_Oblique = const AFM PSDRV_Courier_Oblique =
{ {
"Courier-Oblique", /* FontName */ "Courier-Oblique", /* FontName */
"Courier Oblique", /* FullName */ L"Courier Oblique", /* FullName */
"Courier", /* FamilyName */ L"Courier", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-12, /* ItalicAngle */ -12, /* ItalicAngle */
TRUE, /* IsFixedPitch */ TRUE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica = const AFM PSDRV_Helvetica =
{ {
"Helvetica", /* FontName */ "Helvetica", /* FontName */
"Helvetica", /* FullName */ L"Helvetica", /* FullName */
"Helvetica", /* FamilyName */ L"Helvetica", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica_Bold = const AFM PSDRV_Helvetica_Bold =
{ {
"Helvetica-Bold", /* FontName */ "Helvetica-Bold", /* FontName */
"Helvetica Bold", /* FullName */ L"Helvetica Bold", /* FullName */
"Helvetica", /* FamilyName */ L"Helvetica", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica_BoldOblique = const AFM PSDRV_Helvetica_BoldOblique =
{ {
"Helvetica-BoldOblique", /* FontName */ "Helvetica-BoldOblique", /* FontName */
"Helvetica Bold Oblique", /* FullName */ L"Helvetica Bold Oblique", /* FullName */
"Helvetica", /* FamilyName */ L"Helvetica", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-12, /* ItalicAngle */ -12, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica_Narrow = const AFM PSDRV_Helvetica_Narrow =
{ {
"Helvetica-Narrow", /* FontName */ "Helvetica-Narrow", /* FontName */
"Helvetica Narrow", /* FullName */ L"Helvetica Narrow", /* FullName */
"Helvetica Narrow", /* FamilyName */ L"Helvetica Narrow", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica_Narrow_Bold = const AFM PSDRV_Helvetica_Narrow_Bold =
{ {
"Helvetica-Narrow-Bold", /* FontName */ "Helvetica-Narrow-Bold", /* FontName */
"Helvetica Narrow Bold", /* FullName */ L"Helvetica Narrow Bold", /* FullName */
"Helvetica Narrow", /* FamilyName */ L"Helvetica Narrow", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica_Narrow_BoldOblique = const AFM PSDRV_Helvetica_Narrow_BoldOblique =
{ {
"Helvetica-Narrow-BoldOblique", /* FontName */ "Helvetica-Narrow-BoldOblique", /* FontName */
"Helvetica Narrow Bold Oblique", /* FullName */ L"Helvetica Narrow Bold Oblique", /* FullName */
"Helvetica Narrow", /* FamilyName */ L"Helvetica Narrow", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-12, /* ItalicAngle */ -12, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica_Narrow_Oblique = const AFM PSDRV_Helvetica_Narrow_Oblique =
{ {
"Helvetica-Narrow-Oblique", /* FontName */ "Helvetica-Narrow-Oblique", /* FontName */
"Helvetica Narrow Oblique", /* FullName */ L"Helvetica Narrow Oblique", /* FullName */
"Helvetica Narrow", /* FamilyName */ L"Helvetica Narrow", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-12, /* ItalicAngle */ -12, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Helvetica_Oblique = const AFM PSDRV_Helvetica_Oblique =
{ {
"Helvetica-Oblique", /* FontName */ "Helvetica-Oblique", /* FontName */
"Helvetica Oblique", /* FullName */ L"Helvetica Oblique", /* FullName */
"Helvetica", /* FamilyName */ L"Helvetica", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-12, /* ItalicAngle */ -12, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_NewCenturySchlbk_Bold = const AFM PSDRV_NewCenturySchlbk_Bold =
{ {
"NewCenturySchlbk-Bold", /* FontName */ "NewCenturySchlbk-Bold", /* FontName */
"New Century Schoolbook Bold", /* FullName */ L"New Century Schoolbook Bold", /* FullName */
"New Century Schoolbook", /* FamilyName */ L"New Century Schoolbook", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_NewCenturySchlbk_BoldItalic = const AFM PSDRV_NewCenturySchlbk_BoldItalic =
{ {
"NewCenturySchlbk-BoldItalic", /* FontName */ "NewCenturySchlbk-BoldItalic", /* FontName */
"New Century Schoolbook Bold Italic", /* FullName */ L"New Century Schoolbook Bold Italic", /* FullName */
"New Century Schoolbook", /* FamilyName */ L"New Century Schoolbook", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-16, /* ItalicAngle */ -16, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_NewCenturySchlbk_Italic = const AFM PSDRV_NewCenturySchlbk_Italic =
{ {
"NewCenturySchlbk-Italic", /* FontName */ "NewCenturySchlbk-Italic", /* FontName */
"New Century Schoolbook Italic", /* FullName */ L"New Century Schoolbook Italic", /* FullName */
"New Century Schoolbook", /* FamilyName */ L"New Century Schoolbook", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-16, /* ItalicAngle */ -16, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_NewCenturySchlbk_Roman = const AFM PSDRV_NewCenturySchlbk_Roman =
{ {
"NewCenturySchlbk-Roman", /* FontName */ "NewCenturySchlbk-Roman", /* FontName */
"New Century Schoolbook Roman", /* FullName */ L"New Century Schoolbook Roman", /* FullName */
"New Century Schoolbook", /* FamilyName */ L"New Century Schoolbook", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Palatino_Bold = const AFM PSDRV_Palatino_Bold =
{ {
"Palatino-Bold", /* FontName */ "Palatino-Bold", /* FontName */
"Palatino Bold", /* FullName */ L"Palatino Bold", /* FullName */
"Palatino", /* FamilyName */ L"Palatino", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Palatino_BoldItalic = const AFM PSDRV_Palatino_BoldItalic =
{ {
"Palatino-BoldItalic", /* FontName */ "Palatino-BoldItalic", /* FontName */
"Palatino Bold Italic", /* FullName */ L"Palatino Bold Italic", /* FullName */
"Palatino", /* FamilyName */ L"Palatino", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-10, /* ItalicAngle */ -10, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Palatino_Italic = const AFM PSDRV_Palatino_Italic =
{ {
"Palatino-Italic", /* FontName */ "Palatino-Italic", /* FontName */
"Palatino Italic", /* FullName */ L"Palatino Italic", /* FullName */
"Palatino", /* FamilyName */ L"Palatino", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-10, /* ItalicAngle */ -10, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Palatino_Roman = const AFM PSDRV_Palatino_Roman =
{ {
"Palatino-Roman", /* FontName */ "Palatino-Roman", /* FontName */
"Palatino Roman", /* FullName */ L"Palatino Roman", /* FullName */
"Palatino", /* FamilyName */ L"Palatino", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -217,9 +217,9 @@ static const AFMMETRICS metrics[188] = ...@@ -217,9 +217,9 @@ static const AFMMETRICS metrics[188] =
const AFM PSDRV_Symbol = const AFM PSDRV_Symbol =
{ {
"Symbol", /* FontName */ "Symbol", /* FontName */
"Symbol", /* FullName */ L"Symbol", /* FullName */
"Symbol", /* FamilyName */ L"Symbol", /* FamilyName */
"FontSpecific", /* EncodingScheme */ L"FontSpecific", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Times_Bold = const AFM PSDRV_Times_Bold =
{ {
"Times-Bold", /* FontName */ "Times-Bold", /* FontName */
"Times Bold", /* FullName */ L"Times Bold", /* FullName */
"Times", /* FamilyName */ L"Times", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Times_BoldItalic = const AFM PSDRV_Times_BoldItalic =
{ {
"Times-BoldItalic", /* FontName */ "Times-BoldItalic", /* FontName */
"Times Bold Italic", /* FullName */ L"Times Bold Italic", /* FullName */
"Times", /* FamilyName */ L"Times", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_BOLD, /* Weight */ FW_BOLD, /* Weight */
-15, /* ItalicAngle */ -15, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Times_Italic = const AFM PSDRV_Times_Italic =
{ {
"Times-Italic", /* FontName */ "Times-Italic", /* FontName */
"Times Italic", /* FullName */ L"Times Italic", /* FullName */
"Times", /* FamilyName */ L"Times", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-15.5, /* ItalicAngle */ -15.5, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_Times_Roman = const AFM PSDRV_Times_Roman =
{ {
"Times-Roman", /* FontName */ "Times-Roman", /* FontName */
"Times Roman", /* FullName */ L"Times Roman", /* FullName */
"Times", /* FamilyName */ L"Times", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] = ...@@ -257,9 +257,9 @@ static const AFMMETRICS metrics[228] =
const AFM PSDRV_ZapfChancery_MediumItalic = const AFM PSDRV_ZapfChancery_MediumItalic =
{ {
"ZapfChancery-MediumItalic", /* FontName */ "ZapfChancery-MediumItalic", /* FontName */
"ITC Zapf Chancery Medium Italic", /* FullName */ L"ITC Zapf Chancery Medium Italic", /* FullName */
"ITC Zapf Chancery", /* FamilyName */ L"ITC Zapf Chancery", /* FamilyName */
"AdobeStandardEncoding", /* EncodingScheme */ L"AdobeStandardEncoding", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
-14, /* ItalicAngle */ -14, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -217,9 +217,9 @@ static const AFMMETRICS metrics[188] = ...@@ -217,9 +217,9 @@ static const AFMMETRICS metrics[188] =
const AFM PSDRV_ZapfDingbats = const AFM PSDRV_ZapfDingbats =
{ {
"ZapfDingbats", /* FontName */ "ZapfDingbats", /* FontName */
"ITC Zapf Dingbats", /* FullName */ L"ITC Zapf Dingbats", /* FullName */
"ITC Zapf Dingbats", /* FamilyName */ L"ITC Zapf Dingbats", /* FamilyName */
"FontSpecific", /* EncodingScheme */ L"FontSpecific", /* EncodingScheme */
FW_NORMAL, /* Weight */ FW_NORMAL, /* Weight */
0, /* ItalicAngle */ 0, /* ItalicAngle */
FALSE, /* IsFixedPitch */ FALSE, /* IsFixedPitch */
......
...@@ -44,7 +44,6 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) ...@@ -44,7 +44,6 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
HFONT ret; HFONT ret;
LOGFONTW lf; LOGFONTW lf;
BOOL subst = FALSE; BOOL subst = FALSE;
char FaceName[LF_FACESIZE];
if (!GetObjectW( hfont, sizeof(lf), &lf )) return 0; if (!GetObjectW( hfont, sizeof(lf), &lf )) return 0;
...@@ -54,36 +53,33 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) ...@@ -54,36 +53,33 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
debugstr_w(lf.lfFaceName), lf.lfHeight, lf.lfItalic, debugstr_w(lf.lfFaceName), lf.lfHeight, lf.lfItalic,
lf.lfWeight); lf.lfWeight);
WideCharToMultiByte(CP_ACP, 0, lf.lfFaceName, -1, if(lf.lfFaceName[0] == '\0') {
FaceName, sizeof(FaceName), NULL, NULL);
if(FaceName[0] == '\0') {
switch(lf.lfPitchAndFamily & 0xf0) { switch(lf.lfPitchAndFamily & 0xf0) {
case FF_DONTCARE: case FF_DONTCARE:
break; break;
case FF_ROMAN: case FF_ROMAN:
case FF_SCRIPT: case FF_SCRIPT:
strcpy(FaceName, "Times"); wcscpy(lf.lfFaceName, L"Times");
break; break;
case FF_SWISS: case FF_SWISS:
strcpy(FaceName, "Helvetica"); wcscpy(lf.lfFaceName, L"Helvetica");
break; break;
case FF_MODERN: case FF_MODERN:
strcpy(FaceName, "Courier"); wcscpy(lf.lfFaceName, L"Courier");
break; break;
case FF_DECORATIVE: case FF_DECORATIVE:
strcpy(FaceName, "Symbol"); wcscpy(lf.lfFaceName, L"Symbol");
break; break;
} }
} }
if(FaceName[0] == '\0') { if(lf.lfFaceName[0] == '\0') {
switch(lf.lfPitchAndFamily & 0x0f) { switch(lf.lfPitchAndFamily & 0x0f) {
case VARIABLE_PITCH: case VARIABLE_PITCH:
strcpy(FaceName, "Times"); wcscpy(lf.lfFaceName, L"Times");
break; break;
default: default:
strcpy(FaceName, "Courier"); wcscpy(lf.lfFaceName, L"Courier");
break; break;
} }
} }
...@@ -94,21 +90,19 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) ...@@ -94,21 +90,19 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
for (i = 0; i < physDev->pi->FontSubTableSize; ++i) for (i = 0; i < physDev->pi->FontSubTableSize; ++i)
{ {
if (!stricmp (FaceName, if (!wcsicmp (lf.lfFaceName,
physDev->pi->FontSubTable[i].pValueName)) physDev->pi->FontSubTable[i].pValueName))
{ {
TRACE ("substituting facename '%s' for '%s'\n", TRACE("substituting facename %s for %s\n",
(LPSTR) physDev->pi->FontSubTable[i].pData, FaceName); debugstr_w((WCHAR *)physDev->pi->FontSubTable[i].pData), debugstr_w(lf.lfFaceName));
if (strlen ((LPSTR) physDev->pi->FontSubTable[i].pData) < if (wcslen((WCHAR *)physDev->pi->FontSubTable[i].pData) < LF_FACESIZE)
LF_FACESIZE)
{ {
strcpy (FaceName, wcscpy(lf.lfFaceName, (WCHAR *)physDev->pi->FontSubTable[i].pData);
(LPSTR) physDev->pi->FontSubTable[i].pData);
subst = TRUE; subst = TRUE;
} }
else else
WARN ("Facename '%s' is too long; ignoring substitution\n", WARN("Facename %s is too long; ignoring substitution\n",
(LPSTR) physDev->pi->FontSubTable[i].pData); debugstr_w((WCHAR *)physDev->pi->FontSubTable[i].pData));
break; break;
} }
} }
...@@ -123,7 +117,7 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) ...@@ -123,7 +117,7 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
return ret; return ret;
} }
PSDRV_SelectBuiltinFont(dev, hfont, &lf, FaceName); PSDRV_SelectBuiltinFont(dev, hfont, &lf, lf.lfFaceName);
next->funcs->pSelectFont( next, 0, aa_flags ); /* tell next driver that we selected a device font */ next->funcs->pSelectFont( next, 0, aa_flags ); /* tell next driver that we selected a device font */
return hfont; return hfont;
} }
......
...@@ -459,21 +459,21 @@ BOOL CDECL PSDRV_ResetDC( PHYSDEV dev, const DEVMODEW *lpInitData ) ...@@ -459,21 +459,21 @@ BOOL CDECL PSDRV_ResetDC( PHYSDEV dev, const DEVMODEW *lpInitData )
return TRUE; return TRUE;
} }
static PRINTER_ENUM_VALUESA *load_font_sub_table( HANDLE printer, DWORD *num_entries ) static PRINTER_ENUM_VALUESW *load_font_sub_table( HANDLE printer, DWORD *num_entries )
{ {
DWORD res, needed, num; DWORD res, needed, num;
PRINTER_ENUM_VALUESA *table = NULL; PRINTER_ENUM_VALUESW *table = NULL;
static const char fontsubkey[] = "PrinterDriverData\\FontSubTable"; static const WCHAR fontsubkey[] = L"PrinterDriverData\\FontSubTable";
*num_entries = 0; *num_entries = 0;
res = EnumPrinterDataExA( printer, fontsubkey, NULL, 0, &needed, &num ); res = EnumPrinterDataExW( printer, fontsubkey, NULL, 0, &needed, &num );
if (res != ERROR_MORE_DATA) return NULL; if (res != ERROR_MORE_DATA) return NULL;
table = HeapAlloc( PSDRV_Heap, 0, needed ); table = HeapAlloc( PSDRV_Heap, 0, needed );
if (!table) return NULL; if (!table) return NULL;
res = EnumPrinterDataExA( printer, fontsubkey, (LPBYTE)table, needed, &needed, &num ); res = EnumPrinterDataExW( printer, fontsubkey, (LPBYTE)table, needed, &needed, &num );
if (res != ERROR_SUCCESS) if (res != ERROR_SUCCESS)
{ {
HeapFree( PSDRV_Heap, 0, table ); HeapFree( PSDRV_Heap, 0, table );
...@@ -579,7 +579,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name) ...@@ -579,7 +579,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
BOOL using_default_devmode = FALSE; BOOL using_default_devmode = FALSE;
int len; int len;
TRACE("'%s'\n", debugstr_w(name)); TRACE("%s\n", debugstr_w(name));
LIST_FOR_EACH_ENTRY( pi, &printer_list, PRINTERINFO, entry ) LIST_FOR_EACH_ENTRY( pi, &printer_list, PRINTERINFO, entry )
{ {
...@@ -659,7 +659,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name) ...@@ -659,7 +659,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
afm = PSDRV_FindAFMinList(PSDRV_AFMFontList, font->Name); afm = PSDRV_FindAFMinList(PSDRV_AFMFontList, font->Name);
if(!afm) { if(!afm) {
TRACE( "Couldn't find AFM file for installed printer font '%s' - " TRACE( "Couldn't find AFM file for installed printer font '%s' - "
"ignoring\n", font->Name); "ignoring\n", font->Name);
} }
else { else {
BOOL added; BOOL added;
......
...@@ -1091,7 +1091,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer ) ...@@ -1091,7 +1091,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
TRACE("'%s'\n", fn->Name); TRACE("'%s'\n", fn->Name);
LIST_FOR_EACH_ENTRY(page, &ppd->PageSizes, PAGESIZE, entry) { LIST_FOR_EACH_ENTRY(page, &ppd->PageSizes, PAGESIZE, entry) {
TRACE("'%s' aka '%s' (%d) invoked by '%s'\n", page->Name, TRACE("'%s' aka %s (%d) invoked by '%s'\n", page->Name,
debugstr_w(page->FullName), page->WinPage, page->InvocationString); debugstr_w(page->FullName), page->WinPage, page->InvocationString);
if(page->ImageableArea) if(page->ImageableArea)
TRACE("Area = %.2f,%.2f - %.2f, %.2f\n", TRACE("Area = %.2f,%.2f - %.2f, %.2f\n",
......
...@@ -81,10 +81,10 @@ typedef struct { ...@@ -81,10 +81,10 @@ typedef struct {
} WINMETRICS; } WINMETRICS;
typedef struct _tagAFM { typedef struct _tagAFM {
LPCSTR FontName; const char *FontName;
LPCSTR FullName; const WCHAR *FullName;
LPCSTR FamilyName; const WCHAR *FamilyName;
LPCSTR EncodingScheme; const WCHAR *EncodingScheme;
LONG Weight; /* FW_NORMAL etc. */ LONG Weight; /* FW_NORMAL etc. */
float ItalicAngle; float ItalicAngle;
BOOL IsFixedPitch; BOOL IsFixedPitch;
...@@ -109,7 +109,7 @@ typedef struct _tagAFMLISTENTRY { ...@@ -109,7 +109,7 @@ typedef struct _tagAFMLISTENTRY {
} AFMLISTENTRY; } AFMLISTENTRY;
typedef struct _tagFONTFAMILY { typedef struct _tagFONTFAMILY {
char *FamilyName; /* family name */ WCHAR *FamilyName; /* family name */
AFMLISTENTRY *afmlist; /* list of afms for this family */ AFMLISTENTRY *afmlist; /* list of afms for this family */
struct _tagFONTFAMILY *next; /* next family */ struct _tagFONTFAMILY *next; /* next family */
} FONTFAMILY; } FONTFAMILY;
...@@ -243,7 +243,7 @@ typedef struct ...@@ -243,7 +243,7 @@ typedef struct
PPD *ppd; PPD *ppd;
PSDRV_DEVMODE *Devmode; PSDRV_DEVMODE *Devmode;
FONTFAMILY *Fonts; FONTFAMILY *Fonts;
PPRINTER_ENUM_VALUESA FontSubTable; PPRINTER_ENUM_VALUESW FontSubTable;
DWORD FontSubTableSize; DWORD FontSubTableSize;
} PRINTERINFO; } PRINTERINFO;
...@@ -545,7 +545,7 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) DECLSPEC_HIDDEN; ...@@ -545,7 +545,7 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) DECLSPEC_HIDDEN;
SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) DECLSPEC_HIDDEN; SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) DECLSPEC_HIDDEN;
extern BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont, extern BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
LOGFONTW *plf, LPSTR FaceName) DECLSPEC_HIDDEN; LOGFONTW *plf, WCHAR *face_name) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev) DECLSPEC_HIDDEN; extern BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count) DECLSPEC_HIDDEN; extern BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count) DECLSPEC_HIDDEN;
......
...@@ -319,6 +319,32 @@ static BOOL ReadString(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key, ...@@ -319,6 +319,32 @@ static BOOL ReadString(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key,
return TRUE; return TRUE;
} }
static BOOL ReadStringW(FILE *file, CHAR *buffer, int size, const char *key, WCHAR **out)
{
char *outA;
int len;
if (!ReadString(file, buffer, size, key, &outA))
return FALSE;
if (!outA)
{
*out = NULL;
return TRUE;
}
len = MultiByteToWideChar(CP_ACP, 0, outA, -1, NULL, 0);
if (len)
*out = HeapAlloc(PSDRV_Heap, 0, len * sizeof(WCHAR));
if (!len || !*out)
{
HeapFree(PSDRV_Heap, 0, outA);
return FALSE;
}
MultiByteToWideChar(CP_ACP, 0, outA, -1, *out, len);
HeapFree(PSDRV_Heap, 0, outA);
return TRUE;
}
/******************************************************************************* /*******************************************************************************
* ReadBBox * ReadBBox
* *
...@@ -851,7 +877,7 @@ static VOID Unicodify(AFM *afm, OLD_AFMMETRICS *metrics) ...@@ -851,7 +877,7 @@ static VOID Unicodify(AFM *afm, OLD_AFMMETRICS *metrics)
{ {
INT i; INT i;
if (strcmp(afm->EncodingScheme, "FontSpecific") == 0) if (wcscmp(afm->EncodingScheme, L"FontSpecific") == 0)
{ {
for (i = 0; i < afm->NumofMetrics; ++i) for (i = 0; i < afm->NumofMetrics; ++i)
{ {
...@@ -1028,8 +1054,9 @@ static BOOL BuildAFM(FILE *file) ...@@ -1028,8 +1054,9 @@ static BOOL BuildAFM(FILE *file)
CHAR buffer[258]; /* allow for <cr>, <lf>, and <nul> */ CHAR buffer[258]; /* allow for <cr>, <lf>, and <nul> */
AFM *afm; AFM *afm;
AFMMETRICS *metrics; AFMMETRICS *metrics;
LPSTR font_name, full_name, family_name, encoding_scheme; WCHAR *full_name, *family_name, *encoding_scheme;
BOOL retval, added; char *font_name;
BOOL retval, added;
retval = ReadFontMetrics(file, buffer, sizeof(buffer), &afm); retval = ReadFontMetrics(file, buffer, sizeof(buffer), &afm);
if (retval == FALSE || afm == NULL) if (retval == FALSE || afm == NULL)
...@@ -1039,16 +1066,16 @@ static BOOL BuildAFM(FILE *file) ...@@ -1039,16 +1066,16 @@ static BOOL BuildAFM(FILE *file)
if (retval == FALSE || font_name == NULL) if (retval == FALSE || font_name == NULL)
goto cleanup_afm; goto cleanup_afm;
retval = ReadString(file, buffer, sizeof(buffer), "FullName", &full_name); retval = ReadStringW(file, buffer, sizeof(buffer), "FullName", &full_name);
if (retval == FALSE || full_name == NULL) if (retval == FALSE || full_name == NULL)
goto cleanup_font_name; goto cleanup_font_name;
retval = ReadString(file, buffer, sizeof(buffer), "FamilyName", retval = ReadStringW(file, buffer, sizeof(buffer), "FamilyName",
&family_name); &family_name);
if (retval == FALSE || family_name == NULL) if (retval == FALSE || family_name == NULL)
goto cleanup_full_name; goto cleanup_full_name;
retval = ReadString(file, buffer, sizeof(buffer), "EncodingScheme", retval = ReadStringW(file, buffer, sizeof(buffer), "EncodingScheme",
&encoding_scheme); &encoding_scheme);
if (retval == FALSE || encoding_scheme == NULL) if (retval == FALSE || encoding_scheme == NULL)
goto cleanup_family_name; goto cleanup_family_name;
......
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