diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2015-12-31 14:30:49 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2015-12-31 11:11:55 +0000 |
commit | a74a04f98180edc577d31598bc88990d41ef02c7 (patch) | |
tree | 99398ef1ab9af05eb39d4a56d234f901d8368048 /vcl/generic | |
parent | 23ae179392ace4d5b23b152675c60722beddfdab (diff) |
vcl: create accessor functions for ImplDevFontAttributes
Change-Id: I0494a1db1a1e5c164bd5da2d0a221a8db6c494d6
Reviewed-on: https://gerrit.libreoffice.org/21016
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.cxx | 8 | ||||
-rw-r--r-- | vcl/generic/print/genpspgraphics.cxx | 34 |
2 files changed, 18 insertions, 24 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index 36b967f374c9..e9a0c9e870a2 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -209,9 +209,9 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes, mpGlyph2Char( nullptr ) { // prefer font with low ID - maDevFontAttributes.mnQuality += 10000 - nFontId; + maDevFontAttributes.IncreaseQualityBy( 10000 - nFontId ); // prefer font with matching file names - maDevFontAttributes.mnQuality += mpFontFile->GetLangBoost(); + maDevFontAttributes.IncreaseQualityBy( mpFontFile->GetLangBoost() ); } FtFontInfo::~FtFontInfo() @@ -423,8 +423,8 @@ ImplFTSFontData::ImplFTSFontData( FtFontInfo* pFI, const ImplDevFontAttributes& : PhysicalFontFace( rDFA, IFTSFONT_MAGIC ), mpFtFontInfo( pFI ) { - mbDevice = false; - mbOrientation = true; + SetBuiltInFontFlag( false ); + SetOrientationFlag( true ); } ImplFontEntry* ImplFTSFontData::CreateFontInstance( FontSelectPattern& rFSD ) const diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx index 149f687308d3..ea55bf946dfa 100644 --- a/vcl/generic/print/genpspgraphics.cxx +++ b/vcl/generic/print/genpspgraphics.cxx @@ -878,7 +878,7 @@ bool GenPspGraphics::AddTempDevFontHelper( PhysicalFontCollection* pFontCollecti // inform glyph cache of new font ImplDevFontAttributes aDFA = GenPspGraphics::Info2DevFontAttributes( aInfo ); - aDFA.mnQuality += 5800; + aDFA.IncreaseQualityBy( 5800 ); int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID ); @@ -921,7 +921,7 @@ void GenPspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) { ImplDevFontAttributes aDFA = Info2DevFontAttributes( aInfo ); static_cast<ImplFontAttributes&>(*pMetric) = aDFA; - pMetric->mbDevice = aDFA.mbDevice; + pMetric->mbDevice = aDFA.IsBuiltInFont(); pMetric->mbScalableFont = true; pMetric->mbTrueTypeFont = false; // FIXME, needed? @@ -1093,40 +1093,34 @@ ImplDevFontAttributes GenPspGraphics::Info2DevFontAttributes( const psp::FastPri aDFA.SetWidthType( rInfo.m_eWidth ); aDFA.SetPitch( rInfo.m_ePitch ); aDFA.SetSymbolFlag( (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL) ); - aDFA.mbSubsettable = rInfo.m_bSubsettable; - aDFA.mbEmbeddable = rInfo.m_bEmbeddable; + aDFA.SetSubsettableFlag( rInfo.m_bSubsettable ); + aDFA.SetEmbeddableFlag( rInfo.m_bEmbeddable ); switch( rInfo.m_eType ) { case psp::fonttype::TrueType: - aDFA.mnQuality = 512; - aDFA.mbDevice = false; + aDFA.SetQuality( 512 ); + aDFA.SetBuiltInFontFlag( false ); break; case psp::fonttype::Type1: - aDFA.mnQuality = 0; - aDFA.mbDevice = false; + aDFA.SetQuality( 0 ); + aDFA.SetBuiltInFontFlag( false ); break; default: - aDFA.mnQuality = 0; - aDFA.mbDevice = false; + aDFA.SetQuality( 0 ); + aDFA.SetBuiltInFontFlag( false ); break; } - aDFA.mbOrientation = true; + aDFA.SetOrientationFlag( true ); // add font family name aliases ::std::list< OUString >::const_iterator it = rInfo.m_aAliases.begin(); - bool bHasMapNames = false; for(; it != rInfo.m_aAliases.end(); ++it ) - { - if( bHasMapNames ) - aDFA.maMapNames += ";"; - aDFA.maMapNames += *it; - bHasMapNames = true; - } + aDFA.AddMapName( *it ); #if OSL_DEBUG_LEVEL > 2 - if( bHasMapNames ) + if( aDFA.HasMapNames() ) { OString aOrigName(OUStringToOString(aDFA.GetFamilyName(), osl_getThreadTextEncoding())); OString aAliasNames(OUStringToOString(aDFA.GetAliasNames(), osl_getThreadTextEncoding())); @@ -1186,7 +1180,7 @@ void GenPspGraphics::AnnounceFonts( PhysicalFontCollection* pFontCollection, con } ImplPspFontData* pFD = new ImplPspFontData( aInfo ); - pFD->mnQuality += nQuality; + pFD->IncreaseQualityBy( nQuality ); pFontCollection->Add( pFD ); } |