diff --git a/gfx/src/os2/nsFontMetricsOS2.cpp b/gfx/src/os2/nsFontMetricsOS2.cpp index d6d92472718..9eed8812a47 100644 --- a/gfx/src/os2/nsFontMetricsOS2.cpp +++ b/gfx/src/os2/nsFontMetricsOS2.cpp @@ -617,13 +617,8 @@ nsFontMetricsOS2::SetFontHandle( HPS aPS, nsFontOS2* aFont ) // Symbols fonts must be created with codepage 65400, // so use 65400 for the fattrs codepage. We still do // conversions with the charset codepage - if ((strcmpi(fattrs->szFacename, "Webdings") == 0) || - (strcmpi(fattrs->szFacename, "wingdings") == 0) || - (strcmpi(fattrs->szFacename, "Symbol Set") == 0)) { - fattrs->usCodePage = 65400; - } else { + if (fattrs->usCodePage != 65400) fattrs->usCodePage = mConvertCodePage; - } // set up the charbox; set for image fonts also, in case we need to @@ -715,6 +710,7 @@ nsFontMetricsOS2::LoadFont( HPS aPS, nsString* aFontname ) fh->mFattrs.fsType |= FATTR_TYPE_MBCS; if( fm->fsType & FM_TYPE_DBCS ) fh->mFattrs.fsType |= FATTR_TYPE_DBCS; + fh->mFattrs.usCodePage = fm->usCodePage; SetFontHandle( aPS, fh ); break; @@ -753,6 +749,7 @@ nsFontMetricsOS2::LoadFont( HPS aPS, nsString* aFontname ) fattrs->fsSelection |= FATTR_SEL_BOLD; if( bItalic ) fattrs->fsSelection |= FATTR_SEL_ITALIC; + fh->mFattrs.usCodePage = fm->usCodePage; SetFontHandle( aPS, fh ); } @@ -1861,6 +1858,7 @@ nsFontMetricsOS2::InitializeGlobalFonts() font->metrics.fsType = pFontMetrics[i].fsType; font->metrics.fsDefn = pFontMetrics[i].fsDefn; font->metrics.fsSelection = pFontMetrics[i].fsSelection; + font->metrics.usCodePage = pFontMetrics[i].usCodePage; // Set the FM_SEL_BOLD flag in fsSelection. This makes the check for // bold and italic much easier in LoadFont @@ -2000,6 +1998,8 @@ nsFontMetricsOS2::InitializeGlobalFonts() else printf( " : " ); + printf( " : %5d", fm->usCodePage ); + if( font->nextFamily ) printf( " : %d", font->nextFamily ); diff --git a/gfx/src/os2/nsFontMetricsOS2.h b/gfx/src/os2/nsFontMetricsOS2.h index ccb8e0223c9..9ef7276100f 100644 --- a/gfx/src/os2/nsFontMetricsOS2.h +++ b/gfx/src/os2/nsFontMetricsOS2.h @@ -93,6 +93,7 @@ struct nsMiniFontMetrics USHORT fsType; USHORT fsDefn; USHORT fsSelection; + USHORT usCodePage; }; class nsGlobalFont