From d7d2c6b53eacfe4e0270d6f61b3ae20047e99d35 Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sun, 3 Jan 2016 18:17:44 +1100 Subject: vcl: rename variables from metric names to font attribute names Change-Id: Ib0a3d82af858304bf63a20bcb30b8de741491935 Reviewed-on: https://gerrit.libreoffice.org/21054 Reviewed-by: Chris Sherlock Tested-by: Chris Sherlock --- vcl/generic/glyphs/gcach_ftyp.cxx | 2 +- vcl/generic/print/genpspgraphics.cxx | 24 +++++----- vcl/headless/svptext.cxx | 4 +- vcl/inc/cairotextrender.hxx | 2 +- vcl/inc/generic/genpspgraphics.h | 2 +- vcl/inc/generic/glyphcache.hxx | 14 +++--- vcl/inc/headless/svpgdi.hxx | 2 +- vcl/inc/outfont.hxx | 14 +++--- vcl/inc/quartz/salgdi.h | 4 +- vcl/inc/salgdi.hxx | 2 +- vcl/inc/textrender.hxx | 2 +- vcl/inc/unx/salgdi.h | 2 +- vcl/inc/win/salgdi.h | 2 +- vcl/quartz/ctfonts.cxx | 18 +++---- vcl/quartz/salgdi.cxx | 4 +- vcl/source/gdi/pdfwriter_impl.cxx | 84 ++++++++++++++++----------------- vcl/source/gdi/print.cxx | 2 +- vcl/source/gdi/virdev.cxx | 4 +- vcl/source/outdev/font.cxx | 76 ++++++++++++++--------------- vcl/source/outdev/text.cxx | 8 ++-- vcl/source/outdev/textline.cxx | 62 ++++++++++++------------ vcl/unx/generic/gdi/cairotextrender.cxx | 4 +- vcl/unx/generic/gdi/salgdi3.cxx | 4 +- vcl/win/gdi/salgdi3.cxx | 58 +++++++++++------------ vcl/win/gdi/winlayout.cxx | 2 +- 25 files changed, 201 insertions(+), 201 deletions(-) (limited to 'vcl') diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index 093f06d4d393..05a530e762eb 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -608,7 +608,7 @@ ServerFont::~ServerFont() } -void ServerFont::FetchFontMetric( ImplFontAttributes& rTo, long& rFactor ) const +void ServerFont::FetchFontAttributes( ImplFontAttributes& rTo, long& rFactor ) const { static_cast(rTo) = mpFontInfo->GetFontAttributes(); diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx index f8eb7ed11782..fa9cac54dc06 100644 --- a/vcl/generic/print/genpspgraphics.cxx +++ b/vcl/generic/print/genpspgraphics.cxx @@ -911,7 +911,7 @@ void GenPspGraphics::ClearDevFontCache() GlyphCache::GetInstance().ClearFontCache(); } -void GenPspGraphics::GetFontMetric( ImplFontAttributes *pMetric, int ) +void GenPspGraphics::GetFontAttributes( ImplFontAttributes *pFontAttributes, int ) { const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); psp::PrintFontInfo aInfo; @@ -919,24 +919,24 @@ void GenPspGraphics::GetFontMetric( ImplFontAttributes *pMetric, int ) if (rMgr.getFontInfo (m_pPrinterGfx->GetFontID(), aInfo)) { ImplFontAttributes aDFA = Info2FontAttributes( aInfo ); - static_cast(*pMetric) = aDFA; - pMetric->SetBuiltInFontFlag( aDFA.IsBuiltInFont() ); - pMetric->SetScalableFlag( true ); - pMetric->SetTrueTypeFlag( false ); // FIXME, needed? + static_cast(*pFontAttributes) = aDFA; + pFontAttributes->SetBuiltInFontFlag( aDFA.IsBuiltInFont() ); + pFontAttributes->SetScalableFlag( true ); + pFontAttributes->SetTrueTypeFlag( false ); // FIXME, needed? - pMetric->SetOrientation( m_pPrinterGfx->GetFontAngle() ); - pMetric->SetSlant( 0 ); + pFontAttributes->SetOrientation( m_pPrinterGfx->GetFontAngle() ); + pFontAttributes->SetSlant( 0 ); sal_Int32 nTextHeight = m_pPrinterGfx->GetFontHeight(); sal_Int32 nTextWidth = m_pPrinterGfx->GetFontWidth(); if( ! nTextWidth ) nTextWidth = nTextHeight; - pMetric->SetWidth( nTextWidth ); - pMetric->SetAscent( ( aInfo.m_nAscend * nTextHeight + 500 ) / 1000 ); - pMetric->SetDescent( ( aInfo.m_nDescend * nTextHeight + 500 ) / 1000 ); - pMetric->SetInternalLeading( ( aInfo.m_nLeading * nTextHeight + 500 ) / 1000 ); - pMetric->SetExternalLeading( 0 ); + pFontAttributes->SetWidth( nTextWidth ); + pFontAttributes->SetAscent( ( aInfo.m_nAscend * nTextHeight + 500 ) / 1000 ); + pFontAttributes->SetDescent( ( aInfo.m_nDescend * nTextHeight + 500 ) / 1000 ); + pFontAttributes->SetInternalLeading( ( aInfo.m_nLeading * nTextHeight + 500 ) / 1000 ); + pFontAttributes->SetExternalLeading( 0 ); } } diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 3eb6e9295465..785461d1fc39 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -27,9 +27,9 @@ sal_uInt16 SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel return m_aTextRenderImpl.SetFont(pIFSD, nFallbackLevel); } -void SvpSalGraphics::GetFontMetric( ImplFontAttributes* pMetric, int nFallbackLevel ) +void SvpSalGraphics::GetFontAttributes( ImplFontAttributes* pFontAttributes, int nFallbackLevel ) { - m_aTextRenderImpl.GetFontMetric(pMetric, nFallbackLevel); + m_aTextRenderImpl.GetFontAttributes(pFontAttributes, nFallbackLevel); } const FontCharMapPtr SvpSalGraphics::GetFontCharMap() const diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx index 87a501f080d4..081dab334f57 100644 --- a/vcl/inc/cairotextrender.hxx +++ b/vcl/inc/cairotextrender.hxx @@ -91,7 +91,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel ) override; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h index 286e84bbe14d..c1227b7fd0da 100644 --- a/vcl/inc/generic/genpspgraphics.h +++ b/vcl/inc/generic/genpspgraphics.h @@ -92,7 +92,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel ) override; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx index 9ead91b0ade3..8b6f538180ed 100644 --- a/vcl/inc/generic/glyphcache.hxx +++ b/vcl/inc/generic/glyphcache.hxx @@ -126,18 +126,18 @@ class GlyphData public: GlyphData() : mnLruValue(0) {} - const GlyphMetric& GetMetric() const { return maMetric; } + const GlyphMetric& GetMetric() const { return maFontAttributes; } - void SetSize( const Size& s) { maMetric.SetSize( s ); } - void SetOffset( int nX, int nY ) { maMetric.SetOffset( nX, nY ); } - void SetDelta( int nX, int nY ) { maMetric.SetDelta( nX, nY ); } - void SetCharWidth( long nW ) { maMetric.SetCharWidth( nW ); } + void SetSize( const Size& s) { maFontAttributes.SetSize( s ); } + void SetOffset( int nX, int nY ) { maFontAttributes.SetOffset( nX, nY ); } + void SetDelta( int nX, int nY ) { maFontAttributes.SetDelta( nX, nY ); } + void SetCharWidth( long nW ) { maFontAttributes.SetCharWidth( nW ); } void SetLruValue( int n ) const { mnLruValue = n; } long GetLruValue() const { return mnLruValue;} private: - GlyphMetric maMetric; + GlyphMetric maFontAttributes; // used by GlyphCache for cache LRU algorithm mutable long mnLruValue; @@ -160,7 +160,7 @@ public: const FontSelectPattern& GetFontSelData() const { return maFontSelData; } - void FetchFontMetric( ImplFontAttributes&, long& rFactor ) const; + void FetchFontAttributes( ImplFontAttributes&, long& rFactor ) const; const unsigned char* GetTable( const char* pName, sal_uLong* pLength ); int GetEmUnits() const { return maFaceFT->units_per_EM;} double GetStretch() { return mfStretch; } diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index d3ed113f0bcf..e6a6c648a758 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -121,7 +121,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel ) override; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx index bba74b6c9e50..14922fcfe33d 100644 --- a/vcl/inc/outfont.hxx +++ b/vcl/inc/outfont.hxx @@ -306,16 +306,16 @@ public: public: // TODO: make data members private ImplFontCache * m_pFontCache; - FontSelectPattern maFontSelData; // FontSelectionData - ImplFontAttributes maMetric; // Font Metric - const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol + FontSelectPattern maFontSelData; // FontSelectionData + ImplFontAttributes maFontAttributes; // Font attributes + const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol long mnLineHeight; sal_uLong mnRefCount; - sal_uInt16 mnSetFontFlags; // Flags returned by SalGraphics::SetFont() - short mnOwnOrientation; // text angle if lower layers don't rotate text themselves - short mnOrientation; // text angle in 3600 system - bool mbInit; // true if maMetric member is valid + sal_uInt16 mnSetFontFlags; // Flags returned by SalGraphics::SetFont() + short mnOwnOrientation; // text angle if lower layers don't rotate text themselves + short mnOrientation; // text angle in 3600 system + bool mbInit; // true if maFontAttributes member is valid void AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName ); bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, OUString* pFontName ) const; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 8b78337743ef..d128950c1942 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -94,7 +94,7 @@ public: SalLayout* GetTextLayout( void ) const; - void GetFontMetric( ImplFontAttributes& ) const; + void GetFontAttributes( ImplFontAttributes& ) const; bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const; bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const; @@ -338,7 +338,7 @@ public: // set the font virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; // get the current font's metrics - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel ) override; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel ) override; // get the repertoire of the current font virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index f3c105f3148f..c8c5a6c4c5b1 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -145,7 +145,7 @@ public: void ReleaseFonts() { SetFont( nullptr, 0 ); } // get the current font's metrics - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel = 0 ) = 0; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel = 0 ) = 0; // get the repertoire of the current font virtual const FontCharMapPtr GetFontCharMap() const = 0; diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 938acaba4c76..9bea19f558f5 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -45,7 +45,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) = 0; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) = 0; - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel ) = 0; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel ) = 0; virtual const FontCharMapPtr GetFontCharMap() const = 0; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0; virtual void GetDevFontList( PhysicalFontCollection* ) = 0; diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 9f93d18337e2..59a5dc43bd59 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -114,7 +114,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel ) override; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index f822d9a2f81b..096c84f4af6e 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -363,7 +363,7 @@ public: // set the font virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; // get the current font's metrics - virtual void GetFontMetric( ImplFontAttributes*, int nFallbackLevel ) override; + virtual void GetFontAttributes( ImplFontAttributes*, int nFallbackLevel ) override; // get the repertoire of the current font virtual const FontCharMapPtr GetFontCharMap() const override; // get the layout capabilities of the current font diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 7e97cae775e6..531b23e52d8d 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -116,7 +116,7 @@ CoreTextStyle::~CoreTextStyle() CFRelease( mpStyleDict ); } -void CoreTextStyle::GetFontMetric( ImplFontAttributes& rMetric ) const +void CoreTextStyle::GetFontAttributes( ImplFontAttributes& rFontAttributes ) const { // get the matching CoreText font handle // TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it here? @@ -124,20 +124,20 @@ void CoreTextStyle::GetFontMetric( ImplFontAttributes& rMetric ) const const CGFloat fAscent = CTFontGetAscent( aCTFontRef ); const CGFloat fCapHeight = CTFontGetCapHeight( aCTFontRef ); - rMetric.SetAscent( lrint( fAscent ) ); - rMetric.SetDescent( lrint( CTFontGetDescent( aCTFontRef )) ); - rMetric.SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) ); - rMetric.SetInternalLeading( lrint( fAscent - fCapHeight ) ); + rFontAttributes.SetAscent( lrint( fAscent ) ); + rFontAttributes.SetDescent( lrint( CTFontGetDescent( aCTFontRef )) ); + rFontAttributes.SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) ); + rFontAttributes.SetInternalLeading( lrint( fAscent - fCapHeight ) ); // since ImplFontAttributes::mnWidth is only used for stretching/squeezing fonts // setting this width to the pixel height of the fontsize is good enough // it also makes the calculation of the stretch factor simple - rMetric.SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) ); + rFontAttributes.SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) ); // all CoreText fonts are scalable - rMetric.SetScalableFlag( true ); - rMetric.SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far - rMetric.SetKernableFlag( true ); + rFontAttributes.SetScalableFlag( true ); + rFontAttributes.SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far + rFontAttributes.SetKernableFlag( true ); } bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index ad373cef3c84..c36eacf1da08 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -305,9 +305,9 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor ) // SAL_ DEBUG(std::hex << nSalColor << std::dec << "={" << maTextColor.GetRed() << ", " << maTextColor.GetGreen() << ", " << maTextColor.GetBlue() << ", " << maTextColor.GetAlpha() << "}"); } -void AquaSalGraphics::GetFontMetric( ImplFontAttributes* pMetric, int /*nFallbackLevel*/ ) +void AquaSalGraphics::GetFontAttributes( ImplFontAttributes* pFontAttributes, int /*nFallbackLevel*/ ) { - mpTextStyle->GetFontMetric( *pMetric ); + mpTextStyle->GetFontAttributes( *pFontAttributes ); } static bool AddTempDevFont(const OUString& rFontFileURL) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index b423a392fd13..7a53504552d5 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9167,18 +9167,18 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool Point aOffset = Point(0,0); if ( nEmphMark & EMPHASISMARK_POS_BELOW ) - aOffset.Y() += m_pReferenceDevice->mpFontEntry->maMetric.GetDescent() + nEmphYOff; + aOffset.Y() += m_pReferenceDevice->mpFontEntry->maFontAttributes.GetDescent() + nEmphYOff; else - aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maMetric.GetAscent() + nEmphYOff; + aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maFontAttributes.GetAscent() + nEmphYOff; long nEmphWidth2 = nEmphWidth / 2; long nEmphHeight2 = nEmphHeight / 2; aOffset += Point( nEmphWidth2, nEmphHeight2 ); if ( eAlign == ALIGN_BOTTOM ) - aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maMetric.GetDescent(); + aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maFontAttributes.GetDescent(); else if ( eAlign == ALIGN_TOP ) - aOffset.Y() += m_pReferenceDevice->mpFontEntry->maMetric.GetAscent(); + aOffset.Y() += m_pReferenceDevice->mpFontEntry->maFontAttributes.GetAscent(); for( int nStart = 0;;) { @@ -9496,17 +9496,17 @@ void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontUnd if ( bIsAbove ) { - if ( !pFontEntry->maMetric.GetAboveWavelineUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetAboveWavelineUnderlineSize() ) m_pReferenceDevice->ImplInitAboveTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetAboveWavelineUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetAboveWavelineUnderlineOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetAboveWavelineUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetAboveWavelineUnderlineOffset() ); } else { - if ( !pFontEntry->maMetric.GetWavelineUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetWavelineUnderlineSize() ) m_pReferenceDevice->ImplInitTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetWavelineUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetWavelineUnderlineOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetWavelineUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetWavelineUnderlineOffset() ); } if ( (eTextLine == UNDERLINE_SMALLWAVE) && (nLineHeight > 3) ) nLineHeight = 3; @@ -9575,17 +9575,17 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon case UNDERLINE_DASHDOTDOT: if ( bIsAbove ) { - if ( !pFontEntry->maMetric.GetAboveUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetAboveUnderlineSize() ) m_pReferenceDevice->ImplInitAboveTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetAboveUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetAboveUnderlineOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetAboveUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetAboveUnderlineOffset() ); } else { - if ( !pFontEntry->maMetric.GetUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetUnderlineSize() ) m_pReferenceDevice->ImplInitTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetUnderlineOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetUnderlineOffset() ); } break; case UNDERLINE_BOLD: @@ -9596,36 +9596,36 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon case UNDERLINE_BOLDDASHDOTDOT: if ( bIsAbove ) { - if ( !pFontEntry->maMetric.GetAboveBoldUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetAboveBoldUnderlineSize() ) m_pReferenceDevice->ImplInitAboveTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetAboveBoldUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetAboveBoldUnderlineOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetAboveBoldUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetAboveBoldUnderlineOffset() ); } else { - if ( !pFontEntry->maMetric.GetBoldUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetBoldUnderlineSize() ) m_pReferenceDevice->ImplInitTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetBoldUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetBoldUnderlineOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetBoldUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetBoldUnderlineOffset() ); nLinePos += nLineHeight/2; } break; case UNDERLINE_DOUBLE: if ( bIsAbove ) { - if ( !pFontEntry->maMetric.GetAboveDoubleUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetAboveDoubleUnderlineSize() ) m_pReferenceDevice->ImplInitAboveTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetAboveDoubleUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetAboveDoubleUnderlineOffset1() ); - nLinePos2 = HCONV( pFontEntry->maMetric.GetAboveDoubleUnderlineOffset2() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetAboveDoubleUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetAboveDoubleUnderlineOffset1() ); + nLinePos2 = HCONV( pFontEntry->maFontAttributes.GetAboveDoubleUnderlineOffset2() ); } else { - if ( !pFontEntry->maMetric.GetDoubleUnderlineSize() ) + if ( !pFontEntry->maFontAttributes.GetDoubleUnderlineSize() ) m_pReferenceDevice->ImplInitTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetDoubleUnderlineSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetDoubleUnderlineOffset1() ); - nLinePos2 = HCONV( pFontEntry->maMetric.GetDoubleUnderlineOffset2() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetDoubleUnderlineSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetDoubleUnderlineOffset1() ); + nLinePos2 = HCONV( pFontEntry->maFontAttributes.GetDoubleUnderlineOffset2() ); } break; default: @@ -9738,23 +9738,23 @@ void PDFWriterImpl::drawStrikeoutLine( OStringBuffer& aLine, long nWidth, FontSt switch ( eStrikeout ) { case STRIKEOUT_SINGLE: - if ( !pFontEntry->maMetric.GetStrikeoutSize() ) + if ( !pFontEntry->maFontAttributes.GetStrikeoutSize() ) m_pReferenceDevice->ImplInitTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetStrikeoutSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetStrikeoutOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetStrikeoutSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetStrikeoutOffset() ); break; case STRIKEOUT_BOLD: - if ( !pFontEntry->maMetric.GetBoldStrikeoutSize() ) + if ( !pFontEntry->maFontAttributes.GetBoldStrikeoutSize() ) m_pReferenceDevice->ImplInitTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetBoldStrikeoutSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetBoldStrikeoutOffset() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetBoldStrikeoutSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetBoldStrikeoutOffset() ); break; case STRIKEOUT_DOUBLE: - if ( !pFontEntry->maMetric.GetDoubleStrikeoutSize() ) + if ( !pFontEntry->maFontAttributes.GetDoubleStrikeoutSize() ) m_pReferenceDevice->ImplInitTextLineSize(); - nLineHeight = HCONV( pFontEntry->maMetric.GetDoubleStrikeoutSize() ); - nLinePos = HCONV( pFontEntry->maMetric.GetDoubleStrikeoutOffset1() ); - nLinePos2 = HCONV( pFontEntry->maMetric.GetDoubleStrikeoutOffset2() ); + nLineHeight = HCONV( pFontEntry->maFontAttributes.GetDoubleStrikeoutSize() ); + nLinePos = HCONV( pFontEntry->maFontAttributes.GetDoubleStrikeoutOffset1() ); + nLinePos2 = HCONV( pFontEntry->maFontAttributes.GetDoubleStrikeoutOffset2() ); break; default: break; @@ -9875,9 +9875,9 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, long nWidth, FontStrikeout Point aPos( rPos ); TextAlign eAlign = m_aCurrentPDFState.m_aFont.GetAlign(); if( eAlign == ALIGN_TOP ) - aPos.Y() += HCONV( pFontEntry->maMetric.GetAscent() ); + aPos.Y() += HCONV( pFontEntry->maFontAttributes.GetAscent() ); else if( eAlign == ALIGN_BOTTOM ) - aPos.Y() -= HCONV( pFontEntry->maMetric.GetDescent() ); + aPos.Y() -= HCONV( pFontEntry->maFontAttributes.GetDescent() ); OStringBuffer aLine( 512 ); // save GS diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 7511d59d19b8..38d9c71d369e 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1817,7 +1817,7 @@ void Printer::InitFont() const void Printer::SetFontOrientation( ImplFontEntry* const pFontEntry ) const { - pFontEntry->mnOrientation = pFontEntry->maMetric.GetOrientation(); + pFontEntry->mnOrientation = pFontEntry->maFontAttributes.GetOrientation(); } void Printer::DrawImage( const Point&, const Image&, DrawImageFlags ) diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 1e210cbf25c2..4f493b4e9d47 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -564,9 +564,9 @@ long VirtualDevice::GetFontExtLeading() const #endif ImplFontEntry* pEntry = mpFontEntry; - ImplFontAttributes* pMetric = &(pEntry->maMetric); + ImplFontAttributes* pFontAttributes = &(pEntry->maFontAttributes); - return pMetric->GetExternalLeading(); + return pFontAttributes->GetExternalLeading(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index b4dcd2a6e415..099827aabc9c 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -188,43 +188,43 @@ FontMetric OutputDevice::GetFontMetric() const return aMetric; ImplFontEntry* pEntry = mpFontEntry; - ImplFontAttributes* pMetric = &(pEntry->maMetric); + ImplFontAttributes* pFontAttributes = &(pEntry->maFontAttributes); // prepare metric aMetric.Font::operator=( maFont ); // set aMetric with info from font aMetric.SetName( maFont.GetName() ); - aMetric.SetStyleName( pMetric->GetStyleName() ); - aMetric.SetSize( PixelToLogic( Size( pMetric->GetWidth(), pMetric->GetAscent()+pMetric->GetDescent() - pMetric->GetInternalLeading() ) ) ); - aMetric.SetCharSet( pMetric->IsSymbolFont() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); - aMetric.SetFamily( pMetric->GetFamilyType() ); - aMetric.SetPitch( pMetric->GetPitch() ); - aMetric.SetWeight( pMetric->GetWeight() ); - aMetric.SetItalic( pMetric->GetSlantType() ); - aMetric.SetWidthType( pMetric->GetWidthType() ); + aMetric.SetStyleName( pFontAttributes->GetStyleName() ); + aMetric.SetSize( PixelToLogic( Size( pFontAttributes->GetWidth(), pFontAttributes->GetAscent() + pFontAttributes->GetDescent() - pFontAttributes->GetInternalLeading() ) ) ); + aMetric.SetCharSet( pFontAttributes->IsSymbolFont() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); + aMetric.SetFamily( pFontAttributes->GetFamilyType() ); + aMetric.SetPitch( pFontAttributes->GetPitch() ); + aMetric.SetWeight( pFontAttributes->GetWeight() ); + aMetric.SetItalic( pFontAttributes->GetSlantType() ); + aMetric.SetWidthType( pFontAttributes->GetWidthType() ); if ( pEntry->mnOwnOrientation ) aMetric.SetOrientation( pEntry->mnOwnOrientation ); else - aMetric.SetOrientation( pMetric->GetOrientation() ); - if( !pEntry->maMetric.IsKernable() ) + aMetric.SetOrientation( pFontAttributes->GetOrientation() ); + if( !pEntry->maFontAttributes.IsKernable() ) aMetric.SetKerning( maFont.GetKerning() & ~FontKerning::FontSpecific ); // set remaining metric fields aMetric.mpImplMetric->mnMiscFlags = 0; - if( pMetric->IsBuiltInFont() ) + if( pFontAttributes->IsBuiltInFont() ) aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::DEVICE_FLAG; - if( pMetric->IsScalable() ) + if( pFontAttributes->IsScalable() ) aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::SCALABLE_FLAG; - if ( pMetric->IsFullstopCentered()) + if( pFontAttributes->IsFullstopCentered()) aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::FULLSTOP_CENTERED_FLAG; - aMetric.mpImplMetric->mnBulletOffset = pMetric->GetBulletOffset(); - aMetric.mpImplMetric->mnAscent = ImplDevicePixelToLogicHeight( pMetric->GetAscent() + mnEmphasisAscent ); - aMetric.mpImplMetric->mnDescent = ImplDevicePixelToLogicHeight( pMetric->GetDescent() + mnEmphasisDescent ); - aMetric.mpImplMetric->mnIntLeading = ImplDevicePixelToLogicHeight( pMetric->GetInternalLeading() + mnEmphasisAscent ); + aMetric.mpImplMetric->mnBulletOffset = pFontAttributes->GetBulletOffset(); + aMetric.mpImplMetric->mnAscent = ImplDevicePixelToLogicHeight( pFontAttributes->GetAscent() + mnEmphasisAscent ); + aMetric.mpImplMetric->mnDescent = ImplDevicePixelToLogicHeight( pFontAttributes->GetDescent() + mnEmphasisDescent ); + aMetric.mpImplMetric->mnIntLeading = ImplDevicePixelToLogicHeight( pFontAttributes->GetInternalLeading() + mnEmphasisAscent ); aMetric.mpImplMetric->mnExtLeading = ImplDevicePixelToLogicHeight( GetFontExtLeading() ); - aMetric.mpImplMetric->mnLineHeight = ImplDevicePixelToLogicHeight( pMetric->GetAscent() + pMetric->GetDescent() + mnEmphasisAscent + mnEmphasisDescent ); - aMetric.mpImplMetric->mnSlant = ImplDevicePixelToLogicHeight( pMetric->GetSlant() ); + aMetric.mpImplMetric->mnLineHeight = ImplDevicePixelToLogicHeight( pFontAttributes->GetAscent() + pFontAttributes->GetDescent() + mnEmphasisAscent + mnEmphasisDescent ); + aMetric.mpImplMetric->mnSlant = ImplDevicePixelToLogicHeight( pFontAttributes->GetSlant() ); SAL_INFO("vcl.gdi.fontmetric", "OutputDevice::GetFontMetric:" << aMetric); @@ -484,9 +484,9 @@ FontEmphasisMark OutputDevice::ImplGetEmphasisMarkStyle( const vcl::Font& rFont long OutputDevice::GetFontExtLeading() const { ImplFontEntry* pEntry = mpFontEntry; - ImplFontAttributes* pMetric = &(pEntry->maMetric); + ImplFontAttributes* pFontAttributes = &(pEntry->maFontAttributes); - return pMetric->GetExternalLeading(); + return pFontAttributes->GetExternalLeading(); } void OutputDevice::ImplClearFontData( const bool bNewFontLists ) @@ -980,7 +980,7 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan ImplFontEntry::ImplFontEntry( const FontSelectPattern& rFontSelData ) : m_pFontCache(nullptr) , maFontSelData( rFontSelData ) - , maMetric( rFontSelData ) + , maFontAttributes( rFontSelData ) , mpConversion( nullptr ) , mnLineHeight( 0 ) , mnRefCount( 1 ) @@ -1598,13 +1598,13 @@ bool OutputDevice::ImplNewFont() const { pFontEntry->mbInit = true; - pFontEntry->maMetric.SetOrientation( sal::static_int_cast(pFontEntry->maFontSelData.mnOrientation) ); - pGraphics->GetFontMetric( &(pFontEntry->maMetric) ); + pFontEntry->maFontAttributes.SetOrientation( sal::static_int_cast(pFontEntry->maFontSelData.mnOrientation) ); + pGraphics->GetFontAttributes( &(pFontEntry->maFontAttributes) ); - pFontEntry->maMetric.ImplInitTextLineSize( this ); - pFontEntry->maMetric.ImplInitAboveTextLineSize(); + pFontEntry->maFontAttributes.ImplInitTextLineSize( this ); + pFontEntry->maFontAttributes.ImplInitAboveTextLineSize(); - pFontEntry->mnLineHeight = pFontEntry->maMetric.GetAscent() + pFontEntry->maMetric.GetDescent(); + pFontEntry->mnLineHeight = pFontEntry->maFontAttributes.GetAscent() + pFontEntry->maFontAttributes.GetDescent(); SetFontOrientation( pFontEntry ); } @@ -1614,7 +1614,7 @@ bool OutputDevice::ImplNewFont() const if ( maFont.GetKerning() & FontKerning::FontSpecific ) { // TODO: test if physical font supports kerning and disable if not - if( pFontEntry->maMetric.IsKernable() ) + if( pFontEntry->maFontAttributes.IsKernable() ) mbKerning = true; } else @@ -1650,7 +1650,7 @@ bool OutputDevice::ImplNewFont() const else if ( eAlign == ALIGN_TOP ) { mnTextOffX = 0; - mnTextOffY = +pFontEntry->maMetric.GetAscent() + mnEmphasisAscent; + mnTextOffY = +pFontEntry->maFontAttributes.GetAscent() + mnEmphasisAscent; if ( pFontEntry->mnOrientation ) { Point aOriginPt(0, 0); @@ -1660,7 +1660,7 @@ bool OutputDevice::ImplNewFont() const else // eAlign == ALIGN_BOTTOM { mnTextOffX = 0; - mnTextOffY = -pFontEntry->maMetric.GetDescent() + mnEmphasisDescent; + mnTextOffY = -pFontEntry->maFontAttributes.GetDescent() + mnEmphasisDescent; if ( pFontEntry->mnOrientation ) { Point aOriginPt(0, 0); @@ -1678,7 +1678,7 @@ bool OutputDevice::ImplNewFont() const // #95414# fix for OLE objects which use scale factors very creatively if( mbMap && !aSize.Width() ) { - int nOrigWidth = pFontEntry->maMetric.GetWidth(); + int nOrigWidth = pFontEntry->maFontAttributes.GetWidth(); float fStretch = (float)maMapRes.mnMapScNumX * maMapRes.mnMapScDenomY; fStretch /= (float)maMapRes.mnMapScNumY * maMapRes.mnMapScDenomX; int nNewWidth = (int)(nOrigWidth * fStretch + 0.5); @@ -1699,14 +1699,14 @@ bool OutputDevice::ImplNewFont() const void OutputDevice::SetFontOrientation( ImplFontEntry* const pFontEntry ) const { - if( pFontEntry->maFontSelData.mnOrientation && !pFontEntry->maMetric.GetOrientation() ) + if( pFontEntry->maFontSelData.mnOrientation && !pFontEntry->maFontAttributes.GetOrientation() ) { pFontEntry->mnOwnOrientation = sal::static_int_cast(pFontEntry->maFontSelData.mnOrientation); pFontEntry->mnOrientation = pFontEntry->mnOwnOrientation; } else { - pFontEntry->mnOrientation = pFontEntry->maMetric.GetOrientation(); + pFontEntry->mnOrientation = pFontEntry->maFontAttributes.GetOrientation(); } } @@ -2034,9 +2034,9 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout ) Point aOffset = Point(0,0); if ( nEmphasisMark & EMPHASISMARK_POS_BELOW ) - aOffset.Y() += mpFontEntry->maMetric.GetDescent() + nEmphasisYOff; + aOffset.Y() += mpFontEntry->maFontAttributes.GetDescent() + nEmphasisYOff; else - aOffset.Y() -= mpFontEntry->maMetric.GetAscent() + nEmphasisYOff; + aOffset.Y() -= mpFontEntry->maFontAttributes.GetAscent() + nEmphasisYOff; long nEmphasisWidth2 = nEmphasisWidth / 2; long nEmphasisHeight2 = nEmphasisHeight / 2; @@ -2198,8 +2198,8 @@ long OutputDevice::GetMinKashida() const return 0; ImplFontEntry* pEntry = mpFontEntry; - ImplFontAttributes* pMetric = &(pEntry->maMetric); - return ImplDevicePixelToLogicWidth( pMetric->GetMinKashida() ); + ImplFontAttributes* pFontAttributes = &(pEntry->maFontAttributes); + return ImplDevicePixelToLogicWidth( pFontAttributes->GetMinKashida() ); } sal_Int32 OutputDevice::ValidateKashidas ( const OUString& rTxt, diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 1686dbf5a926..6a04eb88313d 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -174,7 +174,7 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout ) mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) ); mbInitFillColor = true; - ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.GetAscent() + mnEmphasisAscent), + ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maFontAttributes.GetAscent() + mnEmphasisAscent), nWidth, mpFontEntry->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent ); } @@ -188,7 +188,7 @@ Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout ) long nWidth = rSalLayout.GetTextWidth(); long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent; - nY -= mpFontEntry->maMetric.GetAscent() + mnEmphasisAscent; + nY -= mpFontEntry->maFontAttributes.GetAscent() + mnEmphasisAscent; if ( mpFontEntry->mnOrientation ) { @@ -229,7 +229,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout ) { // guess vertical text extents if GetBoundRect failed int nRight = rSalLayout.GetTextWidth(); - int nTop = mpFontEntry->maMetric.GetAscent() + mnEmphasisAscent; + int nTop = mpFontEntry->maFontAttributes.GetAscent() + mnEmphasisAscent; long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent; aBoundRect = Rectangle( 0, -nTop, nRight, nHeight - nTop ); } @@ -2618,7 +2618,7 @@ bool OutputDevice::GetTextBoundRect( Rectangle& rRect, Point aTopLeft( nLeft, nTop ); aTopLeft -= aOffset; // adjust to text alignment - aTopLeft.Y()+= mnTextOffY - (mpFontEntry->maMetric.GetAscent() + mnEmphasisAscent); + aTopLeft.Y()+= mnTextOffY - (mpFontEntry->maFontAttributes.GetAscent() + mnEmphasisAscent); // convert to logical coordinates aSize = PixelToLogic( aSize ); aTopLeft.X() = ImplDevicePixelToLogicWidth( aTopLeft.X() ); diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 50707b5de757..ca8c45d2b935 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -56,12 +56,12 @@ bool OutputDevice::ImplIsUnderlineAbove( const vcl::Font& rFont ) void OutputDevice::ImplInitTextLineSize() { - mpFontEntry->maMetric.ImplInitTextLineSize( this ); + mpFontEntry->maFontAttributes.ImplInitTextLineSize( this ); } void OutputDevice::ImplInitAboveTextLineSize() { - mpFontEntry->maMetric.ImplInitAboveTextLineSize(); + mpFontEntry->maFontAttributes.ImplInitAboveTextLineSize(); } void OutputDevice::ImplDrawWavePixel( long nOriginX, long nOriginY, @@ -221,13 +221,13 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY, if ( bIsAbove ) { - nLineHeight = pFontEntry->maMetric.GetAboveWavelineUnderlineSize(); - nLinePos = pFontEntry->maMetric.GetAboveWavelineUnderlineOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetAboveWavelineUnderlineSize(); + nLinePos = pFontEntry->maFontAttributes.GetAboveWavelineUnderlineOffset(); } else { - nLineHeight = pFontEntry->maMetric.GetWavelineUnderlineSize(); - nLinePos = pFontEntry->maMetric.GetWavelineUnderlineOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetWavelineUnderlineSize(); + nLinePos = pFontEntry->maFontAttributes.GetWavelineUnderlineOffset(); } if ( (eTextLine == UNDERLINE_SMALLWAVE) && (nLineHeight > 3) ) nLineHeight = 3; @@ -303,13 +303,13 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY, case UNDERLINE_DASHDOTDOT: if ( bIsAbove ) { - nLineHeight = pFontEntry->maMetric.GetAboveUnderlineSize(); - nLinePos = nY + pFontEntry->maMetric.GetAboveUnderlineOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetAboveUnderlineSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetAboveUnderlineOffset(); } else { - nLineHeight = pFontEntry->maMetric.GetUnderlineSize(); - nLinePos = nY + pFontEntry->maMetric.GetUnderlineOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetUnderlineSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetUnderlineOffset(); } break; case UNDERLINE_BOLD: @@ -320,27 +320,27 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY, case UNDERLINE_BOLDDASHDOTDOT: if ( bIsAbove ) { - nLineHeight = pFontEntry->maMetric.GetAboveBoldUnderlineSize(); - nLinePos = nY + pFontEntry->maMetric.GetAboveBoldUnderlineOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetAboveBoldUnderlineSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetAboveBoldUnderlineOffset(); } else { - nLineHeight = pFontEntry->maMetric.GetBoldUnderlineSize(); - nLinePos = nY + pFontEntry->maMetric.GetBoldUnderlineOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetBoldUnderlineSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetBoldUnderlineOffset(); } break; case UNDERLINE_DOUBLE: if ( bIsAbove ) { - nLineHeight = pFontEntry->maMetric.GetAboveDoubleUnderlineSize(); - nLinePos = nY + pFontEntry->maMetric.GetAboveDoubleUnderlineOffset1(); - nLinePos2 = nY + pFontEntry->maMetric.GetAboveDoubleUnderlineOffset2(); + nLineHeight = pFontEntry->maFontAttributes.GetAboveDoubleUnderlineSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetAboveDoubleUnderlineOffset1(); + nLinePos2 = nY + pFontEntry->maFontAttributes.GetAboveDoubleUnderlineOffset2(); } else { - nLineHeight = pFontEntry->maMetric.GetDoubleUnderlineSize(); - nLinePos = nY + pFontEntry->maMetric.GetDoubleUnderlineOffset1(); - nLinePos2 = nY + pFontEntry->maMetric.GetDoubleUnderlineOffset2(); + nLineHeight = pFontEntry->maFontAttributes.GetDoubleUnderlineSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetDoubleUnderlineOffset1(); + nLinePos2 = nY + pFontEntry->maFontAttributes.GetDoubleUnderlineOffset2(); } break; default: @@ -538,17 +538,17 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY, switch ( eStrikeout ) { case STRIKEOUT_SINGLE: - nLineHeight = pFontEntry->maMetric.GetStrikeoutSize(); - nLinePos = nY + pFontEntry->maMetric.GetStrikeoutOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetStrikeoutSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetStrikeoutOffset(); break; case STRIKEOUT_BOLD: - nLineHeight = pFontEntry->maMetric.GetBoldStrikeoutSize(); - nLinePos = nY + pFontEntry->maMetric.GetBoldStrikeoutOffset(); + nLineHeight = pFontEntry->maFontAttributes.GetBoldStrikeoutSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetBoldStrikeoutOffset(); break; case STRIKEOUT_DOUBLE: - nLineHeight = pFontEntry->maMetric.GetDoubleStrikeoutSize(); - nLinePos = nY + pFontEntry->maMetric.GetDoubleStrikeoutOffset1(); - nLinePos2 = nY + pFontEntry->maMetric.GetDoubleStrikeoutOffset2(); + nLineHeight = pFontEntry->maFontAttributes.GetDoubleStrikeoutSize(); + nLinePos = nY + pFontEntry->maFontAttributes.GetDoubleStrikeoutOffset1(); + nLinePos2 = nY + pFontEntry->maFontAttributes.GetDoubleStrikeoutOffset2(); break; default: break; @@ -652,8 +652,8 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, Rectangle aPixelRect; aPixelRect.Left() = nBaseX+mnTextOffX; aPixelRect.Right() = aPixelRect.Left()+nWidth; - aPixelRect.Bottom() = nBaseY+mpFontEntry->maMetric.GetDescent(); - aPixelRect.Top() = nBaseY-mpFontEntry->maMetric.GetAscent(); + aPixelRect.Bottom() = nBaseY+mpFontEntry->maFontAttributes.GetDescent(); + aPixelRect.Top() = nBaseY-mpFontEntry->maFontAttributes.GetAscent(); if (mpFontEntry->mnOrientation) { @@ -1043,9 +1043,9 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos ) // #109280# make sure the waveline does not exceed the descent to avoid paint problems ImplFontEntry* pFontEntry = mpFontEntry; - if( nWaveHeight > pFontEntry->maMetric.GetWavelineUnderlineSize() ) + if( nWaveHeight > pFontEntry->maFontAttributes.GetWavelineUnderlineSize() ) { - nWaveHeight = pFontEntry->maMetric.GetWavelineUnderlineSize(); + nWaveHeight = pFontEntry->maFontAttributes.GetWavelineUnderlineSize(); } ImplDrawWaveLine(nStartX, nStartY, 0, 0, nEndX-nStartX, nWaveHeight, diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 29993f54adf6..419dc58ceec2 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -452,7 +452,7 @@ FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttribut } void -CairoTextRender::GetFontMetric( ImplFontAttributes *pMetric, int nFallbackLevel ) +CairoTextRender::GetFontAttributes( ImplFontAttributes *pFontAttributes, int nFallbackLevel ) { if( nFallbackLevel >= MAX_FALLBACK ) return; @@ -460,7 +460,7 @@ CairoTextRender::GetFontMetric( ImplFontAttributes *pMetric, int nFallbackLevel if( mpServerFont[nFallbackLevel] != nullptr ) { long rDummyFactor; - mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor ); + mpServerFont[nFallbackLevel]->FetchFontAttributes( *pFontAttributes, rDummyFactor ); } } diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 6c871648223e..27e339a45ff1 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -135,9 +135,9 @@ void X11SalGraphics::GetDevFontList( PhysicalFontCollection* pFontCollection ) } void -X11SalGraphics::GetFontMetric( ImplFontAttributes *pMetric, int nFallbackLevel ) +X11SalGraphics::GetFontAttributes( ImplFontAttributes *pFontAttributes, int nFallbackLevel ) { - mxTextRenderImpl->GetFontMetric(pMetric, nFallbackLevel); + mxTextRenderImpl->GetFontAttributes(pFontAttributes, nFallbackLevel); } bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) diff --git a/vcl/win/gdi/salgdi3.cxx b/vcl/win/gdi/salgdi3.cxx index e561e281885f..dba8568710ee 100644 --- a/vcl/win/gdi/salgdi3.cxx +++ b/vcl/win/gdi/salgdi3.cxx @@ -1479,14 +1479,14 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel return 0; } -void WinSalGraphics::GetFontMetric( ImplFontAttributes* pMetric, int nFallbackLevel ) +void WinSalGraphics::GetFontAttributes( ImplFontAttributes* pFontAttributes, int nFallbackLevel ) { // temporarily change the HDC to the font in the fallback level HFONT hOldFont = SelectFont( getHDC(), mhFonts[nFallbackLevel] ); wchar_t aFaceName[LF_FACESIZE+60]; if( ::GetTextFaceW( getHDC(), sizeof(aFaceName)/sizeof(wchar_t), aFaceName ) ) - pMetric->SetFamilyName(OUString(reinterpret_cast(aFaceName))); + pFontAttributes->SetFamilyName(OUString(reinterpret_cast(aFaceName))); // get the font metric TEXTMETRICA aWinMetric; @@ -1497,63 +1497,63 @@ void WinSalGraphics::GetFontMetric( ImplFontAttributes* pMetric, int nFallbackLe return; // device independent font attributes - pMetric->SetFamilyType(ImplFamilyToSal( aWinMetric.tmPitchAndFamily )); - pMetric->SetSymbolFlag(aWinMetric.tmCharSet == SYMBOL_CHARSET); - pMetric->SetWeight(ImplWeightToSal( aWinMetric.tmWeight )); - pMetric->SetPitch(ImplMetricPitchToSal( aWinMetric.tmPitchAndFamily )); - pMetric->SetItalic(aWinMetric.tmItalic ? ITALIC_NORMAL : ITALIC_NONE); - pMetric->SetSlant( 0 ); + pFontAttributes->SetFamilyType(ImplFamilyToSal( aWinMetric.tmPitchAndFamily )); + pFontAttributes->SetSymbolFlag(aWinMetric.tmCharSet == SYMBOL_CHARSET); + pFontAttributes->SetWeight(ImplWeightToSal( aWinMetric.tmWeight )); + pFontAttributes->SetPitch(ImplMetricPitchToSal( aWinMetric.tmPitchAndFamily )); + pFontAttributes->SetItalic(aWinMetric.tmItalic ? ITALIC_NORMAL : ITALIC_NONE); + pFontAttributes->SetSlant( 0 ); // device dependent font attributes - pMetric->SetBuiltInFontFlag( (aWinMetric.tmPitchAndFamily & TMPF_DEVICE) != 0 ); - pMetric->SetScalableFlag( (aWinMetric.tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE)) != 0 ); - pMetric->SetTrueTypeFlag( (aWinMetric.tmPitchAndFamily & TMPF_TRUETYPE) != 0 ); - if( pMetric->IsScalable() ) + pFontAttributes->SetBuiltInFontFlag( (aWinMetric.tmPitchAndFamily & TMPF_DEVICE) != 0 ); + pFontAttributes->SetScalableFlag( (aWinMetric.tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE)) != 0 ); + pFontAttributes->SetTrueTypeFlag( (aWinMetric.tmPitchAndFamily & TMPF_TRUETYPE) != 0 ); + if( pFontAttributes->IsScalable() ) { // check if there are kern pairs // TODO: does this work with GPOS kerning? DWORD nKernPairs = ::GetKerningPairsA( getHDC(), 0, NULL ); - pMetric->SetKernableFlag( (nKernPairs > 0) ); + pFontAttributes->SetKernableFlag( (nKernPairs > 0) ); } else { // bitmap fonts cannot be rotated directly - pMetric->SetOrientation( 0 ); + pFontAttributes->SetOrientation( 0 ); // bitmap fonts have no kerning - pMetric->SetKernableFlag( false ); + pFontAttributes->SetKernableFlag( false ); } // transformation dependent font metrics - pMetric->SetWidth( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmAveCharWidth ) ); - pMetric->SetInternalLeading( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmInternalLeading ) ); - pMetric->SetExternalLeading( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmExternalLeading ) ); - pMetric->SetAscent( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmAscent ) ); - pMetric->SetDescent( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmDescent ) ); + pFontAttributes->SetWidth( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmAveCharWidth ) ); + pFontAttributes->SetInternalLeading( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmInternalLeading ) ); + pFontAttributes->SetExternalLeading( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmExternalLeading ) ); + pFontAttributes->SetAscent( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmAscent ) ); + pFontAttributes->SetDescent( static_cast( mfFontScale[nFallbackLevel] * aWinMetric.tmDescent ) ); // #107888# improved metric compatibility for Asian fonts... // TODO: assess workaround below for CWS >= extleading // TODO: evaluate use of aWinMetric.sTypo* members for CJK if( mpWinFontData[nFallbackLevel] && mpWinFontData[nFallbackLevel]->SupportsCJK() ) { - pMetric->SetInternalLeading( pMetric->GetInternalLeading() + pMetric->GetExternalLeading() ); + pFontAttributes->SetInternalLeading( pFontAttributes->GetInternalLeading() + pFontAttributes->GetExternalLeading() ); // #109280# The line height for Asian fonts is too small. // Therefore we add half of the external leading to the // ascent, the other half is added to the descent. - const long nHalfTmpExtLeading = pMetric->GetExternalLeading() / 2; - const long nOtherHalfTmpExtLeading = pMetric->GetExternalLeading() - nHalfTmpExtLeading; + const long nHalfTmpExtLeading = pFontAttributes->GetExternalLeading() / 2; + const long nOtherHalfTmpExtLeading = pFontAttributes->GetExternalLeading() - nHalfTmpExtLeading; // #110641# external leading for Asian fonts. // The factor 0.3 has been confirmed with experiments. - long nCJKExtLeading = static_cast(0.30 * (pMetric->GetAscent() + pMetric->GetDescent())); - nCJKExtLeading -= pMetric->GetExternalLeading(); - pMetric->SetExternalLeading( (nCJKExtLeading > 0) ? nCJKExtLeading : 0 ); + long nCJKExtLeading = static_cast(0.30 * (pFontAttributes->GetAscent() + pFontAttributes->GetDescent())); + nCJKExtLeading -= pFontAttributes->GetExternalLeading(); + pFontAttributes->SetExternalLeading( (nCJKExtLeading > 0) ? nCJKExtLeading : 0 ); - pMetric->SetAscent( pMetric->GetAscent() + nHalfTmpExtLeading ); - pMetric->SetDescent( pMetric->GetDescent() + nOtherHalfTmpExtLeading ); + pFontAttributes->SetAscent( pFontAttributes->GetAscent() + nHalfTmpExtLeading ); + pFontAttributes->SetDescent( pFontAttributes->GetDescent() + nOtherHalfTmpExtLeading ); } - pMetric->SetMinKashida( GetMinKashidaWidth() ); + pFontAttributes->SetMinKashida( GetMinKashidaWidth() ); } const FontCharMapPtr WinSalGraphics::GetFontCharMap() const diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 841b64b3156e..89054fa4a066 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -1846,7 +1846,7 @@ bool UniscribeLayout::CacheGlyphs(SalGraphics& rGraphics) const if (mbUseGLyphy) { - if (!mrWinFontEntry.maMetric.IsTrueTypeFont()) + if (!mrWinFontEntry.maFontAttributes.IsTrueTypeFont()) return false; mrWinFontEntry.setupGLyphy(mhDC); -- cgit