Use hard-coded font name bindings only with the ANSI_CHARSET (non-US

charsets with no font name shouldn't be bound to US charset).
This commit is contained in:
Hidenori Takeshima 2002-04-11 23:45:15 +00:00 committed by Alexandre Julliard
parent a781a31922
commit 6aadb22bfb
1 changed files with 14 additions and 1 deletions

View File

@ -2601,6 +2601,17 @@ static UINT XFONT_MatchFIList( fontMatch* pfm )
return score;
}
/***********************************************************************
* XFONT_is_ansi_charset
*
* returns TRUE if the given charset is ANSI_CHARSET.
*/
static BOOL XFONT_is_ansi_charset( UINT charset )
{
return ((charset == ANSI_CHARSET) ||
(charset == DEFAULT_CHARSET && GetACP() == 1252));
}
/***********************************************************************
* XFONT_MatchDeviceFont
*
@ -2619,7 +2630,9 @@ static void XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm)
pfm->pfi = NULL;
if( !fm.plf->lfFaceName[0] )
/* the following hard-coded font binding assumes 'ANSI_CHARSET'. */
if( !fm.plf->lfFaceName[0] &&
XFONT_is_ansi_charset(fm.plf->lfCharSet) )
{
switch(fm.plf->lfPitchAndFamily & 0xf0)
{