[Libreoffice-commits] .: 3 commits - vcl/inc vcl/unx
Christina Rossmanith
crossmanith at kemper.freedesktop.org
Sat Apr 9 13:49:46 PDT 2011
vcl/inc/vcl/fontmanager.hxx | 138 +++-----------
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 51 ++---
vcl/unx/headless/svppspgraphics.cxx | 91 ---------
vcl/unx/headless/svppspgraphics.hxx | 5
vcl/unx/inc/pspgraphics.h | 6
vcl/unx/kde/salnativewidgets-kde.cxx | 47 ++---
vcl/unx/kde4/KDESalFrame.cxx | 46 ++--
vcl/unx/source/fontmanager/fontcache.cxx | 8
vcl/unx/source/fontmanager/fontconfig.cxx | 120 ++++++------
vcl/unx/source/fontmanager/fontmanager.cxx | 270 ++++++++++++++---------------
vcl/unx/source/gdi/pspgraphics.cxx | 106 -----------
vcl/unx/source/gdi/salgdi3.cxx | 213 +---------------------
12 files changed, 334 insertions(+), 767 deletions(-)
New commits:
commit 0c1aa0244e013d7b15ee875695d4693abe0475bc
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date: Sat Apr 9 22:48:40 2011 +0200
Removed psp::pitch::type/psp::family::type/psp::italic::type
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 6d988d6..410ecf1 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -57,38 +57,6 @@ class ImplFontOptions;
namespace psp {
class PPDParser; // see ppdparser.hxx
-namespace italic
-{
-enum type {
- Upright = 0,
- Oblique = 1,
- Italic = 2,
- Unknown = 3
-};
-}
-
-namespace pitch
-{
-enum type {
- Unknown = 0,
- Fixed = 1,
- Variable = 2
-};
-}
-
-namespace family
-{
-enum type {
- Unknown = 0,
- Decorative = 1,
- Modern = 2,
- Roman = 3,
- Script = 4,
- Swiss = 5,
- System = 6
-};
-}
-
namespace fonttype
{
enum type {
@@ -99,15 +67,6 @@ enum type {
};
}
-namespace fcstatus
-{
-enum type {
- istrue,
- isunset,
- isfalse
-};
-}
-
/*
* the difference between FastPrintFontInfo and PrintFontInfo
* is that the information in FastPrintFontInfo can usually
@@ -127,11 +86,11 @@ struct FastPrintFontInfo
rtl::OUString m_aFamilyName;
rtl::OUString m_aStyleName;
std::list< rtl::OUString > m_aAliases;
- family::type m_eFamilyStyle;
- italic::type m_eItalic;
+ FontFamily m_eFamilyStyle;
+ FontItalic m_eItalic;
FontWidth m_eWidth;
FontWeight m_eWeight;
- pitch::type m_ePitch;
+ FontPitch m_ePitch;
rtl_TextEncoding m_aEncoding;
bool m_bSubsettable;
bool m_bEmbeddable;
@@ -139,11 +98,11 @@ struct FastPrintFontInfo
FastPrintFontInfo() :
m_nID( 0 ),
m_eType( fonttype::Unknown ),
- m_eFamilyStyle( family::Unknown ),
- m_eItalic( italic::Unknown ),
+ m_eFamilyStyle( FAMILY_DONTKNOW ),
+ m_eItalic( ITALIC_DONTKNOW ),
m_eWidth( WIDTH_DONTKNOW ),
m_eWeight( WEIGHT_DONTKNOW ),
- m_ePitch( pitch::Unknown ),
+ m_ePitch( PITCH_DONTKNOW ),
m_aEncoding( RTL_TEXTENCODING_DONTKNOW )
{}
};
@@ -242,10 +201,10 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
std::list< int > m_aAliases;
int m_nPSName; // atom
rtl::OUString m_aStyleName;
- italic::type m_eItalic;
+ FontItalic m_eItalic;
FontWidth m_eWidth;
FontWeight m_eWeight;
- pitch::type m_ePitch;
+ FontPitch m_ePitch;
rtl_TextEncoding m_aEncoding;
bool m_bFontEncodingOnly; // set if font should be only accessed by builtin encoding
CharacterMetric m_aGlobalMetricX;
@@ -325,10 +284,10 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
rtl::OString aFoundry;
rtl::OString aFamily;
rtl::OString aAddStyle;
- italic::type eItalic;
+ FontItalic eItalic;
FontWeight eWeight;
FontWidth eWidth;
- pitch::type ePitch;
+ FontPitch ePitch;
rtl_TextEncoding aEncoding;
XLFDEntry() { nMask = 0; }
@@ -341,7 +300,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
fontID m_nNextFontID;
boost::unordered_map< fontID, PrintFont* > m_aFonts;
- boost::unordered_map< int, family::type > m_aFamilyTypes;
+ boost::unordered_map< int, FontFamily > m_aFamilyTypes;
std::list< rtl::OUString > m_aPrinterDrivers;
std::list< rtl::OString > m_aFontDirectories;
std::list< int > m_aPrivateFontDirectories;
@@ -383,7 +342,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
fontID findFontFileID( int nDirID, const rtl::OString& rFile ) const;
fontID findFontBuiltinID( int nPSNameAtom ) const;
- family::type matchFamilyName( const rtl::OUString& rFamily ) const;
+ FontFamily matchFamilyName( const rtl::OUString& rFamily ) const;
PrintFont* getFont( fontID nID ) const
{
@@ -468,7 +427,7 @@ public:
const rtl::OUString& getPSName( fontID nFontID ) const;
// get a specific fonts style family
- family::type getFontFamilyType( fontID nFontID ) const;
+ FontFamily getFontFamilyType( fontID nFontID ) const;
// get a specific fonts family name aliases
void getFontFamilyAliases( fontID nFontID ) const;
@@ -481,10 +440,10 @@ public:
}
// get a specific fonts italic type
- italic::type getFontItalic( fontID nFontID ) const
+ FontItalic getFontItalic( fontID nFontID ) const
{
PrintFont* pFont = getFont( nFontID );
- return pFont ? pFont->m_eItalic : italic::Unknown;
+ return pFont ? pFont->m_eItalic : ITALIC_DONTKNOW;
}
// get a specific fonts width type
@@ -502,10 +461,10 @@ public:
}
// get a specific fonts pitch type
- pitch::type getFontPitch( fontID nFontID ) const
+ FontPitch getFontPitch( fontID nFontID ) const
{
PrintFont* pFont = getFont( nFontID );
- return pFont ? pFont->m_ePitch : pitch::Unknown;
+ return pFont ? pFont->m_ePitch : PITCH_DONTKNOW;
}
// get a specific fonts encoding
@@ -703,8 +662,8 @@ public:
ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)) const;
rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes,
- const rtl::OString& rLangAttrib, italic::type& rItalic, FontWeight& rWeight,
- FontWidth& rWidth, pitch::type& rPitch) const;
+ const rtl::OString& rLangAttrib, FontItalic& rItalic, FontWeight& rWeight,
+ FontWidth& rWidth, FontPitch& rPitch) const;
bool hasFontconfig() const { return m_bFontconfigSuccess; }
int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 86ae4e2..eb02be7 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3399,9 +3399,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// set italic
switch( eStyle )
{
- case PANGO_STYLE_NORMAL: aInfo.m_eItalic = psp::italic::Upright;break;
- case PANGO_STYLE_ITALIC: aInfo.m_eItalic = psp::italic::Italic;break;
- case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = psp::italic::Oblique;break;
+ case PANGO_STYLE_NORMAL: aInfo.m_eItalic = ITALIC_NONE;break;
+ case PANGO_STYLE_ITALIC: aInfo.m_eItalic = ITALIC_NORMAL;break;
+ case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = ITALIC_OBLIQUE;break;
}
// set weight
if( eWeight <= PANGO_WEIGHT_ULTRALIGHT )
@@ -3456,10 +3456,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aFont.SetWeight( aInfo.m_eWeight );
if( aInfo.m_eWidth != WIDTH_DONTKNOW )
aFont.SetWidthType( aInfo.m_eWidth );
- if( aInfo.m_eItalic != psp::italic::Unknown )
- aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
- if( aInfo.m_ePitch != psp::pitch::Unknown )
- aFont.SetPitch( PspGraphics::ToFontPitch( aInfo.m_ePitch ) );
+ if( aInfo.m_eItalic != ITALIC_DONTKNOW )
+ aFont.SetItalic( aInfo.m_eItalic );
+ if( aInfo.m_ePitch != PITCH_DONTKNOW )
+ aFont.SetPitch( aInfo.m_ePitch );
aStyleSet.SetAppFont( aFont );
aStyleSet.SetHelpFont( aFont );
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 8eab42a..0fe7acd 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -724,8 +724,8 @@ sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel
bool bArtBold = false;
if( pEntry->meItalic == ITALIC_OBLIQUE || pEntry->meItalic == ITALIC_NORMAL )
{
- psp::italic::type eItalic = m_pPrinterGfx->GetFontMgr().getFontItalic( nID );
- if( eItalic != psp::italic::Italic && eItalic != psp::italic::Oblique )
+ FontItalic eItalic = m_pPrinterGfx->GetFontMgr().getFontItalic( nID );
+ if( eItalic != ITALIC_NORMAL && eItalic != ITALIC_OBLIQUE )
bArtItalic = true;
}
int nWeight = (int)pEntry->meWeight;
@@ -1078,54 +1078,16 @@ void PspGraphics::DoGetGlyphWidths( psp::fontID aFont,
// ----------------------------------------------------------------------------
-FontPitch PspGraphics::ToFontPitch (psp::pitch::type ePitch)
-{
- switch (ePitch)
- {
- case psp::pitch::Fixed: return PITCH_FIXED;
- case psp::pitch::Variable: return PITCH_VARIABLE;
- default: break;
- }
- return PITCH_DONTKNOW;
-}
-
-FontItalic PspGraphics::ToFontItalic (psp::italic::type eItalic)
-{
- switch (eItalic)
- {
- case psp::italic::Upright: return ITALIC_NONE;
- case psp::italic::Oblique: return ITALIC_OBLIQUE;
- case psp::italic::Italic: return ITALIC_NORMAL;
- default: break;
- }
- return ITALIC_DONTKNOW;
-}
-
-FontFamily PspGraphics::ToFontFamily (psp::family::type eFamily)
-{
- switch (eFamily)
- {
- case psp::family::Decorative: return FAMILY_DECORATIVE;
- case psp::family::Modern: return FAMILY_MODERN;
- case psp::family::Roman: return FAMILY_ROMAN;
- case psp::family::Script: return FAMILY_SCRIPT;
- case psp::family::Swiss: return FAMILY_SWISS;
- case psp::family::System: return FAMILY_SYSTEM;
- default: break;
- }
- return FAMILY_DONTKNOW;
-}
-
ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintFontInfo& rInfo )
{
ImplDevFontAttributes aDFA;
aDFA.maName = rInfo.m_aFamilyName;
aDFA.maStyleName = rInfo.m_aStyleName;
- aDFA.meFamily = ToFontFamily (rInfo.m_eFamilyStyle);
+ aDFA.meFamily = rInfo.m_eFamilyStyle;
aDFA.meWeight = rInfo.m_eWeight;
- aDFA.meItalic = ToFontItalic (rInfo.m_eItalic);
+ aDFA.meItalic = rInfo.m_eItalic;
aDFA.meWidthType = rInfo.m_eWidth;
- aDFA.mePitch = ToFontPitch (rInfo.m_ePitch);
+ aDFA.mePitch = rInfo.m_ePitch;
aDFA.mbSymbolFlag = (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL);
switch( rInfo.m_eType )
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index 4a0194d..c292fb6 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -79,9 +79,6 @@ public:
Ucs2UIntMap& rUnicodeEnc );
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontPitch ToFontPitch (psp::pitch::type ePitch);
- static FontItalic ToFontItalic (psp::italic::type eItalic);
- static FontFamily ToFontFamily (psp::family::type eFamily);
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index aed990a..17eb233 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -77,9 +77,6 @@ public:
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontPitch ToFontPitch (psp::pitch::type ePitch);
- static FontItalic ToFontItalic (psp::italic::type eItalic);
- static FontFamily ToFontFamily (psp::family::type eFamily);
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 7272ccc..d0fa4a0 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1761,7 +1761,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aInfo.m_aFamilyName = String( rQFont.family().utf8(), RTL_TEXTENCODING_UTF8 );
// set italic
- aInfo.m_eItalic = ( qFontInfo.italic()? psp::italic::Italic: psp::italic::Upright );
+ aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE );
// set weight
int nWeight = qFontInfo.weight();
@@ -1821,10 +1821,10 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aFont.SetWeight( aInfo.m_eWeight );
if( aInfo.m_eWidth != WIDTH_DONTKNOW )
aFont.SetWidthType( aInfo.m_eWidth );
- if( aInfo.m_eItalic != psp::italic::Unknown )
- aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
- if( aInfo.m_ePitch != psp::pitch::Unknown )
- aFont.SetPitch( PspGraphics::ToFontPitch( aInfo.m_ePitch ) );
+ if( aInfo.m_eItalic != ITALIC_DONTKNOW )
+ aFont.SetItalic( aInfo.m_eItalic );
+ if( aInfo.m_ePitch != PITCH_DONTKNOW )
+ aFont.SetPitch( aInfo.m_ePitch );
return aFont;
}
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 3525e5d..8ed5078 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -102,7 +102,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aInfo.m_aFamilyName = String( (const char *) rQFont.family().toUtf8(), RTL_TEXTENCODING_UTF8 );
// set italic
- aInfo.m_eItalic = ( qFontInfo.italic()? psp::italic::Italic: psp::italic::Upright );
+ aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE );
// set weight
int nWeight = qFontInfo.weight();
@@ -162,10 +162,10 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aFont.SetWeight( aInfo.m_eWeight );
if( aInfo.m_eWidth != WIDTH_DONTKNOW )
aFont.SetWidthType( aInfo.m_eWidth );
- if( aInfo.m_eItalic != psp::italic::Unknown )
- aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
- if( aInfo.m_ePitch != psp::pitch::Unknown )
- aFont.SetPitch( PspGraphics::ToFontPitch( aInfo.m_ePitch ) );
+ if( aInfo.m_eItalic != ITALIC_DONTKNOW )
+ aFont.SetItalic( aInfo.m_eItalic );
+ if( aInfo.m_ePitch != PITCH_DONTKNOW )
+ aFont.SetPitch( aInfo.m_ePitch );
return aFont;
}
diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx
index 9cdf8dc..1792714 100644
--- a/vcl/unx/source/fontmanager/fontcache.cxx
+++ b/vcl/unx/source/fontmanager/fontcache.cxx
@@ -408,10 +408,10 @@ void FontCache::read()
}
int nCollEntry = atoi( pLine );
pFont->m_nPSName = pAtoms->getAtom( ATOM_PSNAME, OUString( pLine + nTokenPos[1], nTokenPos[2]-nTokenPos[1]-1, RTL_TEXTENCODING_UTF8 ), sal_True );
- pFont->m_eItalic = (italic::type)atoi( pLine+nTokenPos[2] );
+ pFont->m_eItalic = (FontItalic)atoi( pLine+nTokenPos[2] );
pFont->m_eWeight = (FontWeight)atoi( pLine+nTokenPos[3] );
pFont->m_eWidth = (FontWidth)atoi( pLine+nTokenPos[4] );
- pFont->m_ePitch = (pitch::type)atoi( pLine+nTokenPos[5] );
+ pFont->m_ePitch = (FontPitch)atoi( pLine+nTokenPos[5] );
pFont->m_aEncoding = (rtl_TextEncoding)atoi( pLine+nTokenPos[6] );
pFont->m_nAscend = atoi( pLine + nTokenPos[7] );
pFont->m_nDescend = atoi( pLine + nTokenPos[8] );
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index d7be05d..43b64d1 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -775,22 +775,22 @@ namespace
return WEIGHT_BLACK;
}
- italic::type convertSlant(int slant)
+ FontItalic convertSlant(int slant)
{
// set italic
if( slant == FC_SLANT_ITALIC )
- return italic::Italic;
+ return ITALIC_NORMAL;
else if( slant == FC_SLANT_OBLIQUE )
- return italic::Oblique;
- return italic::Upright;
+ return ITALIC_OBLIQUE;
+ return ITALIC_NONE;
}
- pitch::type convertSpacing(int spacing)
+ FontPitch convertSpacing(int spacing)
{
// set pitch
if( spacing == FC_MONO || spacing == FC_CHARCELL )
- return pitch::Fixed;
- return pitch::Variable;
+ return PITCH_FIXED;
+ return PITCH_VARIABLE;
}
// translation: fontconfig enum -> vcl enum
@@ -1041,15 +1041,15 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
}
static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
- italic::type eItalic, FontWeight eWeight, FontWidth eWidth, pitch::type ePitch)
+ FontItalic eItalic, FontWeight eWeight, FontWidth eWidth, FontPitch ePitch)
{
- if( eItalic != italic::Unknown )
+ if( eItalic != ITALIC_DONTKNOW )
{
int nSlant = FC_SLANT_ROMAN;
switch( eItalic )
{
- case italic::Italic: nSlant = FC_SLANT_ITALIC;break;
- case italic::Oblique: nSlant = FC_SLANT_OBLIQUE;break;
+ case ITALIC_NORMAL: nSlant = FC_SLANT_ITALIC;break;
+ case ITALIC_OBLIQUE: nSlant = FC_SLANT_OBLIQUE;break;
default:
break;
}
@@ -1094,13 +1094,13 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
}
rWrapper.FcPatternAddInteger( pPattern, FC_WIDTH, nWidth );
}
- if( ePitch != pitch::Unknown )
+ if( ePitch != PITCH_DONTKNOW )
{
int nSpacing = FC_PROPORTIONAL;
switch( ePitch )
{
- case pitch::Fixed: nSpacing = FC_MONO;break;
- case pitch::Variable: nSpacing = FC_PROPORTIONAL;break;
+ case PITCH_FIXED: nSpacing = FC_MONO;break;
+ case PITCH_VARIABLE: nSpacing = FC_PROPORTIONAL;break;
default:
break;
}
@@ -1112,8 +1112,8 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
rtl::OUString& rMissingCodes, const rtl::OString &rLangAttrib,
- italic::type &rItalic, FontWeight &rWeight,
- FontWidth &rWidth, pitch::type &rPitch) const
+ FontItalic &rItalic, FontWeight &rWeight,
+ FontWidth &rWidth, FontPitch &rPitch) const
{
rtl::OUString aName;
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
@@ -1429,7 +1429,7 @@ int PrintFontManager::FreeTypeCharIndex( void*, sal_uInt32 )
}
rtl::OUString PrintFontManager::Substitute( const rtl::OUString&,
- rtl::OUString&, const rtl::OString&, italic::type, FontWeight, FontWidth, pitch::type) const
+ rtl::OUString&, const rtl::OString&, FontItalic, FontWeight, FontWidth, FontPitch) const
{
rtl::OUString aName;
return aName;
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index e3c8983..60e9967 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -135,15 +135,15 @@ inline sal_uInt32 getUInt32BE( const sal_uInt8*& pBuffer )
return nRet;
}
-static italic::type parseItalic( const ByteString& rItalic )
+static FontItalic parseItalic( const ByteString& rItalic )
{
- italic::type eItalic = italic::Unknown;
+ FontItalic eItalic = ITALIC_DONTKNOW;
if( rItalic.EqualsIgnoreCaseAscii( "i" ) )
- eItalic = italic::Italic;
+ eItalic = ITALIC_NORMAL;
else if( rItalic.EqualsIgnoreCaseAscii( "o" ) )
- eItalic = italic::Oblique;
+ eItalic = ITALIC_OBLIQUE;
else
- eItalic = italic::Upright;
+ eItalic = ITALIC_NONE;
return eItalic;
}
@@ -356,10 +356,10 @@ PrintFontManager::PrintFont::PrintFont( fonttype::type eType ) :
m_eType( eType ),
m_nFamilyName( 0 ),
m_nPSName( 0 ),
- m_eItalic( italic::Unknown ),
+ m_eItalic( ITALIC_DONTKNOW ),
m_eWidth( WIDTH_DONTKNOW ),
m_eWeight( WEIGHT_DONTKNOW ),
- m_ePitch( pitch::Unknown ),
+ m_ePitch( PITCH_DONTKNOW ),
m_aEncoding( RTL_TEXTENCODING_DONTKNOW ),
m_bFontEncodingOnly( false ),
m_pMetrics( NULL ),
@@ -813,11 +813,11 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
// italic
if( pInfo->gfi->italicAngle > 0 )
- m_eItalic = italic::Oblique;
+ m_eItalic = ITALIC_OBLIQUE;
else if( pInfo->gfi->italicAngle < 0 )
- m_eItalic = italic::Italic;
+ m_eItalic = ITALIC_NORMAL;
else
- m_eItalic = italic::Upright;
+ m_eItalic = ITALIC_NONE;
// weight
ByteString aLowerWeight( pInfo->gfi->weight );
@@ -825,7 +825,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
m_eWeight = parseWeight( aLowerWeight );
// pitch
- m_ePitch = pInfo->gfi->isFixedPitch ? pitch::Fixed : pitch::Variable;
+ m_ePitch = pInfo->gfi->isFixedPitch ? PITCH_FIXED : PITCH_VARIABLE;
// encoding - only set if unknown
int nAdobeEncoding = 0;
@@ -1533,9 +1533,9 @@ bool PrintFontManager::parseXLFD( const OString& rXLFD, XLFDEntry& rEntry )
// evaluate pitch
if( aPitch.toChar() == 'c' || aPitch.toChar() == 'm' )
- rEntry.ePitch = pitch::Fixed;
+ rEntry.ePitch = PITCH_FIXED;
else
- rEntry.ePitch = pitch::Variable;
+ rEntry.ePitch = PITCH_VARIABLE;
OString aToken = aEnc.toAsciiLowerCase();
// get encoding
@@ -1710,9 +1710,9 @@ OString PrintFontManager::getXLFD( PrintFont* pFont ) const
aXLFD.append('-');
switch( pFont->m_eItalic )
{
- case italic::Upright: aXLFD.append('r');break;
- case italic::Oblique: aXLFD.append('o');break;
- case italic::Italic: aXLFD.append('i');break;
+ case ITALIC_NONE: aXLFD.append('r');break;
+ case ITALIC_OBLIQUE: aXLFD.append('o');break;
+ case ITALIC_NORMAL: aXLFD.append('i');break;
default: break;
}
aXLFD.append('-');
@@ -1730,7 +1730,7 @@ OString PrintFontManager::getXLFD( PrintFont* pFont ) const
default: break;
}
aXLFD.append("-utf8-0-0-0-0-");
- aXLFD.append( pFont->m_ePitch == pitch::Fixed ? "m" : "p" );
+ aXLFD.append( pFont->m_ePitch == PITCH_FIXED ? "m" : "p" );
aXLFD.append("-0-");
const char* pEnc = rtl_getBestUnixCharsetFromTextEncoding( pFont->m_aEncoding );
if( ! pEnc )
@@ -1975,12 +1975,12 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const
default: pFont->m_eWidth = WIDTH_NORMAL; break;
}
- pFont->m_ePitch = aInfo.pitch ? pitch::Fixed : pitch::Variable;
- pFont->m_eItalic = aInfo.italicAngle == 0 ? italic::Upright : ( aInfo.italicAngle < 0 ? italic::Italic : italic::Oblique );
+ pFont->m_ePitch = aInfo.pitch ? PITCH_FIXED : PITCH_VARIABLE;
+ pFont->m_eItalic = aInfo.italicAngle == 0 ? ITALIC_NONE : ( aInfo.italicAngle < 0 ? ITALIC_NORMAL : ITALIC_OBLIQUE );
// #104264# there are fonts that set italic angle 0 although they are
// italic; use macstyle bit here
if( aInfo.italicAngle == 0 && (aInfo.macStyle & 2) )
- pFont->m_eItalic = italic::Italic;
+ pFont->m_eItalic = ITALIC_NORMAL;
pFont->m_aEncoding = aInfo.symbolEncoded ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UCS2;
@@ -2431,13 +2431,13 @@ void PrintFontManager::initialize()
::boost::unordered_map< fontID, PrintFont* >::iterator font_it;
for (font_it = m_aFonts.begin(); font_it != m_aFonts.end(); ++font_it)
{
- ::boost::unordered_map< int, family::type >::const_iterator it =
+ ::boost::unordered_map< int, FontFamily >::const_iterator it =
m_aFamilyTypes.find( font_it->second->m_nFamilyName );
if (it != m_aFamilyTypes.end())
continue;
const ::rtl::OUString& rFamily =
m_pAtoms->getString( ATOM_FAMILYNAME, font_it->second->m_nFamilyName);
- family::type eType = matchFamilyName( rFamily );
+ FontFamily eType = matchFamilyName( rFamily );
m_aFamilyTypes[ font_it->second->m_nFamilyName ] = eType;
}
@@ -2460,7 +2460,7 @@ void PrintFontManager::initialize()
// -------------------------------------------------------------------------
inline bool
-equalPitch (psp::pitch::type from, psp::pitch::type to)
+equalPitch (FontPitch from, FontPitch to)
{
return from == to;
}
@@ -2472,10 +2472,10 @@ equalWeight (FontWeight from, FontWeight to)
}
inline bool
-equalItalic (psp::italic::type from, psp::italic::type to)
+equalItalic (FontItalic from, FontItalic to)
{
- if ( (from == psp::italic::Italic) || (from == psp::italic::Oblique) )
- return (to == psp::italic::Italic) || (to == psp::italic::Oblique);
+ if ( (from == ITALIC_NORMAL) || (from == ITALIC_OBLIQUE) )
+ return (to == ITALIC_NORMAL) || (to == ITALIC_OBLIQUE);
return to == from;
}
inline bool
@@ -2490,15 +2490,15 @@ namespace {
struct BuiltinFontIdentifier
{
OUString aFamily;
- italic::type eItalic;
+ FontItalic eItalic;
FontWeight eWeight;
- pitch::type ePitch;
+ FontPitch ePitch;
rtl_TextEncoding aEncoding;
BuiltinFontIdentifier( const OUString& rFam,
- italic::type eIt,
+ FontItalic eIt,
FontWeight eWg,
- pitch::type ePt,
+ FontPitch ePt,
rtl_TextEncoding enc ) :
aFamily( rFam ),
eItalic( eIt ),
@@ -2652,12 +2652,12 @@ void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDPa
void PrintFontManager::fillPrintFontInfo( PrintFont* pFont, FastPrintFontInfo& rInfo ) const
{
- ::boost::unordered_map< int, family::type >::const_iterator style_it =
+ ::boost::unordered_map< int, FontFamily >::const_iterator style_it =
m_aFamilyTypes.find( pFont->m_nFamilyName );
rInfo.m_eType = pFont->m_eType;
rInfo.m_aFamilyName = m_pAtoms->getString( ATOM_FAMILYNAME, pFont->m_nFamilyName );
rInfo.m_aStyleName = pFont->m_aStyleName;
- rInfo.m_eFamilyStyle = style_it != m_aFamilyTypes.end() ? style_it->second : family::Unknown;
+ rInfo.m_eFamilyStyle = style_it != m_aFamilyTypes.end() ? style_it->second : FAMILY_DONTKNOW;
rInfo.m_eItalic = pFont->m_eItalic;
rInfo.m_eWidth = pFont->m_eWidth;
rInfo.m_eWeight = pFont->m_eWeight;
@@ -2796,42 +2796,42 @@ int PrintFontManager::getFontFaceNumber( fontID nFontID ) const
// -------------------------------------------------------------------------
-family::type PrintFontManager::matchFamilyName( const ::rtl::OUString& rFamily ) const
+FontFamily PrintFontManager::matchFamilyName( const ::rtl::OUString& rFamily ) const
{
typedef struct {
const char* mpName;
sal_uInt16 mnLength;
- family::type meType;
+ FontFamily meType;
} family_t;
#define InitializeClass( p, a ) p, sizeof(p) - 1, a
const family_t pFamilyMatch[] = {
- { InitializeClass( "arial", family::Swiss ) },
- { InitializeClass( "arioso", family::Script ) },
- { InitializeClass( "avant garde", family::Swiss ) },
- { InitializeClass( "avantgarde", family::Swiss ) },
- { InitializeClass( "bembo", family::Roman ) },
- { InitializeClass( "bookman", family::Roman ) },
- { InitializeClass( "conga", family::Roman ) },
- { InitializeClass( "courier", family::Modern ) },
- { InitializeClass( "curl", family::Script ) },
- { InitializeClass( "fixed", family::Modern ) },
- { InitializeClass( "gill", family::Swiss ) },
- { InitializeClass( "helmet", family::Modern ) },
- { InitializeClass( "helvetica", family::Swiss ) },
- { InitializeClass( "international", family::Modern ) },
- { InitializeClass( "lucida", family::Swiss ) },
- { InitializeClass( "new century schoolbook", family::Roman ) },
- { InitializeClass( "palatino", family::Roman ) },
- { InitializeClass( "roman", family::Roman ) },
- { InitializeClass( "sans serif", family::Swiss ) },
- { InitializeClass( "sansserif", family::Swiss ) },
- { InitializeClass( "serf", family::Roman ) },
- { InitializeClass( "serif", family::Roman ) },
- { InitializeClass( "times", family::Roman ) },
- { InitializeClass( "utopia", family::Roman ) },
- { InitializeClass( "zapf chancery", family::Script ) },
- { InitializeClass( "zapfchancery", family::Script ) }
+ { InitializeClass( "arial", FAMILY_SWISS ) },
+ { InitializeClass( "arioso", FAMILY_SCRIPT ) },
+ { InitializeClass( "avant garde", FAMILY_SWISS ) },
+ { InitializeClass( "avantgarde", FAMILY_SWISS ) },
+ { InitializeClass( "bembo", FAMILY_ROMAN ) },
+ { InitializeClass( "bookman", FAMILY_ROMAN ) },
+ { InitializeClass( "conga", FAMILY_ROMAN ) },
+ { InitializeClass( "courier", FAMILY_MODERN ) },
+ { InitializeClass( "curl", FAMILY_SCRIPT ) },
+ { InitializeClass( "fixed", FAMILY_MODERN ) },
+ { InitializeClass( "gill", FAMILY_SWISS ) },
+ { InitializeClass( "helmet", FAMILY_MODERN ) },
+ { InitializeClass( "helvetica", FAMILY_SWISS ) },
+ { InitializeClass( "international", FAMILY_MODERN ) },
+ { InitializeClass( "lucida", FAMILY_SWISS ) },
+ { InitializeClass( "new century schoolbook", FAMILY_ROMAN ) },
+ { InitializeClass( "palatino", FAMILY_ROMAN ) },
+ { InitializeClass( "roman", FAMILY_ROMAN ) },
+ { InitializeClass( "sans serif", FAMILY_SWISS ) },
+ { InitializeClass( "sansserif", FAMILY_SWISS ) },
+ { InitializeClass( "serf", FAMILY_ROMAN ) },
+ { InitializeClass( "serif", FAMILY_ROMAN ) },
+ { InitializeClass( "times", FAMILY_ROMAN ) },
+ { InitializeClass( "utopia", FAMILY_ROMAN ) },
+ { InitializeClass( "zapf chancery", FAMILY_SCRIPT ) },
+ { InitializeClass( "zapfchancery", FAMILY_SCRIPT ) }
};
rtl::OString aFamily = rtl::OUStringToOString( rFamily, RTL_TEXTENCODING_ASCII_US );
@@ -2858,20 +2858,20 @@ family::type PrintFontManager::matchFamilyName( const ::rtl::OUString& rFamily )
return pHaystack->meType;
}
- return family::Unknown;
+ return FAMILY_DONTKNOW;
}
// -------------------------------------------------------------------------
-family::type PrintFontManager::getFontFamilyType( fontID nFontID ) const
+FontFamily PrintFontManager::getFontFamilyType( fontID nFontID ) const
{
PrintFont* pFont = getFont( nFontID );
if( !pFont )
- return family::Unknown;
+ return FAMILY_DONTKNOW;
- ::boost::unordered_map< int, family::type >::const_iterator it =
+ ::boost::unordered_map< int, FontFamily >::const_iterator it =
m_aFamilyTypes.find( pFont->m_nFamilyName );
- return (it != m_aFamilyTypes.end()) ? it->second : family::Unknown;
+ return (it != m_aFamilyTypes.end()) ? it->second : FAMILY_DONTKNOW;
}
@@ -4014,13 +4014,13 @@ bool PrintFontManager::readOverrideMetrics()
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StyleName" ) ) )
pFont->m_aStyleName = getString(pProps[n].Value);
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Italic" ) ) )
- pFont->m_eItalic = static_cast<italic::type>(getInt(pProps[n].Value));
+ pFont->m_eItalic = static_cast<FontItalic>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Width" ) ) )
pFont->m_eWidth = static_cast<FontWidth>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Weight" ) ) )
pFont->m_eWeight = static_cast<FontWeight>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Pitch" ) ) )
- pFont->m_ePitch = static_cast<pitch::type>(getInt(pProps[n].Value));
+ pFont->m_ePitch = static_cast<FontPitch>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encoding" ) ) )
pFont->m_aEncoding = static_cast<rtl_TextEncoding>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FontEncodingOnly" ) ) )
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 296af59..24b2423 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -810,8 +810,8 @@ sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel
bool bArtBold = false;
if( pEntry->meItalic == ITALIC_OBLIQUE || pEntry->meItalic == ITALIC_NORMAL )
{
- psp::italic::type eItalic = m_pPrinterGfx->GetFontMgr().getFontItalic( nID );
- if( eItalic != psp::italic::Italic && eItalic != psp::italic::Oblique )
+ FontItalic eItalic = m_pPrinterGfx->GetFontMgr().getFontItalic( nID );
+ if( eItalic != ITALIC_NORMAL && eItalic != ITALIC_OBLIQUE )
bArtItalic = true;
}
int nWeight = (int)pEntry->meWeight;
@@ -1180,63 +1180,16 @@ void PspGraphics::DoGetGlyphWidths( psp::fontID aFont,
}
// ----------------------------------------------------------------------------
-FontPitch PspGraphics::ToFontPitch (psp::pitch::type ePitch)
-{
- switch (ePitch)
- {
- case psp::pitch::Fixed: return PITCH_FIXED;
- case psp::pitch::Variable: return PITCH_VARIABLE;
- case psp::pitch::Unknown: return PITCH_DONTKNOW;
- default:
- OSL_FAIL( "unknown pitch mapping" );
- break;
- }
- return PITCH_DONTKNOW;
-}
-
-FontItalic PspGraphics::ToFontItalic (psp::italic::type eItalic)
-{
- switch (eItalic)
- {
- case psp::italic::Upright: return ITALIC_NONE;
- case psp::italic::Oblique: return ITALIC_OBLIQUE;
- case psp::italic::Italic: return ITALIC_NORMAL;
- case psp::italic::Unknown: return ITALIC_DONTKNOW;
- default:
- OSL_FAIL( "unknown italic mapping" );
- break;
- }
- return ITALIC_DONTKNOW;
-}
-
-FontFamily PspGraphics::ToFontFamily (psp::family::type eFamily)
-{
- switch (eFamily)
- {
- case psp::family::Decorative: return FAMILY_DECORATIVE;
- case psp::family::Modern: return FAMILY_MODERN;
- case psp::family::Roman: return FAMILY_ROMAN;
- case psp::family::Script: return FAMILY_SCRIPT;
- case psp::family::Swiss: return FAMILY_SWISS;
- case psp::family::System: return FAMILY_SYSTEM;
- case psp::family::Unknown: return FAMILY_DONTKNOW;
- default:
- OSL_FAIL( "unknown family mapping" );
- break;
- }
- return FAMILY_DONTKNOW;
-}
-
ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintFontInfo& rInfo )
{
ImplDevFontAttributes aDFA;
aDFA.maName = rInfo.m_aFamilyName;
aDFA.maStyleName = rInfo.m_aStyleName;
- aDFA.meFamily = ToFontFamily (rInfo.m_eFamilyStyle);
+ aDFA.meFamily = rInfo.m_eFamilyStyle;
aDFA.meWeight = rInfo.m_eWeight;
- aDFA.meItalic = ToFontItalic (rInfo.m_eItalic);
+ aDFA.meItalic = rInfo.m_eItalic;
aDFA.meWidthType = rInfo.m_eWidth;
- aDFA.mePitch = ToFontPitch (rInfo.m_ePitch);
+ aDFA.mePitch = rInfo.m_ePitch;
aDFA.mbSymbolFlag = (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL);
aDFA.mbSubsettable = rInfo.m_bSubsettable;
aDFA.mbEmbeddable = rInfo.m_bEmbeddable;
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index aaa3c74..97f4e70 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -1100,31 +1100,11 @@ void cairosubcallback( void* pPattern )
ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize)
{
- // TODO: get rid of these insane enum-conversions
- // e.g. by using the classic vclenum values inside VCL
-
psp::FastPrintFontInfo aInfo;
- // set family name
+
aInfo.m_aFamilyName = rFontAttributes.GetFamilyName();
- // set italic
- switch( rFontAttributes.GetSlant() )
- {
- case ITALIC_NONE:
- aInfo.m_eItalic = psp::italic::Upright;
- break;
- case ITALIC_NORMAL:
- aInfo.m_eItalic = psp::italic::Italic;
- break;
- case ITALIC_OBLIQUE:
- aInfo.m_eItalic = psp::italic::Oblique;
- break;
- default:
- aInfo.m_eItalic = psp::italic::Unknown;
- break;
- }
- // set weight
+ aInfo.m_eItalic = rFontAttributes.GetSlant();
aInfo.m_eWeight = rFontAttributes.GetWeight();
- // set width
aInfo.m_eWidth = rFontAttributes.GetWidthType();
const psp::PrintFontManager& rPFM = psp::PrintFontManager::get();
@@ -1395,56 +1375,18 @@ static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData
const rtl::OString aLangAttrib = MsLangId::convertLanguageToIsoByteString( rFontSelData.meLanguage );
- psp::italic::type eItalic = psp::italic::Unknown;
- if( rFontSelData.GetSlant() != ITALIC_DONTKNOW )
- {
- switch( rFontSelData.GetSlant() )
- {
- case ITALIC_NONE: eItalic = psp::italic::Upright; break;
- case ITALIC_NORMAL: eItalic = psp::italic::Italic; break;
- case ITALIC_OBLIQUE: eItalic = psp::italic::Oblique; break;
- default:
- break;
- }
- }
-
+ FontItalic eItalic = rFontSelData.GetSlant();
FontWeight eWeight = rFontSelData.GetWeight();
FontWidth eWidth = rFontSelData.GetWidthType();
-
- psp::pitch::type ePitch = psp::pitch::Unknown;
- if( rFontSelData.GetPitch() != PITCH_DONTKNOW )
- {
- switch( rFontSelData.GetPitch() )
- {
- case PITCH_FIXED: ePitch=psp::pitch::Fixed; break;
- case PITCH_VARIABLE: ePitch=psp::pitch::Variable; break;
- default:
- break;
- }
- }
+ FontPitch ePitch = rFontSelData.GetPitch();
const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
aRet.maSearchName = rMgr.Substitute( rFontSelData.maTargetName, rMissingCodes, aLangAttrib, eItalic, eWeight, eWidth, ePitch);
- switch (eItalic)
- {
- case psp::italic::Upright: aRet.meItalic = ITALIC_NONE; break;
- case psp::italic::Italic: aRet.meItalic = ITALIC_NORMAL; break;
- case psp::italic::Oblique: aRet.meItalic = ITALIC_OBLIQUE; break;
- default:
- break;
- }
-
+ aRet.meItalic = eItalic;
aRet.meWeight = eWeight;
aRet.meWidthType = eWidth;
-
- switch (ePitch)
- {
- case psp::pitch::Fixed: aRet.mePitch = PITCH_FIXED; break;
- case psp::pitch::Variable: aRet.mePitch = PITCH_VARIABLE; break;
- default:
- break;
- }
+ aRet.mePitch = ePitch;
return aRet;
}
commit f6db2eac0797b3b04923d785f7a11c6ee52919be
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date: Wed Apr 6 22:13:21 2011 +0200
Replaced psp::weight::type with FontWeight/finished psp::width::type cleanup
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 632e304..6d988d6 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -67,22 +67,6 @@ enum type {
};
}
-namespace width
-{
-enum type {
- Unknown = 0,
- UltraCondensed = 1,
- ExtraCondensed = 2,
- Condensed = 3,
- SemiCondensed = 4,
- Normal = 5,
- SemiExpanded = 6,
- Expanded = 7,
- ExtraExpanded = 8,
- UltraExpanded = 9
-};
-}
-
namespace pitch
{
enum type {
@@ -92,23 +76,6 @@ enum type {
};
}
-namespace weight
-{
-enum type {
- Unknown = 0,
- Thin = 1,
- UltraLight = 2,
- Light = 3,
- SemiLight = 4,
- Normal = 5,
- Medium = 6,
- SemiBold = 7,
- Bold = 8,
- UltraBold = 9,
- Black = 10
-};
-}
-
namespace family
{
enum type {
@@ -163,7 +130,7 @@ struct FastPrintFontInfo
family::type m_eFamilyStyle;
italic::type m_eItalic;
FontWidth m_eWidth;
- weight::type m_eWeight;
+ FontWeight m_eWeight;
pitch::type m_ePitch;
rtl_TextEncoding m_aEncoding;
bool m_bSubsettable;
@@ -175,7 +142,7 @@ struct FastPrintFontInfo
m_eFamilyStyle( family::Unknown ),
m_eItalic( italic::Unknown ),
m_eWidth( WIDTH_DONTKNOW ),
- m_eWeight( weight::Unknown ),
+ m_eWeight( WEIGHT_DONTKNOW ),
m_ePitch( pitch::Unknown ),
m_aEncoding( RTL_TEXTENCODING_DONTKNOW )
{}
@@ -277,7 +244,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
rtl::OUString m_aStyleName;
italic::type m_eItalic;
FontWidth m_eWidth;
- weight::type m_eWeight;
+ FontWeight m_eWeight;
pitch::type m_ePitch;
rtl_TextEncoding m_aEncoding;
bool m_bFontEncodingOnly; // set if font should be only accessed by builtin encoding
@@ -359,7 +326,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
rtl::OString aFamily;
rtl::OString aAddStyle;
italic::type eItalic;
- weight::type eWeight;
+ FontWeight eWeight;
FontWidth eWidth;
pitch::type ePitch;
rtl_TextEncoding aEncoding;
@@ -528,10 +495,10 @@ public:
}
// get a specific fonts weight type
- weight::type getFontWeight( fontID nFontID ) const
+ FontWeight getFontWeight( fontID nFontID ) const
{
PrintFont* pFont = getFont( nFontID );
- return pFont ? pFont->m_eWeight : weight::Unknown;
+ return pFont ? pFont->m_eWeight : WEIGHT_DONTKNOW;
}
// get a specific fonts pitch type
@@ -736,7 +703,7 @@ public:
ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)) const;
rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes,
- const rtl::OString& rLangAttrib, italic::type& rItalic, weight::type& rWeight,
+ const rtl::OString& rLangAttrib, italic::type& rItalic, FontWeight& rWeight,
FontWidth& rWidth, pitch::type& rPitch) const;
bool hasFontconfig() const { return m_bFontconfigSuccess; }
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 296cbc2..86ae4e2 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3405,15 +3405,15 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
}
// set weight
if( eWeight <= PANGO_WEIGHT_ULTRALIGHT )
- aInfo.m_eWeight = psp::weight::UltraLight;
+ aInfo.m_eWeight = WEIGHT_ULTRALIGHT;
else if( eWeight <= PANGO_WEIGHT_LIGHT )
- aInfo.m_eWeight = psp::weight::Light;
+ aInfo.m_eWeight = WEIGHT_LIGHT;
else if( eWeight <= PANGO_WEIGHT_NORMAL )
- aInfo.m_eWeight = psp::weight::Normal;
+ aInfo.m_eWeight = WEIGHT_NORMAL;
else if( eWeight <= PANGO_WEIGHT_BOLD )
- aInfo.m_eWeight = psp::weight::Bold;
+ aInfo.m_eWeight = WEIGHT_BOLD;
else
- aInfo.m_eWeight = psp::weight::UltraBold;
+ aInfo.m_eWeight = WEIGHT_ULTRABOLD;
// set width
switch( eStretch )
{
@@ -3452,8 +3452,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
nPointHeight = nPangoHeight/PANGO_SCALE;
Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
- if( aInfo.m_eWeight != psp::weight::Unknown )
- aFont.SetWeight( PspGraphics::ToFontWeight( aInfo.m_eWeight ) );
+ if( aInfo.m_eWeight != WEIGHT_DONTKNOW )
+ aFont.SetWeight( aInfo.m_eWeight );
if( aInfo.m_eWidth != WIDTH_DONTKNOW )
aFont.SetWidthType( aInfo.m_eWidth );
if( aInfo.m_eItalic != psp::italic::Unknown )
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index fa8b98f..8eab42a 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -730,7 +730,7 @@ sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel
}
int nWeight = (int)pEntry->meWeight;
int nRealWeight = (int)m_pPrinterGfx->GetFontMgr().getFontWeight( nID );
- if( nRealWeight <= (int)psp::weight::Medium && nWeight > (int)WEIGHT_MEDIUM )
+ if( nRealWeight <= (int)WEIGHT_MEDIUM && nWeight > (int)WEIGHT_MEDIUM )
{
bArtBold = true;
}
@@ -1078,25 +1078,6 @@ void PspGraphics::DoGetGlyphWidths( psp::fontID aFont,
// ----------------------------------------------------------------------------
-FontWeight PspGraphics::ToFontWeight (psp::weight::type eWeight)
-{
- switch (eWeight)
- {
- case psp::weight::Thin: return WEIGHT_THIN;
- case psp::weight::UltraLight: return WEIGHT_ULTRALIGHT;
- case psp::weight::Light: return WEIGHT_LIGHT;
- case psp::weight::SemiLight: return WEIGHT_SEMILIGHT;
- case psp::weight::Normal: return WEIGHT_NORMAL;
- case psp::weight::Medium: return WEIGHT_MEDIUM;
- case psp::weight::SemiBold: return WEIGHT_SEMIBOLD;
- case psp::weight::Bold: return WEIGHT_BOLD;
- case psp::weight::UltraBold: return WEIGHT_ULTRABOLD;
- case psp::weight::Black: return WEIGHT_BLACK;
- default: break;
- }
- return WEIGHT_DONTKNOW;
-}
-
FontPitch PspGraphics::ToFontPitch (psp::pitch::type ePitch)
{
switch (ePitch)
@@ -1141,7 +1122,7 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF
aDFA.maName = rInfo.m_aFamilyName;
aDFA.maStyleName = rInfo.m_aStyleName;
aDFA.meFamily = ToFontFamily (rInfo.m_eFamilyStyle);
- aDFA.meWeight = ToFontWeight (rInfo.m_eWeight);
+ aDFA.meWeight = rInfo.m_eWeight;
aDFA.meItalic = ToFontItalic (rInfo.m_eItalic);
aDFA.meWidthType = rInfo.m_eWidth;
aDFA.mePitch = ToFontPitch (rInfo.m_ePitch);
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index 0428bbb..4a0194d 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -79,7 +79,6 @@ public:
Ucs2UIntMap& rUnicodeEnc );
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontWeight ToFontWeight (psp::weight::type eWeight);
static FontPitch ToFontPitch (psp::pitch::type ePitch);
static FontItalic ToFontItalic (psp::italic::type eItalic);
static FontFamily ToFontFamily (psp::family::type eFamily);
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 25213f6..aed990a 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -77,7 +77,6 @@ public:
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontWeight ToFontWeight (psp::weight::type eWeight);
static FontPitch ToFontPitch (psp::pitch::type ePitch);
static FontItalic ToFontItalic (psp::italic::type eItalic);
static FontFamily ToFontFamily (psp::family::type eFamily);
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index ba1db46..7272ccc 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1766,15 +1766,15 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
// set weight
int nWeight = qFontInfo.weight();
if ( nWeight <= QFont::Light )
- aInfo.m_eWeight = psp::weight::Light;
+ aInfo.m_eWeight = WEIGHT_LIGHT;
else if ( nWeight <= QFont::Normal )
- aInfo.m_eWeight = psp::weight::Normal;
+ aInfo.m_eWeight = WEIGHT_NORMAL;
else if ( nWeight <= QFont::DemiBold )
- aInfo.m_eWeight = psp::weight::SemiBold;
+ aInfo.m_eWeight = WEIGHT_SEMIBOLD;
else if ( nWeight <= QFont::Bold )
- aInfo.m_eWeight = psp::weight::Bold;
+ aInfo.m_eWeight = WEIGHT_BOLD;
else
- aInfo.m_eWeight = psp::weight::UltraBold;
+ aInfo.m_eWeight = WEIGHT_ULTRABOLD;
// set width
int nStretch = rQFont.stretch();
@@ -1817,10 +1817,10 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
// Create the font
Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
- if( aInfo.m_eWeight != psp::weight::Unknown )
- aFont.SetWeight( PspGraphics::ToFontWeight( aInfo.m_eWeight ) );
+ if( aInfo.m_eWeight != WEIGHT_DONTKNOW )
+ aFont.SetWeight( aInfo.m_eWeight );
if( aInfo.m_eWidth != WIDTH_DONTKNOW )
- aFont.SetWidthType( PspGraphics::ToFontWidth( aInfo.m_eWidth ) );
+ aFont.SetWidthType( aInfo.m_eWidth );
if( aInfo.m_eItalic != psp::italic::Unknown )
aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
if( aInfo.m_ePitch != psp::pitch::Unknown )
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index ab6bf1a..3525e5d 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -107,36 +107,36 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
// set weight
int nWeight = qFontInfo.weight();
if ( nWeight <= QFont::Light )
- aInfo.m_eWeight = psp::weight::Light;
+ aInfo.m_eWeight = WEIGHT_LIGHT;
else if ( nWeight <= QFont::Normal )
- aInfo.m_eWeight = psp::weight::Normal;
+ aInfo.m_eWeight = WEIGHT_NORMAL;
else if ( nWeight <= QFont::DemiBold )
- aInfo.m_eWeight = psp::weight::SemiBold;
+ aInfo.m_eWeight = WEIGHT_SEMIBOLD;
else if ( nWeight <= QFont::Bold )
- aInfo.m_eWeight = psp::weight::Bold;
+ aInfo.m_eWeight = WEIGHT_BOLD;
else
- aInfo.m_eWeight = psp::weight::UltraBold;
+ aInfo.m_eWeight = WEIGHT_ULTRABOLD;
// set width
int nStretch = rQFont.stretch();
if ( nStretch <= QFont::UltraCondensed )
- aInfo.m_eWidth = psp::width::UltraCondensed;
+ aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;
else if ( nStretch <= QFont::ExtraCondensed )
- aInfo.m_eWidth = psp::width::ExtraCondensed;
+ aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;
else if ( nStretch <= QFont::Condensed )
- aInfo.m_eWidth = psp::width::Condensed;
+ aInfo.m_eWidth = WIDTH_CONDENSED;
else if ( nStretch <= QFont::SemiCondensed )
- aInfo.m_eWidth = psp::width::SemiCondensed;
+ aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;
else if ( nStretch <= QFont::Unstretched )
- aInfo.m_eWidth = psp::width::Normal;
+ aInfo.m_eWidth = WIDTH_NORMAL;
else if ( nStretch <= QFont::SemiExpanded )
- aInfo.m_eWidth = psp::width::SemiExpanded;
+ aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;
else if ( nStretch <= QFont::Expanded )
- aInfo.m_eWidth = psp::width::Expanded;
+ aInfo.m_eWidth = WIDTH_EXPANDED;
else if ( nStretch <= QFont::ExtraExpanded )
- aInfo.m_eWidth = psp::width::ExtraExpanded;
+ aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;
else
- aInfo.m_eWidth = psp::width::UltraExpanded;
+ aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "font name BEFORE system match: \"%s\"\n", OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
@@ -158,10 +158,10 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
// Create the font
Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
- if( aInfo.m_eWeight != psp::weight::Unknown )
- aFont.SetWeight( PspGraphics::ToFontWeight( aInfo.m_eWeight ) );
- if( aInfo.m_eWidth != psp::width::Unknown )
- aFont.SetWidthType( PspGraphics::ToFontWidth( aInfo.m_eWidth ) );
+ if( aInfo.m_eWeight != WEIGHT_DONTKNOW )
+ aFont.SetWeight( aInfo.m_eWeight );
+ if( aInfo.m_eWidth != WIDTH_DONTKNOW )
+ aFont.SetWidthType( aInfo.m_eWidth );
if( aInfo.m_eItalic != psp::italic::Unknown )
aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
if( aInfo.m_ePitch != psp::pitch::Unknown )
diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx
index c24d2d7..9cdf8dc 100644
--- a/vcl/unx/source/fontmanager/fontcache.cxx
+++ b/vcl/unx/source/fontmanager/fontcache.cxx
@@ -409,7 +409,7 @@ void FontCache::read()
int nCollEntry = atoi( pLine );
pFont->m_nPSName = pAtoms->getAtom( ATOM_PSNAME, OUString( pLine + nTokenPos[1], nTokenPos[2]-nTokenPos[1]-1, RTL_TEXTENCODING_UTF8 ), sal_True );
pFont->m_eItalic = (italic::type)atoi( pLine+nTokenPos[2] );
- pFont->m_eWeight = (weight::type)atoi( pLine+nTokenPos[3] );
+ pFont->m_eWeight = (FontWeight)atoi( pLine+nTokenPos[3] );
pFont->m_eWidth = (FontWidth)atoi( pLine+nTokenPos[4] );
pFont->m_ePitch = (pitch::type)atoi( pLine+nTokenPos[5] );
pFont->m_aEncoding = (rtl_TextEncoding)atoi( pLine+nTokenPos[6] );
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 904730d..d7be05d 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -751,28 +751,28 @@ bool PrintFontManager::initFontconfig()
namespace
{
- weight::type convertWeight(int weight)
+ FontWeight convertWeight(int weight)
{
// set weight
if( weight <= FC_WEIGHT_THIN )
- return weight::Thin;
+ return WEIGHT_THIN;
else if( weight <= FC_WEIGHT_ULTRALIGHT )
- return weight::UltraLight;
+ return WEIGHT_ULTRALIGHT;
else if( weight <= FC_WEIGHT_LIGHT )
- return weight::Light;
+ return WEIGHT_LIGHT;
else if( weight <= FC_WEIGHT_BOOK )
- return weight::SemiLight;
+ return WEIGHT_SEMILIGHT;
else if( weight <= FC_WEIGHT_NORMAL )
- return weight::Normal;
+ return WEIGHT_NORMAL;
else if( weight <= FC_WEIGHT_MEDIUM )
- return weight::Medium;
+ return WEIGHT_MEDIUM;
else if( weight <= FC_WEIGHT_SEMIBOLD )
- return weight::SemiBold;
+ return WEIGHT_SEMIBOLD;
else if( weight <= FC_WEIGHT_BOLD )
- return weight::Bold;
+ return WEIGHT_BOLD;
else if( weight <= FC_WEIGHT_ULTRABOLD )
- return weight::UltraBold;
- return weight::Black;
+ return WEIGHT_ULTRABOLD;
+ return WEIGHT_BLACK;
}
italic::type convertSlant(int slant)
@@ -1041,7 +1041,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
}
static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
- italic::type eItalic, weight::type eWeight, FontWidth eWidth, pitch::type ePitch)
+ italic::type eItalic, FontWeight eWeight, FontWidth eWidth, pitch::type ePitch)
{
if( eItalic != italic::Unknown )
{
@@ -1055,21 +1055,21 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
}
rWrapper.FcPatternAddInteger( pPattern, FC_SLANT, nSlant );
}
- if( eWeight != weight::Unknown )
+ if( eWeight != WEIGHT_DONTKNOW )
{
int nWeight = FC_WEIGHT_NORMAL;
switch( eWeight )
{
- case weight::Thin: nWeight = FC_WEIGHT_THIN;break;
- case weight::UltraLight: nWeight = FC_WEIGHT_ULTRALIGHT;break;
- case weight::Light: nWeight = FC_WEIGHT_LIGHT;break;
- case weight::SemiLight: nWeight = FC_WEIGHT_BOOK;break;
- case weight::Normal: nWeight = FC_WEIGHT_NORMAL;break;
- case weight::Medium: nWeight = FC_WEIGHT_MEDIUM;break;
- case weight::SemiBold: nWeight = FC_WEIGHT_SEMIBOLD;break;
- case weight::Bold: nWeight = FC_WEIGHT_BOLD;break;
- case weight::UltraBold: nWeight = FC_WEIGHT_ULTRABOLD;break;
- case weight::Black: nWeight = FC_WEIGHT_BLACK;break;
+ case WEIGHT_THIN: nWeight = FC_WEIGHT_THIN;break;
+ case WEIGHT_ULTRALIGHT: nWeight = FC_WEIGHT_ULTRALIGHT;break;
+ case WEIGHT_LIGHT: nWeight = FC_WEIGHT_LIGHT;break;
+ case WEIGHT_SEMILIGHT: nWeight = FC_WEIGHT_BOOK;break;
+ case WEIGHT_NORMAL: nWeight = FC_WEIGHT_NORMAL;break;
+ case WEIGHT_MEDIUM: nWeight = FC_WEIGHT_MEDIUM;break;
+ case WEIGHT_SEMIBOLD: nWeight = FC_WEIGHT_SEMIBOLD;break;
+ case WEIGHT_BOLD: nWeight = FC_WEIGHT_BOLD;break;
+ case WEIGHT_ULTRABOLD: nWeight = FC_WEIGHT_ULTRABOLD;break;
+ case WEIGHT_BLACK: nWeight = FC_WEIGHT_BLACK;break;
default:
break;
}
@@ -1112,7 +1112,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
rtl::OUString& rMissingCodes, const rtl::OString &rLangAttrib,
- italic::type &rItalic, weight::type &rWeight,
+ italic::type &rItalic, FontWeight &rWeight,
FontWidth &rWidth, pitch::type &rPitch) const
{
rtl::OUString aName;
@@ -1429,7 +1429,7 @@ int PrintFontManager::FreeTypeCharIndex( void*, sal_uInt32 )
}
rtl::OUString PrintFontManager::Substitute( const rtl::OUString&,
- rtl::OUString&, const rtl::OString&, italic::type, weight::type, FontWidth, pitch::type) const
+ rtl::OUString&, const rtl::OString&, italic::type, FontWeight, FontWidth, pitch::type) const
{
rtl::OUString aName;
return aName;
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index 864e911..e3c8983 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -149,40 +149,40 @@ static italic::type parseItalic( const ByteString& rItalic )
// -------------------------------------------------------------------------
-static weight::type parseWeight( const ByteString& rWeight )
+static FontWeight parseWeight( const ByteString& rWeight )
{
- weight::type eWeight = weight::Unknown;
+ FontWeight eWeight = WEIGHT_DONTKNOW;
if( rWeight.Search( "bold" ) != STRING_NOTFOUND )
{
if( rWeight.Search( "emi" ) != STRING_NOTFOUND ) // semi, demi
- eWeight = weight::SemiBold;
+ eWeight = WEIGHT_SEMIBOLD;
else if( rWeight.Search( "ultra" ) != STRING_NOTFOUND )
- eWeight = weight::UltraBold;
+ eWeight = WEIGHT_ULTRABOLD;
else
- eWeight = weight::Bold;
+ eWeight = WEIGHT_BOLD;
}
else if( rWeight.Search( "heavy" ) != STRING_NOTFOUND )
- eWeight = weight::Bold;
+ eWeight = WEIGHT_BOLD;
else if( rWeight.Search( "light" ) != STRING_NOTFOUND )
{
if( rWeight.Search( "emi" ) != STRING_NOTFOUND ) // semi, demi
- eWeight = weight::SemiLight;
+ eWeight = WEIGHT_SEMILIGHT;
else if( rWeight.Search( "ultra" ) != STRING_NOTFOUND )
- eWeight = weight::UltraLight;
+ eWeight = WEIGHT_ULTRALIGHT;
else
- eWeight = weight::Light;
+ eWeight = WEIGHT_LIGHT;
}
else if( rWeight.Search( "black" ) != STRING_NOTFOUND )
- eWeight = weight::Black;
+ eWeight = WEIGHT_BLACK;
else if( rWeight.Equals( "demi" ) )
- eWeight = weight::SemiBold;
+ eWeight = WEIGHT_SEMIBOLD;
else if( rWeight.Equals( "book" ) ||
rWeight.Equals( "semicondensed" ) )
- eWeight = weight::Light;
+ eWeight = WEIGHT_LIGHT;
else if( rWeight.Equals( "medium" ) || rWeight.Equals( "roman" ) )
- eWeight = weight::Medium;
+ eWeight = WEIGHT_MEDIUM;
else
- eWeight = weight::Normal;
+ eWeight = WEIGHT_NORMAL;
return eWeight;
}
@@ -358,7 +358,7 @@ PrintFontManager::PrintFont::PrintFont( fonttype::type eType ) :
m_nPSName( 0 ),
m_eItalic( italic::Unknown ),
m_eWidth( WIDTH_DONTKNOW ),
- m_eWeight( weight::Unknown ),
+ m_eWeight( WEIGHT_DONTKNOW ),
m_ePitch( pitch::Unknown ),
m_aEncoding( RTL_TEXTENCODING_DONTKNOW ),
m_bFontEncodingOnly( false ),
@@ -1695,16 +1695,16 @@ OString PrintFontManager::getXLFD( PrintFont* pFont ) const
aXLFD.append( '-' );
switch( pFont->m_eWeight )
{
- case weight::Thin: aXLFD.append("thin");break;
- case weight::UltraLight: aXLFD.append("ultralight");break;
- case weight::Light: aXLFD.append("light");break;
- case weight::SemiLight: aXLFD.append("semilight");break;
- case weight::Normal: aXLFD.append("normal");break;
- case weight::Medium: aXLFD.append("medium");break;
- case weight::SemiBold: aXLFD.append("semibold");break;
- case weight::Bold: aXLFD.append("bold");break;
- case weight::UltraBold: aXLFD.append("ultrabold");break;
- case weight::Black: aXLFD.append("black");break;
+ case WEIGHT_THIN: aXLFD.append("thin");break;
+ case WEIGHT_ULTRALIGHT: aXLFD.append("ultralight");break;
+ case WEIGHT_LIGHT: aXLFD.append("light");break;
+ case WEIGHT_SEMILIGHT: aXLFD.append("semilight");break;
+ case WEIGHT_NORMAL: aXLFD.append("normal");break;
+ case WEIGHT_MEDIUM: aXLFD.append("medium");break;
+ case WEIGHT_SEMIBOLD: aXLFD.append("semibold");break;
+ case WEIGHT_BOLD: aXLFD.append("bold");break;
+ case WEIGHT_ULTRABOLD: aXLFD.append("ultrabold");break;
+ case WEIGHT_BLACK: aXLFD.append("black");break;
default: break;
}
aXLFD.append('-');
@@ -1718,15 +1718,15 @@ OString PrintFontManager::getXLFD( PrintFont* pFont ) const
aXLFD.append('-');
switch( pFont->m_eWidth )
{
- case width::UltraCondensed: aXLFD.append("ultracondensed");break;
- case width::ExtraCondensed: aXLFD.append("extracondensed");break;
- case width::Condensed: aXLFD.append("condensed");break;
- case width::SemiCondensed: aXLFD.append("semicondensed");break;
- case width::Normal: aXLFD.append("normal");break;
- case width::SemiExpanded: aXLFD.append("semiexpanded");break;
- case width::Expanded: aXLFD.append("expanded");break;
- case width::ExtraExpanded: aXLFD.append("extraexpanded");break;
- case width::UltraExpanded: aXLFD.append("ultraexpanded");break;
+ case WIDTH_ULTRA_CONDENSED: aXLFD.append("ultracondensed");break;
+ case WIDTH_EXTRA_CONDENSED: aXLFD.append("extracondensed");break;
+ case WIDTH_CONDENSED: aXLFD.append("condensed");break;
+ case WIDTH_SEMI_CONDENSED: aXLFD.append("semicondensed");break;
+ case WIDTH_NORMAL: aXLFD.append("normal");break;
+ case WIDTH_SEMI_EXPANDED: aXLFD.append("semiexpanded");break;
+ case WIDTH_EXPANDED: aXLFD.append("expanded");break;
+ case WIDTH_EXTRA_EXPANDED: aXLFD.append("extraexpanded");break;
+ case WIDTH_ULTRA_EXPANDED: aXLFD.append("ultraexpanded");break;
default: break;
}
aXLFD.append("-utf8-0-0-0-0-");
@@ -1947,17 +1947,17 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const
pFont->m_nPSName = m_pAtoms->getAtom( ATOM_PSNAME, String( ByteString( aInfo.psname ), aEncoding ), sal_True );
switch( aInfo.weight )
{
- case FW_THIN: pFont->m_eWeight = weight::Thin; break;
- case FW_EXTRALIGHT: pFont->m_eWeight = weight::UltraLight; break;
- case FW_LIGHT: pFont->m_eWeight = weight::Light; break;
- case FW_MEDIUM: pFont->m_eWeight = weight::Medium; break;
- case FW_SEMIBOLD: pFont->m_eWeight = weight::SemiBold; break;
- case FW_BOLD: pFont->m_eWeight = weight::Bold; break;
- case FW_EXTRABOLD: pFont->m_eWeight = weight::UltraBold; break;
- case FW_BLACK: pFont->m_eWeight = weight::Black; break;
+ case FW_THIN: pFont->m_eWeight = WEIGHT_THIN; break;
+ case FW_EXTRALIGHT: pFont->m_eWeight = WEIGHT_ULTRALIGHT; break;
+ case FW_LIGHT: pFont->m_eWeight = WEIGHT_LIGHT; break;
+ case FW_MEDIUM: pFont->m_eWeight = WEIGHT_MEDIUM; break;
+ case FW_SEMIBOLD: pFont->m_eWeight = WEIGHT_SEMIBOLD; break;
+ case FW_BOLD: pFont->m_eWeight = WEIGHT_BOLD; break;
+ case FW_EXTRABOLD: pFont->m_eWeight = WEIGHT_ULTRABOLD; break;
+ case FW_BLACK: pFont->m_eWeight = WEIGHT_BLACK; break;
case FW_NORMAL:
- default: pFont->m_eWeight = weight::Normal; break;
+ default: pFont->m_eWeight = WEIGHT_NORMAL; break;
}
switch( aInfo.width )
@@ -2466,7 +2466,7 @@ equalPitch (psp::pitch::type from, psp::pitch::type to)
}
inline bool
-equalWeight (psp::weight::type from, psp::weight::type to)
+equalWeight (FontWeight from, FontWeight to)
{
return from > to ? (from - to) <= 3 : (to - from) <= 3;
}
@@ -2491,13 +2491,13 @@ namespace {
{
OUString aFamily;
italic::type eItalic;
- weight::type eWeight;
+ FontWeight eWeight;
pitch::type ePitch;
rtl_TextEncoding aEncoding;
BuiltinFontIdentifier( const OUString& rFam,
italic::type eIt,
- weight::type eWg,
+ FontWeight eWg,
pitch::type ePt,
rtl_TextEncoding enc ) :
aFamily( rFam ),
@@ -4018,7 +4018,7 @@ bool PrintFontManager::readOverrideMetrics()
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Width" ) ) )
pFont->m_eWidth = static_cast<FontWidth>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Weight" ) ) )
- pFont->m_eWeight = static_cast<weight::type>(getInt(pProps[n].Value));
+ pFont->m_eWeight = static_cast<FontWeight>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Pitch" ) ) )
pFont->m_ePitch = static_cast<pitch::type>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encoding" ) ) )
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 68c1492..296af59 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -816,7 +816,7 @@ sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel
}
int nWeight = (int)pEntry->meWeight;
int nRealWeight = (int)m_pPrinterGfx->GetFontMgr().getFontWeight( nID );
- if( nRealWeight <= (int)psp::weight::Medium && nWeight > (int)WEIGHT_MEDIUM )
+ if( nRealWeight <= (int)WEIGHT_MEDIUM && nWeight > (int)WEIGHT_MEDIUM )
{
bArtBold = true;
}
@@ -1180,28 +1180,6 @@ void PspGraphics::DoGetGlyphWidths( psp::fontID aFont,
}
// ----------------------------------------------------------------------------
-FontWeight PspGraphics::ToFontWeight (psp::weight::type eWeight)
-{
- switch (eWeight)
- {
- case psp::weight::Thin: return WEIGHT_THIN;
- case psp::weight::UltraLight: return WEIGHT_ULTRALIGHT;
- case psp::weight::Light: return WEIGHT_LIGHT;
- case psp::weight::SemiLight: return WEIGHT_SEMILIGHT;
- case psp::weight::Normal: return WEIGHT_NORMAL;
- case psp::weight::Medium: return WEIGHT_MEDIUM;
- case psp::weight::SemiBold: return WEIGHT_SEMIBOLD;
- case psp::weight::Bold: return WEIGHT_BOLD;
- case psp::weight::UltraBold: return WEIGHT_ULTRABOLD;
- case psp::weight::Black: return WEIGHT_BLACK;
- case psp::weight::Unknown: return WEIGHT_DONTKNOW;
- default:
- OSL_FAIL( "unknown weight mapping" );
- break;
- }
- return WEIGHT_DONTKNOW;
-}
-
FontPitch PspGraphics::ToFontPitch (psp::pitch::type ePitch)
{
switch (ePitch)
@@ -1255,7 +1233,7 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF
aDFA.maName = rInfo.m_aFamilyName;
aDFA.maStyleName = rInfo.m_aStyleName;
aDFA.meFamily = ToFontFamily (rInfo.m_eFamilyStyle);
- aDFA.meWeight = ToFontWeight (rInfo.m_eWeight);
+ aDFA.meWeight = rInfo.m_eWeight;
aDFA.meItalic = ToFontItalic (rInfo.m_eItalic);
aDFA.meWidthType = rInfo.m_eWidth;
aDFA.mePitch = ToFontPitch (rInfo.m_ePitch);
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 6642898..aaa3c74 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -1123,42 +1123,7 @@ ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, in
break;
}
// set weight
- switch( rFontAttributes.GetWeight() )
- {
- case WEIGHT_THIN:
- aInfo.m_eWeight = psp::weight::Thin;
- break;
- case WEIGHT_ULTRALIGHT:
- aInfo.m_eWeight = psp::weight::UltraLight;
- break;
- case WEIGHT_LIGHT:
- aInfo.m_eWeight = psp::weight::Light;
- break;
- case WEIGHT_SEMILIGHT:
- aInfo.m_eWeight = psp::weight::SemiLight;
- break;
- case WEIGHT_NORMAL:
- aInfo.m_eWeight = psp::weight::Normal;
- break;
- case WEIGHT_MEDIUM:
- aInfo.m_eWeight = psp::weight::Medium;
- break;
- case WEIGHT_SEMIBOLD:
- aInfo.m_eWeight = psp::weight::SemiBold;
- break;
- case WEIGHT_BOLD:
- aInfo.m_eWeight = psp::weight::Bold;
- break;
- case WEIGHT_ULTRABOLD:
- aInfo.m_eWeight = psp::weight::UltraBold;
- break;
- case WEIGHT_BLACK:
- aInfo.m_eWeight = psp::weight::Black;
- break;
- default:
- aInfo.m_eWeight = psp::weight::Unknown;
- break;
- }
+ aInfo.m_eWeight = rFontAttributes.GetWeight();
// set width
aInfo.m_eWidth = rFontAttributes.GetWidthType();
@@ -1443,44 +1408,8 @@ static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData
}
}
- psp::weight::type eWeight = psp::weight::Unknown;
- if( rFontSelData.GetWeight() != WEIGHT_DONTKNOW )
- {
- switch( rFontSelData.GetWeight() )
- {
- case WEIGHT_THIN: eWeight = psp::weight::Thin; break;
- case WEIGHT_ULTRALIGHT: eWeight = psp::weight::UltraLight; break;
- case WEIGHT_LIGHT: eWeight = psp::weight::Light; break;
- case WEIGHT_SEMILIGHT: eWeight = psp::weight::SemiLight; break;
- case WEIGHT_NORMAL: eWeight = psp::weight::Normal; break;
- case WEIGHT_MEDIUM: eWeight = psp::weight::Medium; break;
- case WEIGHT_SEMIBOLD: eWeight = psp::weight::SemiBold; break;
- case WEIGHT_BOLD: eWeight = psp::weight::Bold; break;
- case WEIGHT_ULTRABOLD: eWeight = psp::weight::UltraBold; break;
- case WEIGHT_BLACK: eWeight = psp::weight::Black; break;
- default:
- break;
- }
- }
-
+ FontWeight eWeight = rFontSelData.GetWeight();
FontWidth eWidth = rFontSelData.GetWidthType();
-// if( rFontSelData.GetWidthType() != WIDTH_DONTKNOW )
-// {
-// switch( rFontSelData.GetWidthType() )
-// {
-// case WIDTH_ULTRA_CONDENSED: eWidth = psp::width::UltraCondensed; break;
-// case WIDTH_EXTRA_CONDENSED: eWidth = psp::width::ExtraCondensed; break;
-// case WIDTH_CONDENSED: eWidth = psp::width::Condensed; break;
-// case WIDTH_SEMI_CONDENSED: eWidth = psp::width::SemiCondensed; break;
-// case WIDTH_NORMAL: eWidth = psp::width::Normal; break;
-// case WIDTH_SEMI_EXPANDED: eWidth = psp::width::SemiExpanded; break;
-// case WIDTH_EXPANDED: eWidth = psp::width::Expanded; break;
-// case WIDTH_EXTRA_EXPANDED: eWidth = psp::width::ExtraExpanded; break;
-// case WIDTH_ULTRA_EXPANDED: eWidth = psp::width::UltraExpanded; break;
-// default:
-// break;
-// }
-// }
psp::pitch::type ePitch = psp::pitch::Unknown;
if( rFontSelData.GetPitch() != PITCH_DONTKNOW )
@@ -1506,37 +1435,8 @@ static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData
break;
}
- switch (eWeight)
- {
- case psp::weight::Thin: aRet.meWeight = WEIGHT_THIN; break;
- case psp::weight::UltraLight: aRet.meWeight = WEIGHT_ULTRALIGHT; break;
- case psp::weight::Light: aRet.meWeight = WEIGHT_LIGHT; break;
- case psp::weight::SemiLight: aRet.meWeight = WEIGHT_SEMILIGHT; break;
- case psp::weight::Normal: aRet.meWeight = WEIGHT_NORMAL; break;
- case psp::weight::Medium: aRet.meWeight = WEIGHT_MEDIUM; break;
- case psp::weight::SemiBold: aRet.meWeight = WEIGHT_SEMIBOLD; break;
- case psp::weight::Bold: aRet.meWeight = WEIGHT_BOLD; break;
- case psp::weight::UltraBold: aRet.meWeight = WEIGHT_ULTRABOLD; break;
- case psp::weight::Black: aRet.meWeight = WEIGHT_BLACK; break;
- default:
- break;
- }
-
+ aRet.meWeight = eWeight;
aRet.meWidthType = eWidth;
-// switch (eWidth)
-// {
-// case psp::width::UltraCondensed: aRet.meWidthType = WIDTH_ULTRA_CONDENSED; break;
-// case psp::width::ExtraCondensed: aRet.meWidthType = WIDTH_EXTRA_CONDENSED; break;
-// case psp::width::Condensed: aRet.meWidthType = WIDTH_CONDENSED; break;
-// case psp::width::SemiCondensed: aRet.meWidthType = WIDTH_SEMI_CONDENSED; break;
-// case psp::width::Normal: aRet.meWidthType = WIDTH_NORMAL; break;
-// case psp::width::SemiExpanded: aRet.meWidthType = WIDTH_SEMI_EXPANDED; break;
-// case psp::width::Expanded: aRet.meWidthType = WIDTH_EXPANDED; break;
-// case psp::width::ExtraExpanded: aRet.meWidthType = WIDTH_EXTRA_EXPANDED; break;
-// case psp::width::UltraExpanded: aRet.meWidthType = WIDTH_ULTRA_EXPANDED; break;
-// default:
-// break;
-// }
switch (ePitch)
{
commit 944a11c1750f09de52d7623b313e3fd4ace56747
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date: Tue Apr 5 20:54:37 2011 +0200
Replaced psp::width::type with FontWidth
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index bb03bc3..632e304 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -36,7 +36,7 @@
#include "vcl/dllapi.h"
#include "vcl/helper.hxx"
-
+#include "vcl/vclenum.hxx"
#include "com/sun/star/lang/Locale.hpp"
#include <vector>
@@ -162,7 +162,7 @@ struct FastPrintFontInfo
std::list< rtl::OUString > m_aAliases;
family::type m_eFamilyStyle;
italic::type m_eItalic;
- width::type m_eWidth;
+ FontWidth m_eWidth;
weight::type m_eWeight;
pitch::type m_ePitch;
rtl_TextEncoding m_aEncoding;
@@ -174,7 +174,7 @@ struct FastPrintFontInfo
m_eType( fonttype::Unknown ),
m_eFamilyStyle( family::Unknown ),
m_eItalic( italic::Unknown ),
- m_eWidth( width::Unknown ),
+ m_eWidth( WIDTH_DONTKNOW ),
m_eWeight( weight::Unknown ),
m_ePitch( pitch::Unknown ),
m_aEncoding( RTL_TEXTENCODING_DONTKNOW )
@@ -276,7 +276,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
int m_nPSName; // atom
rtl::OUString m_aStyleName;
italic::type m_eItalic;
- width::type m_eWidth;
+ FontWidth m_eWidth;
weight::type m_eWeight;
pitch::type m_ePitch;
rtl_TextEncoding m_aEncoding;
@@ -360,7 +360,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
rtl::OString aAddStyle;
italic::type eItalic;
weight::type eWeight;
- width::type eWidth;
+ FontWidth eWidth;
pitch::type ePitch;
rtl_TextEncoding aEncoding;
@@ -521,10 +521,10 @@ public:
}
// get a specific fonts width type
- width::type getFontWidth( fontID nFontID ) const
+ FontWidth getFontWidth( fontID nFontID ) const
{
PrintFont* pFont = getFont( nFontID );
- return pFont ? pFont->m_eWidth : width::Unknown;
+ return pFont ? pFont->m_eWidth : WIDTH_DONTKNOW;
}
// get a specific fonts weight type
@@ -737,7 +737,7 @@ public:
rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes,
const rtl::OString& rLangAttrib, italic::type& rItalic, weight::type& rWeight,
- width::type& rWidth, pitch::type& rPitch) const;
+ FontWidth& rWidth, pitch::type& rPitch) const;
bool hasFontconfig() const { return m_bFontconfigSuccess; }
int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index e1d12ce..296cbc2 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -45,6 +45,7 @@
#include "saldata.hxx"
#include "saldisp.hxx"
#include "vcl/svapp.hxx"
+#include "vcl/vclenum.hxx"
typedef struct _cairo_font_options cairo_font_options_t;
@@ -3416,15 +3417,15 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// set width
switch( eStretch )
{
- case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = psp::width::UltraCondensed;break;
- case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = psp::width::ExtraCondensed;break;
- case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = psp::width::Condensed;break;
- case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = psp::width::SemiCondensed;break;
- case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = psp::width::Normal;break;
- case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = psp::width::SemiExpanded;break;
- case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = psp::width::Expanded;break;
- case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = psp::width::ExtraExpanded;break;
- case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = psp::width::UltraExpanded;break;
+ case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;break;
+ case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;break;
+ case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = WIDTH_CONDENSED;break;
+ case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;break;
+ case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = WIDTH_NORMAL;break;
+ case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;break;
+ case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = WIDTH_EXPANDED;break;
+ case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;break;
+ case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;break;
}
#if OSL_DEBUG_LEVEL > 1
@@ -3453,8 +3454,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
if( aInfo.m_eWeight != psp::weight::Unknown )
aFont.SetWeight( PspGraphics::ToFontWeight( aInfo.m_eWeight ) );
- if( aInfo.m_eWidth != psp::width::Unknown )
- aFont.SetWidthType( PspGraphics::ToFontWidth( aInfo.m_eWidth ) );
+ if( aInfo.m_eWidth != WIDTH_DONTKNOW )
+ aFont.SetWidthType( aInfo.m_eWidth );
if( aInfo.m_eItalic != psp::italic::Unknown )
aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
if( aInfo.m_ePitch != psp::pitch::Unknown )
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 2ddbff1..fa8b98f 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -1078,24 +1078,6 @@ void PspGraphics::DoGetGlyphWidths( psp::fontID aFont,
// ----------------------------------------------------------------------------
-FontWidth PspGraphics::ToFontWidth (psp::width::type eWidth)
-{
- switch (eWidth)
- {
- case psp::width::UltraCondensed: return WIDTH_ULTRA_CONDENSED;
- case psp::width::ExtraCondensed: return WIDTH_EXTRA_CONDENSED;
- case psp::width::Condensed: return WIDTH_CONDENSED;
- case psp::width::SemiCondensed: return WIDTH_SEMI_CONDENSED;
- case psp::width::Normal: return WIDTH_NORMAL;
- case psp::width::SemiExpanded: return WIDTH_SEMI_EXPANDED;
- case psp::width::Expanded: return WIDTH_EXPANDED;
- case psp::width::ExtraExpanded: return WIDTH_EXTRA_EXPANDED;
- case psp::width::UltraExpanded: return WIDTH_ULTRA_EXPANDED;
- default: break;
- }
- return WIDTH_DONTKNOW;
-}
-
FontWeight PspGraphics::ToFontWeight (psp::weight::type eWeight)
{
switch (eWeight)
@@ -1161,7 +1143,7 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF
aDFA.meFamily = ToFontFamily (rInfo.m_eFamilyStyle);
aDFA.meWeight = ToFontWeight (rInfo.m_eWeight);
aDFA.meItalic = ToFontItalic (rInfo.m_eItalic);
- aDFA.meWidthType = ToFontWidth (rInfo.m_eWidth);
+ aDFA.meWidthType = rInfo.m_eWidth;
aDFA.mePitch = ToFontPitch (rInfo.m_ePitch);
aDFA.mbSymbolFlag = (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL);
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index a1371fd..0428bbb 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -79,7 +79,6 @@ public:
Ucs2UIntMap& rUnicodeEnc );
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontWidth ToFontWidth (psp::width::type eWidth);
static FontWeight ToFontWeight (psp::weight::type eWeight);
static FontPitch ToFontPitch (psp::pitch::type ePitch);
static FontItalic ToFontItalic (psp::italic::type eItalic);
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 717adbd..25213f6 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -34,6 +34,7 @@
#include "vcl/salgdi.hxx"
#include "vcl/sallayout.hxx"
#include "vcl/dllapi.h"
+#include "vcl/vclenum.hxx"
namespace psp { struct JobData; class PrinterGfx; }
@@ -76,7 +77,6 @@ public:
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontWidth ToFontWidth (psp::width::type eWidth);
static FontWeight ToFontWeight (psp::weight::type eWeight);
static FontPitch ToFontPitch (psp::pitch::type ePitch);
static FontItalic ToFontItalic (psp::italic::type eItalic);
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index f92687c..ba1db46 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -40,6 +40,7 @@
#include <salframe.h>
#include <vcl/settings.hxx>
+#include <vcl/vclenum.hxx>
#include <rtl/ustrbuf.hxx>
#include <plugins/kde/kdedata.hxx>
#include <iostream>
@@ -1778,23 +1779,23 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
// set width
int nStretch = rQFont.stretch();
if ( nStretch <= QFont::UltraCondensed )
- aInfo.m_eWidth = psp::width::UltraCondensed;
+ aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;
else if ( nStretch <= QFont::ExtraCondensed )
- aInfo.m_eWidth = psp::width::ExtraCondensed;
+ aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;
else if ( nStretch <= QFont::Condensed )
- aInfo.m_eWidth = psp::width::Condensed;
+ aInfo.m_eWidth = WIDTH_CONDENSED;
else if ( nStretch <= QFont::SemiCondensed )
- aInfo.m_eWidth = psp::width::SemiCondensed;
+ aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;
else if ( nStretch <= QFont::Unstretched )
- aInfo.m_eWidth = psp::width::Normal;
+ aInfo.m_eWidth = WIDTH_NORMAL;
else if ( nStretch <= QFont::SemiExpanded )
- aInfo.m_eWidth = psp::width::SemiExpanded;
+ aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;
else if ( nStretch <= QFont::Expanded )
- aInfo.m_eWidth = psp::width::Expanded;
+ aInfo.m_eWidth = WIDTH_EXPANDED;
else if ( nStretch <= QFont::ExtraExpanded )
- aInfo.m_eWidth = psp::width::ExtraExpanded;
+ aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;
else
- aInfo.m_eWidth = psp::width::UltraExpanded;
+ aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "font name BEFORE system match: \"%s\"\n", OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
@@ -1818,7 +1819,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
if( aInfo.m_eWeight != psp::weight::Unknown )
aFont.SetWeight( PspGraphics::ToFontWeight( aInfo.m_eWeight ) );
- if( aInfo.m_eWidth != psp::width::Unknown )
+ if( aInfo.m_eWidth != WIDTH_DONTKNOW )
aFont.SetWidthType( PspGraphics::ToFontWidth( aInfo.m_eWidth ) );
if( aInfo.m_eItalic != psp::italic::Unknown )
aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx
index b322761..c24d2d7 100644
--- a/vcl/unx/source/fontmanager/fontcache.cxx
+++ b/vcl/unx/source/fontmanager/fontcache.cxx
@@ -410,7 +410,7 @@ void FontCache::read()
pFont->m_nPSName = pAtoms->getAtom( ATOM_PSNAME, OUString( pLine + nTokenPos[1], nTokenPos[2]-nTokenPos[1]-1, RTL_TEXTENCODING_UTF8 ), sal_True );
pFont->m_eItalic = (italic::type)atoi( pLine+nTokenPos[2] );
pFont->m_eWeight = (weight::type)atoi( pLine+nTokenPos[3] );
- pFont->m_eWidth = (width::type)atoi( pLine+nTokenPos[4] );
+ pFont->m_eWidth = (FontWidth)atoi( pLine+nTokenPos[4] );
pFont->m_ePitch = (pitch::type)atoi( pLine+nTokenPos[5] );
pFont->m_aEncoding = (rtl_TextEncoding)atoi( pLine+nTokenPos[6] );
pFont->m_nAscend = atoi( pLine + nTokenPos[7] );
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 34afcd4..904730d 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -32,6 +32,7 @@
#include "vcl/fontmanager.hxx"
#include "vcl/fontcache.hxx"
#include "vcl/impfont.hxx"
+#include "vcl/vclenum.hxx"
using namespace psp;
@@ -792,25 +793,26 @@ namespace
return pitch::Variable;
}
- width::type convertWidth(int width)
+ // translation: fontconfig enum -> vcl enum
+ FontWidth convertWidth(int width)
{
if (width == FC_WIDTH_ULTRACONDENSED)
- return width::UltraCondensed;
+ return WIDTH_ULTRA_CONDENSED;
else if (width == FC_WIDTH_EXTRACONDENSED)
- return width::ExtraCondensed;
+ return WIDTH_EXTRA_CONDENSED;
else if (width == FC_WIDTH_CONDENSED)
- return width::Condensed;
+ return WIDTH_CONDENSED;
else if (width == FC_WIDTH_SEMICONDENSED)
- return width::SemiCondensed;
+ return WIDTH_SEMI_CONDENSED;
else if (width == FC_WIDTH_SEMIEXPANDED)
- return width::SemiExpanded;
+ return WIDTH_SEMI_EXPANDED;
else if (width == FC_WIDTH_EXPANDED)
- return width::Expanded;
+ return WIDTH_EXPANDED;
else if (width == FC_WIDTH_EXTRAEXPANDED)
- return width::ExtraExpanded;
+ return WIDTH_EXTRA_EXPANDED;
else if (width == FC_WIDTH_ULTRAEXPANDED)
- return width::UltraExpanded;
- return width::Normal;
+ return WIDTH_ULTRA_EXPANDED;
+ return WIDTH_NORMAL;
}
}
@@ -1039,7 +1041,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
}
static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
- italic::type eItalic, weight::type eWeight, width::type eWidth, pitch::type ePitch)
+ italic::type eItalic, weight::type eWeight, FontWidth eWidth, pitch::type ePitch)
{
if( eItalic != italic::Unknown )
{
@@ -1073,20 +1075,20 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
}
rWrapper.FcPatternAddInteger( pPattern, FC_WEIGHT, nWeight );
}
- if( eWidth != width::Unknown )
+ if( eWidth != WIDTH_DONTKNOW )
{
int nWidth = FC_WIDTH_NORMAL;
switch( eWidth )
{
- case width::UltraCondensed: nWidth = FC_WIDTH_ULTRACONDENSED;break;
- case width::ExtraCondensed: nWidth = FC_WIDTH_EXTRACONDENSED;break;
- case width::Condensed: nWidth = FC_WIDTH_CONDENSED;break;
- case width::SemiCondensed: nWidth = FC_WIDTH_SEMICONDENSED;break;
- case width::Normal: nWidth = FC_WIDTH_NORMAL;break;
- case width::SemiExpanded: nWidth = FC_WIDTH_SEMIEXPANDED;break;
- case width::Expanded: nWidth = FC_WIDTH_EXPANDED;break;
- case width::ExtraExpanded: nWidth = FC_WIDTH_EXTRAEXPANDED;break;
- case width::UltraExpanded: nWidth = FC_WIDTH_ULTRACONDENSED;break;
+ case WIDTH_ULTRA_CONDENSED: nWidth = FC_WIDTH_ULTRACONDENSED;break;
+ case WIDTH_EXTRA_CONDENSED: nWidth = FC_WIDTH_EXTRACONDENSED;break;
+ case WIDTH_CONDENSED: nWidth = FC_WIDTH_CONDENSED;break;
+ case WIDTH_SEMI_CONDENSED: nWidth = FC_WIDTH_SEMICONDENSED;break;
+ case WIDTH_NORMAL: nWidth = FC_WIDTH_NORMAL;break;
+ case WIDTH_SEMI_EXPANDED: nWidth = FC_WIDTH_SEMIEXPANDED;break;
+ case WIDTH_EXPANDED: nWidth = FC_WIDTH_EXPANDED;break;
+ case WIDTH_EXTRA_EXPANDED: nWidth = FC_WIDTH_EXTRAEXPANDED;break;
+ case WIDTH_ULTRA_EXPANDED: nWidth = FC_WIDTH_ULTRACONDENSED;break;
default:
break;
}
@@ -1111,7 +1113,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
rtl::OUString& rMissingCodes, const rtl::OString &rLangAttrib,
italic::type &rItalic, weight::type &rWeight,
- width::type &rWidth, pitch::type &rPitch) const
+ FontWidth &rWidth, pitch::type &rPitch) const
{
rtl::OUString aName;
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
@@ -1427,7 +1429,7 @@ int PrintFontManager::FreeTypeCharIndex( void*, sal_uInt32 )
}
rtl::OUString PrintFontManager::Substitute( const rtl::OUString&,
- rtl::OUString&, const rtl::OString&, italic::type, weight::type, width::type, pitch::type) const
+ rtl::OUString&, const rtl::OString&, italic::type, weight::type, FontWidth, pitch::type) const
{
rtl::OUString aName;
return aName;
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index c418bec..864e911 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -188,30 +188,30 @@ static weight::type parseWeight( const ByteString& rWeight )
// -------------------------------------------------------------------------
-static width::type parseWidth( const ByteString& rWidth )
+static FontWidth parseWidth( const ByteString& rWidth )
{
- width::type eWidth = width::Unknown;
+ FontWidth eWidth = WIDTH_DONTKNOW;
if( rWidth.Equals( "bold" ) ||
rWidth.Equals( "semiexpanded" ) )
- eWidth = width::SemiExpanded;
+ eWidth = WIDTH_SEMI_EXPANDED;
else if( rWidth.Equals( "condensed" ) ||
rWidth.Equals( "narrow" ) )
- eWidth = width::Condensed;
+ eWidth = WIDTH_CONDENSED;
else if( rWidth.Equals( "double wide" ) ||
rWidth.Equals( "extraexpanded" ) ||
rWidth.Equals( "ultraexpanded" ) )
- eWidth = width::UltraExpanded;
+ eWidth = WIDTH_ULTRA_EXPANDED;
else if( rWidth.Equals( "expanded" ) ||
rWidth.Equals( "wide" ) )
- eWidth = width::Expanded;
+ eWidth = WIDTH_EXPANDED;
else if( rWidth.Equals( "extracondensed" ) )
- eWidth = width::ExtraCondensed;
+ eWidth = WIDTH_EXTRA_CONDENSED;
else if( rWidth.Equals( "semicondensed" ) )
- eWidth = width::SemiCondensed;
+ eWidth = WIDTH_SEMI_CONDENSED;
else if( rWidth.Equals( "ultracondensed" ) )
- eWidth = width::UltraCondensed;
+ eWidth = WIDTH_ULTRA_CONDENSED;
else
- eWidth = width::Normal;
+ eWidth = WIDTH_NORMAL;
return eWidth;
}
@@ -357,7 +357,7 @@ PrintFontManager::PrintFont::PrintFont( fonttype::type eType ) :
m_nFamilyName( 0 ),
m_nPSName( 0 ),
m_eItalic( italic::Unknown ),
- m_eWidth( width::Unknown ),
+ m_eWidth( WIDTH_DONTKNOW ),
m_eWeight( weight::Unknown ),
m_ePitch( pitch::Unknown ),
m_aEncoding( RTL_TEXTENCODING_DONTKNOW ),
@@ -1962,17 +1962,17 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const
switch( aInfo.width )
{
- case FWIDTH_ULTRA_CONDENSED: pFont->m_eWidth = width::UltraCondensed; break;
- case FWIDTH_EXTRA_CONDENSED: pFont->m_eWidth = width::ExtraCondensed; break;
- case FWIDTH_CONDENSED: pFont->m_eWidth = width::Condensed; break;
- case FWIDTH_SEMI_CONDENSED: pFont->m_eWidth = width::SemiCondensed; break;
- case FWIDTH_SEMI_EXPANDED: pFont->m_eWidth = width::SemiExpanded; break;
- case FWIDTH_EXPANDED: pFont->m_eWidth = width::Expanded; break;
- case FWIDTH_EXTRA_EXPANDED: pFont->m_eWidth = width::ExtraExpanded; break;
- case FWIDTH_ULTRA_EXPANDED: pFont->m_eWidth = width::UltraExpanded; break;
+ case FWIDTH_ULTRA_CONDENSED: pFont->m_eWidth = WIDTH_ULTRA_CONDENSED; break;
+ case FWIDTH_EXTRA_CONDENSED: pFont->m_eWidth = WIDTH_EXTRA_CONDENSED; break;
+ case FWIDTH_CONDENSED: pFont->m_eWidth = WIDTH_CONDENSED; break;
+ case FWIDTH_SEMI_CONDENSED: pFont->m_eWidth = WIDTH_SEMI_CONDENSED; break;
+ case FWIDTH_SEMI_EXPANDED: pFont->m_eWidth = WIDTH_SEMI_EXPANDED; break;
+ case FWIDTH_EXPANDED: pFont->m_eWidth = WIDTH_EXPANDED; break;
+ case FWIDTH_EXTRA_EXPANDED: pFont->m_eWidth = WIDTH_EXTRA_EXPANDED; break;
+ case FWIDTH_ULTRA_EXPANDED: pFont->m_eWidth = WIDTH_ULTRA_EXPANDED; break;
case FWIDTH_NORMAL:
- default: pFont->m_eWidth = width::Normal; break;
+ default: pFont->m_eWidth = WIDTH_NORMAL; break;
}
pFont->m_ePitch = aInfo.pitch ? pitch::Fixed : pitch::Variable;
@@ -4016,7 +4016,7 @@ bool PrintFontManager::readOverrideMetrics()
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Italic" ) ) )
pFont->m_eItalic = static_cast<italic::type>(getInt(pProps[n].Value));
else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Width" ) ) )
- pFont->m_eWidth = static_cast<width::type>(getInt(pProps[n].Value));
+ pFont->m_eWidth = static_cast<FontWidth>(getInt(pProps[n].Value));
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list