summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-11-26 15:15:44 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-11-26 15:15:44 +0000
commit9bead0b121ce576c7dd51345b77e803bb0e88e7b (patch)
treee08ddd9b90898a55cec69014a4b15830dbb5a620 /vcl/win
parent4f42f332b3e5e9813bc141425720f3b5bd02bbcc (diff)
INTEGRATION: CWS vcl29 (1.60.36); FILE MERGED
2004/11/26 14:58:07 pl 1.60.36.3: RESYNC: (1.60-1.62); FILE MERGED 2004/10/25 07:49:43 hdu 1.60.36.2: #21466# use pMetric->lfPitchAndFamily also on WNT 2004/10/22 13:34:25 hdu 1.60.36.1: #21466# force manual aliasing of symbol codes for symbol fonts on W98 platforms
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx80
1 files changed, 64 insertions, 16 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index c39d00924d11..95714a571d61 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salgdi3.cxx,v $
*
- * $Revision: 1.62 $
+ * $Revision: 1.63 $
*
- * last change: $Author: hr $ $Date: 2004-11-09 16:33:26 $
+ * last change: $Author: hr $ $Date: 2004-11-26 16:15:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -450,7 +450,9 @@ static ImplFontData* ImplLogMetricToDevFontDataA( const ENUMLOGFONTEXA* pLogFont
ImplFontData* pData = new ImplWinFontData(
WinFont2DevFontAttributes(*pLogFont, *pMetric, nFontType),
- pLogFont->elfLogFont.lfCharSet, nHeight );
+ nHeight,
+ pLogFont->elfLogFont.lfCharSet,
+ pMetric->tmPitchAndFamily );
return pData;
}
@@ -467,7 +469,9 @@ static ImplFontData* ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogFont
ImplFontData* pData = new ImplWinFontData(
WinFont2DevFontAttributes(*pLogFont, *pMetric, nFontType),
- pLogFont->elfLogFont.lfCharSet, nHeight );
+ nHeight,
+ pLogFont->elfLogFont.lfCharSet,
+ pMetric->tmPitchAndFamily );
return pData;
}
@@ -553,17 +557,41 @@ void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont )
// =======================================================================
ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
- WIN_BYTE eWinCharSet, int nHeight )
+ int nHeight, WIN_BYTE eWinCharSet, WIN_BYTE nPitchAndFamily )
: ImplFontData( rDFS, 0 ),
meWinCharSet( eWinCharSet ),
+ mnPitchAndFamily( nPitchAndFamily ),
mpFontCharSets( NULL ),
mpUnicodeMap( NULL ),
mbGsubRead( false ),
mbDisableGlyphApi( false ),
mbHasKoreanRange( false ),
- mbHasCJKSupport( false )
+ mbHasCJKSupport( false ),
+ mbAliasSymbolsLow( false ),
+ mbAliasSymbolsHigh( false )
{
SetBitmapSize( 0, nHeight );
+
+ if( eWinCharSet == SYMBOL_CHARSET )
+ {
+ if( (nPitchAndFamily & TMPF_TRUETYPE) != 0 )
+ {
+ // truetype fonts need their symbols as U+F0xx
+ mbAliasSymbolsHigh = true;
+ }
+ else if( (nPitchAndFamily & (TMPF_VECTOR|TMPF_DEVICE))
+ == (TMPF_VECTOR|TMPF_DEVICE) )
+ {
+ // scalable device fonts (e.g. builtin printer fonts)
+ // need their symbols as U+00xx
+ mbAliasSymbolsLow = true;
+ }
+ else if( (nPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE)) == 0 )
+ {
+ // bitmap fonts need their symbols as U+F0xx
+ mbAliasSymbolsHigh = true;
+ }
+ }
}
// -----------------------------------------------------------------------
@@ -838,7 +866,20 @@ void ImplWinFontData::ReadCmapTable( HDC hDC )
}
if( nRangeCount <= 0 )
- mpUnicodeMap = ImplFontCharMap::GetDefaultMap();
+ {
+ // even when no CMAP is available we know it for symbol fonts
+ if( meWinCharSet == SYMBOL_CHARSET )
+ {
+ nRangeCount = 2;
+ pCodePairs = new sal_uInt32[4];
+ pCodePairs[0] = 0x0020; // aliased symbols
+ pCodePairs[1] = 0x0100;
+ pCodePairs[2] = 0xF020; // original symbols
+ pCodePairs[3] = 0xF100;
+ }
+ else
+ mpUnicodeMap = ImplFontCharMap::GetDefaultMap();
+ }
else
{
// recode the code ranges to their unicode encoded ranges
@@ -1029,15 +1070,18 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
rLogFont.lfFaceName[nNameLen] = 0;
if( !pFont->mpFontData )
+ {
rLogFont.lfCharSet = pFont->IsSymbolFont() ? SYMBOL_CHARSET : DEFAULT_CHARSET;
+ rLogFont.lfPitchAndFamily = ImplPitchToWin( pFont->mePitch )
+ | ImplFamilyToWin( pFont->meFamily );
+ }
else
{
- ImplWinFontData* pSysData = reinterpret_cast<ImplWinFontData*>( pFont->mpFontData );
- rLogFont.lfCharSet = pSysData->GetCharSet();
+ ImplWinFontData* pWinFontData = reinterpret_cast<ImplWinFontData*>( pFont->mpFontData );
+ rLogFont.lfCharSet = pWinFontData->GetCharSet();
+ rLogFont.lfPitchAndFamily = pWinFontData->GetPitchAndFamily();
}
- rLogFont.lfPitchAndFamily = ImplPitchToWin( pFont->mePitch )
- | ImplFamilyToWin( pFont->meFamily );
rLogFont.lfWeight = ImplWeightToWin( pFont->meWeight );
rLogFont.lfHeight = (int)-pFont->mnHeight;
rLogFont.lfWidth = (int)pFont->mnWidth;
@@ -1100,15 +1144,18 @@ static void ImplGetLogFontFromFontSelect( HDC hDC,
rLogFont.lfFaceName[nNameLen] = '\0';
if( !pFont->mpFontData )
+ {
rLogFont.lfCharSet = pFont->IsSymbolFont() ? SYMBOL_CHARSET : DEFAULT_CHARSET;
+ rLogFont.lfPitchAndFamily = ImplPitchToWin( pFont->mePitch )
+ | ImplFamilyToWin( pFont->meFamily );
+ }
else
{
- ImplWinFontData* pSysData = reinterpret_cast<ImplWinFontData*>( pFont->mpFontData );
- rLogFont.lfCharSet = pSysData->GetCharSet();
+ ImplWinFontData* pWinFontData = reinterpret_cast<ImplWinFontData*>( pFont->mpFontData );
+ rLogFont.lfCharSet = pWinFontData->GetCharSet();
+ rLogFont.lfPitchAndFamily = pWinFontData->GetPitchAndFamily();
}
- rLogFont.lfPitchAndFamily = ImplPitchToWin( pFont->mePitch )
- | ImplFamilyToWin( pFont->meFamily );
rLogFont.lfWeight = ImplWeightToWin( pFont->meWeight );
rLogFont.lfHeight = (int)-pFont->mnHeight;
rLogFont.lfWidth = (int)pFont->mnWidth;
@@ -1934,7 +1981,8 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
aDFS.maMapName = aFontName;
*/
- ImplFontData* pFontData = new ImplWinFontData( aDFA, nPreferedCharSet );
+ ImplFontData* pFontData = new ImplWinFontData( aDFA, 0,
+ nPreferedCharSet, TMPF_VECTOR|TMPF_TRUETYPE );
pFontList->Add( pFontData );
return true;
}