summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorth <th@openoffice.org>2001-07-25 17:11:20 +0000
committerth <th@openoffice.org>2001-07-25 17:11:20 +0000
commit9acdd7dc67d0613ac81622bd033fa8e6d61c6a38 (patch)
tree99564a7ede430db7d026b311f7a5a4c979455327 /vcl
parentdfad4dda7686515427c252a667a9fd91793e5224 (diff)
#88233# - Better fontmapping for symbol fonts
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/outdev3.cxx42
1 files changed, 33 insertions, 9 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 65ce92e28603..2c0896d09770 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev3.cxx,v $
*
- * $Revision: 1.55 $
+ * $Revision: 1.56 $
*
- * last change: $Author: th $ $Date: 2001-07-25 12:53:26 $
+ * last change: $Author: th $ $Date: 2001-07-25 18:11:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2313,6 +2313,8 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
pFoundData->mnTypeFaces |= IMPL_DEVFONT_SCALABLE;
if ( pNewData->meCharSet == RTL_TEXTENCODING_SYMBOL )
pFoundData->mnTypeFaces |= IMPL_DEVFONT_SYMBOL;
+ else
+ pFoundData->mnTypeFaces |= IMPL_DEVFONT_NONESYMBOL;
if ( pNewData->meWeight != WEIGHT_DONTKNOW )
{
if ( pNewData->meWeight >= WEIGHT_SEMIBOLD )
@@ -2523,8 +2525,6 @@ void ImplDevFontList::InitMatchData()
pEntry->meFamily, pTempFontAttr );
if ( ImplIsCJKFont( pEntry->maName ) )
pEntry->mnMatchType |= IMPL_FONT_ATTR_CJK;
- if ( pEntry->mnTypeFaces & IMPL_DEVFONT_SYMBOL )
- pEntry->mnMatchType |= IMPL_FONT_ATTR_SYMBOL;
pEntry = Next();
}
@@ -2759,6 +2759,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
ULONG nSearchType = 0;
FontWeight eSearchWeight = eWeight;
FontWidth eSearchWidth = rFont.GetWidthType();
+ BOOL bSymbolEncoding = (eCharSet == RTL_TEXTENCODING_SYMBOL);
ImplGetMapName( aSearchName, aSearchShortName, aSearchFamilyName,
eSearchWeight, eSearchWidth, nSearchType );
@@ -2785,6 +2786,9 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
}
}
+ if ( !pFoundData && bSymbolEncoding )
+ pFoundData = pFontList->ImplFindFontFromToken( aImplSubsStarSymbol );
+
// If we haven't found a font, we try this with the other Font Token names, if availble
if ( !pFoundData && (nToken > 1) )
{
@@ -2888,6 +2892,8 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
if ( ImplIsCJKFont( rName ) )
nSearchType |= IMPL_FONT_ATTR_CJK;
}
+ if ( bSymbolEncoding )
+ nSearchType |= IMPL_FONT_ATTR_SYMBOL;
// We must only match, if we have something to match
if ( nSearchType ||
@@ -2958,13 +2964,31 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
if ( nSearchType & IMPL_FONT_ATTR_SYMBOL )
{
- if ( nMatchType & IMPL_FONT_ATTR_SYMBOL )
- nTestMatch += 10000000*2;
- if ( nMatchType & IMPL_FONT_ATTR_FULL )
- nTestMatch += 10000000;
+ // prefer some special known symbol fonts
+ if ( pData->maSearchName.EqualsAscii( "starsymbol" ) )
+ nTestMatch += 10000000*6+(10000*3);
+ else if ( pData->maSearchName.EqualsAscii( "opensymbol" ) )
+ nTestMatch += 10000000*6;
+ else if ( pData->maSearchName.EqualsAscii( "starbats" ) ||
+ pData->maSearchName.EqualsAscii( "wingdings" ) ||
+ pData->maSearchName.EqualsAscii( "monotypesorts" ) ||
+ pData->maSearchName.EqualsAscii( "dingbats" ) ||
+ pData->maSearchName.EqualsAscii( "zapfdingbats" ) )
+ nTestMatch += 10000000*5;
+ else if ( pData->mnTypeFaces & IMPL_DEVFONT_SYMBOL )
+ nTestMatch += 10000000*4;
+ else
+ {
+ if ( nMatchType & IMPL_FONT_ATTR_SYMBOL )
+ nTestMatch += 10000000*2;
+ if ( nMatchType & IMPL_FONT_ATTR_FULL )
+ nTestMatch += 10000000;
+ }
}
- else if ( nMatchType & IMPL_FONT_ATTR_SYMBOL )
+ else if ( (pData->mnTypeFaces & (IMPL_DEVFONT_SYMBOL | IMPL_DEVFONT_NONESYMBOL)) == IMPL_DEVFONT_SYMBOL )
nTestMatch -= 10000000;
+ else if ( nMatchType & IMPL_FONT_ATTR_SYMBOL )
+ nTestMatch -= 10000;
if ( (aSearchFamilyName == pData->maMatchFamilyName) &&