Changed call nsFontMetricsWin::GetFontWeightTable

from ToCString to WideCharToMultiByte to support multibyte font names.
b=28399 r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@62957 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kmcclusk%netscape.com
2000-03-15 01:18:34 +00:00
parent 0702710b84
commit de70bd6961

View File

@@ -1910,13 +1910,17 @@ static int CALLBACK nsFontWeightCallback(const LOGFONT* logFont, const TEXTMETRI
return TRUE; // Keep looking for more weights.
}
PRUint16
nsFontMetricsWin::GetFontWeightTable(HDC aDC, nsString* aFontName) {
// Look for all of the weights for a given font.
LOGFONT logFont;
logFont.lfCharSet = DEFAULT_CHARSET;
aFontName->ToCString(logFont.lfFaceName, LF_FACESIZE);
WideCharToMultiByte(CP_ACP, 0, aFontName->GetUnicode(), aFontName->Length() + 1,
logFont.lfFaceName, sizeof(logFont.lfFaceName), nsnull, nsnull);
logFont.lfPitchAndFamily = 0;
PRUint16 weights = 0;
@@ -1926,6 +1930,7 @@ nsFontMetricsWin::GetFontWeightTable(HDC aDC, nsString* aFontName) {
}
// Calculate the closest font weight. This is necessary because we need to
// control the mapping of logical font weight to available weight to handle both CSS2
// default algorithm + the case where a font weight is choosen which is not available then made