summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-03 09:33:28 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-03 03:29:55 +0000
commit694ec8930ab7d7a54805ec598be84845b502772c (patch)
tree9e44148884d0f01e21b853512fccc7b971f2f1f3 /vcl
parent91f41c3ec23eb063873db8a03c3f6806e2e68af8 (diff)
vcl: convert ImplFontMetricData to accessor functions
Changed private variables to use accessor functions in ImplFontMetric. It turns out there are some variables that are redundant as they are already in ImplFontAttributes. These are: - meFamilyType - mbDevice I also needed to change ImplFontMetric::GetSlant() to GetSlantType() as the names conflicted. Change-Id: Ic06a374fb929e3b2ffb18a6c66577c526c3b31a7 Reviewed-on: https://gerrit.libreoffice.org/21050 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/fontmanager/fontconfig.cxx2
-rw-r--r--vcl/generic/fontmanager/fontsubst.cxx10
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx62
-rw-r--r--vcl/generic/glyphs/glyphcache.cxx4
-rw-r--r--vcl/generic/print/genpspgraphics.cxx22
-rw-r--r--vcl/inc/impfont.hxx2
-rw-r--r--vcl/inc/outfont.hxx68
-rw-r--r--vcl/quartz/ctfonts.cxx22
-rw-r--r--vcl/quartz/salgdi.cxx2
-rw-r--r--vcl/source/font/PhysicalFontCollection.cxx6
-rw-r--r--vcl/source/font/PhysicalFontFace.cxx12
-rw-r--r--vcl/source/font/PhysicalFontFamily.cxx6
-rw-r--r--vcl/source/gdi/embeddedfontshelper.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx102
-rw-r--r--vcl/source/gdi/print.cxx2
-rw-r--r--vcl/source/gdi/virdev.cxx2
-rw-r--r--vcl/source/outdev/font.cxx77
-rw-r--r--vcl/source/outdev/text.cxx8
-rw-r--r--vcl/source/outdev/textline.cxx58
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx2
-rw-r--r--vcl/win/gdi/salgdi3.cxx50
-rw-r--r--vcl/win/gdi/winlayout.cxx2
22 files changed, 293 insertions, 232 deletions
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index b663dffb7bd5..2e8622b6becc 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -990,7 +990,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
if (!aLangAttrib.isEmpty())
FcPatternAddString(pPattern, FC_LANG, reinterpret_cast<FcChar8 const *>(aLangAttrib.getStr()));
- addtopattern(pPattern, rPattern.GetSlant(), rPattern.GetWeight(),
+ addtopattern(pPattern, rPattern.GetSlantType(), rPattern.GetWeight(),
rPattern.GetWidthType(), rPattern.GetPitch());
// query fontconfig for a substitute
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index 309cb1889af3..620bb9178a16 100644
--- a/vcl/generic/fontmanager/fontsubst.cxx
+++ b/vcl/generic/fontmanager/fontsubst.cxx
@@ -123,7 +123,7 @@ namespace
(
rOrig.maTargetName == rNew.maSearchName &&
rOrig.GetWeight() == rNew.GetWeight() &&
- rOrig.GetSlant() == rNew.GetSlant() &&
+ rOrig.GetSlantType() == rNew.GetSlantType() &&
rOrig.GetPitch() == rNew.GetPitch() &&
rOrig.GetWidthType() == rNew.GetWidthType()
);
@@ -186,13 +186,13 @@ bool FcPreMatchSubstitution::FindFontSubstitute( FontSelectPattern &rFontSelData
const OString aSubstName(OUStringToOString(aOut.maSearchName,
RTL_TEXTENCODING_UTF8));
printf( "FcPreMatchSubstitution \"%s\" bipw=%d%d%d%d -> ",
- aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetSlant(),
+ aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetSlantType(),
rFontSelData.GetPitch(), rFontSelData.GetWidthType() );
if( !bHaveSubstitute )
printf( "no substitute available\n" );
else
printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.getStr(),
- aOut.GetWeight(), aOut.GetSlant(), aOut.GetPitch(), aOut.GetWidthType() );
+ aOut.GetWeight(), aOut.GetSlantType(), aOut.GetPitch(), aOut.GetWidthType() );
#endif
if( bHaveSubstitute )
@@ -234,13 +234,13 @@ bool FcGlyphFallbackSubstitution::FindFontSubstitute( FontSelectPattern& rFontSe
const OString aSubstName(OUStringToOString(aOut.maSearchName,
RTL_TEXTENCODING_UTF8));
printf( "FcGFSubstitution \"%s\" bipw=%d%d%d%d ->",
- aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetSlant(),
+ aOrigName.getStr(), rFontSelData.GetWeight(), rFontSelData.GetSlantType(),
rFontSelData.GetPitch(), rFontSelData.GetWidthType() );
if( !bHaveSubstitute )
printf( "no substitute available\n" );
else
printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.getStr(),
- aOut.GetWeight(), aOut.GetSlant(), aOut.GetPitch(), aOut.GetWidthType() );
+ aOut.GetWeight(), aOut.GetSlantType(), aOut.GetPitch(), aOut.GetWidthType() );
#endif
if( bHaveSubstitute )
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index a570548feb1b..7dea18bbf735 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -510,7 +510,7 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
mnLoadFlags |= FT_LOAD_IGNORE_TRANSFORM;
#endif
- mbArtItalic = (rFSD.GetSlant() != ITALIC_NONE && pFI->GetFontAttributes().GetSlant() == ITALIC_NONE);
+ mbArtItalic = (rFSD.GetSlantType() != ITALIC_NONE && pFI->GetFontAttributes().GetSlantType() == ITALIC_NONE);
mbArtBold = (rFSD.GetWeight() > WEIGHT_MEDIUM && pFI->GetFontAttributes().GetWeight() <= WEIGHT_MEDIUM);
if( mbArtBold )
{
@@ -612,11 +612,11 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
{
static_cast<ImplFontAttributes&>(rTo) = mpFontInfo->GetFontAttributes();
- rTo.mbScalableFont = true; // FIXME: Shouldn't this check FT_IS_SCALABLE( maFaceFT )?
- rTo.mbTrueTypeFont = FT_IS_SFNT( maFaceFT ) != 0;
- rTo.mbDevice = true;
- rTo.mbKernableFont = FT_HAS_KERNING( maFaceFT ) != 0;
- rTo.mnOrientation = GetFontSelData().mnOrientation;
+ rTo.SetScalableFlag( true ); // FIXME: Shouldn't this check FT_IS_SCALABLE( maFaceFT )?
+ rTo.SetTrueTypeFlag( FT_IS_SFNT( maFaceFT ) != 0 );
+ rTo.SetBuiltInFontFlag( true );
+ rTo.SetKernableFlag( FT_HAS_KERNING( maFaceFT ) != 0 );
+ rTo.SetOrientation( GetFontSelData().mnOrientation );
//Always consider [star]symbol as symbol fonts
if ( IsStarSymbol( rTo.GetFamilyName() ) )
@@ -629,11 +629,11 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
const TT_OS2* pOS2 = static_cast<const TT_OS2*>(FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_os2 ));
const double fScale = (double)GetFontSelData().mnHeight / maFaceFT->units_per_EM;
- rTo.mnAscent = 0;
- rTo.mnDescent = 0;
- rTo.mnExtLeading = 0;
- rTo.mnSlant = 0;
- rTo.mnWidth = mnWidth;
+ rTo.SetAscent( 0 );
+ rTo.SetDescent( 0 );
+ rTo.SetExternalLeading( 0 );
+ rTo.SetSlant( 0 );
+ rTo.SetWidth( mnWidth );
// Calculating ascender and descender:
// FreeType >= 2.4.6 does the right thing, so we just use what it gives us,
@@ -644,49 +644,49 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
if (nFTVERSION >= 2406)
{
const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics;
- rTo.mnAscent = (rMetrics.ascender + 32) >> 6;
- rTo.mnDescent = (-rMetrics.descender + 32) >> 6;
- rTo.mnExtLeading = ((rMetrics.height + 32) >> 6) - (rTo.mnAscent + rTo.mnDescent);
+ rTo.SetAscent( (rMetrics.ascender + 32) >> 6 );
+ rTo.SetDescent( (-rMetrics.descender + 32) >> 6 );
+ rTo.SetExternalLeading( ((rMetrics.height + 32) >> 6) - (rTo.GetAscent() + rTo.GetDescent()) );
}
else
{
const TT_HoriHeader* pHHea = static_cast<const TT_HoriHeader*>(FT_Get_Sfnt_Table(maFaceFT, ft_sfnt_hhea));
if (pHHea)
{
- rTo.mnAscent = pHHea->Ascender * fScale + 0.5;
- rTo.mnDescent = -pHHea->Descender * fScale + 0.5;
- rTo.mnExtLeading = pHHea->Line_Gap * fScale + 0.5;
+ rTo.SetAscent( pHHea->Ascender * fScale + 0.5 );
+ rTo.SetDescent( -pHHea->Descender * fScale + 0.5 );
+ rTo.SetExternalLeading( pHHea->Line_Gap * fScale + 0.5 );
}
- if (!(rTo.mnAscent || rTo.mnDescent))
+ if (!(rTo.GetAscent() || rTo.GetDescent()))
{
if (pOS2 && (pOS2->version != 0xFFFF))
{
if (pOS2->sTypoAscender || pOS2->sTypoDescender)
{
- rTo.mnAscent = pOS2->sTypoAscender * fScale + 0.5;
- rTo.mnDescent = -pOS2->sTypoDescender * fScale + 0.5;
- rTo.mnExtLeading = pOS2->sTypoLineGap * fScale + 0.5;
+ rTo.SetAscent( pOS2->sTypoAscender * fScale + 0.5 );
+ rTo.SetDescent( -pOS2->sTypoDescender * fScale + 0.5 );
+ rTo.SetExternalLeading( pOS2->sTypoLineGap * fScale + 0.5 );
}
else
{
- rTo.mnAscent = pOS2->usWinAscent * fScale + 0.5;
- rTo.mnDescent = pOS2->usWinDescent * fScale + 0.5;
- rTo.mnExtLeading = 0;
+ rTo.SetAscent( pOS2->usWinAscent * fScale + 0.5 );
+ rTo.SetDescent( pOS2->usWinDescent * fScale + 0.5 );
+ rTo.SetExternalLeading( 0 );
}
}
}
- if (!(rTo.mnAscent || rTo.mnDescent))
+ if (!(rTo.GetAscent() || rTo.GetDescent()))
{
const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics;
- rTo.mnAscent = (rMetrics.ascender + 32) >> 6;
- rTo.mnDescent = (-rMetrics.descender + 32) >> 6;
- rTo.mnExtLeading = ((rMetrics.height + 32) >> 6) - (rTo.mnAscent + rTo.mnDescent);
+ rTo.SetAscent( (rMetrics.ascender + 32) >> 6 );
+ rTo.SetDescent( (-rMetrics.descender + 32) >> 6 );
+ rTo.SetExternalLeading( ((rMetrics.height + 32) >> 6) - (rTo.GetAscent() + rTo.GetDescent() ) );
}
}
- rTo.mnIntLeading = rTo.mnAscent + rTo.mnDescent - (maFaceFT->units_per_EM * fScale + 0.5);
+ rTo.SetInternalLeading( rTo.GetAscent() + rTo.GetDescent() - (maFaceFT->units_per_EM * fScale + 0.5) );
if( pOS2 && (pOS2->version != 0xFFFF) )
{
@@ -700,7 +700,7 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
case 5: rTo.SetFamilyType( FAMILY_DECORATIVE ); break;
// TODO: is it reasonable to override the attribute with DONTKNOW?
case 0: // fall through
- default: rTo.meFamilyType = FAMILY_DONTKNOW; break;
+ default: rTo.SetFamilyType( FAMILY_DONTKNOW ); break;
}
switch( pOS2->panose[3] )
@@ -727,7 +727,7 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
{
GlyphData aGlyphData;
InitGlyphData( nKashidaGlyphId, aGlyphData );
- rTo.mnMinKashida = aGlyphData.GetMetric().GetCharWidth();
+ rTo.SetMinKashida( aGlyphData.GetMetric().GetCharWidth() );
}
}
diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx
index 1f69fd6ac844..a0a230331ae2 100644
--- a/vcl/generic/glyphs/glyphcache.cxx
+++ b/vcl/generic/glyphs/glyphcache.cxx
@@ -85,7 +85,7 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData
nHash += rFontSelData.mnHeight;
nHash += rFontSelData.mnOrientation;
nHash += size_t(rFontSelData.mbVertical);
- nHash += rFontSelData.GetSlant();
+ nHash += rFontSelData.GetSlantType();
nHash += rFontSelData.GetWeight();
#if ENABLE_GRAPHITE
nHash += rFontSelData.meLanguage;
@@ -108,7 +108,7 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font
|| (rA.mbNonAntialiased != rB.mbNonAntialiased) )
return false;
- if( (rA.GetSlant() != rB.GetSlant())
+ if( (rA.GetSlantType() != rB.GetSlantType())
|| (rA.GetWeight() != rB.GetWeight()) )
return false;
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index f687ba28fea2..9af2857ae6f8 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -801,7 +801,7 @@ sal_uInt16 GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLeve
// determine which font attributes need to be emulated
bool bArtItalic = false;
bool bArtBold = false;
- if( pEntry->GetSlant() == ITALIC_OBLIQUE || pEntry->GetSlant() == ITALIC_NORMAL )
+ if( pEntry->GetSlantType() == ITALIC_OBLIQUE || pEntry->GetSlantType() == ITALIC_NORMAL )
{
FontItalic eItalic = m_pPrinterGfx->GetFontMgr().getFontItalic( nID );
if( eItalic != ITALIC_NORMAL && eItalic != ITALIC_OBLIQUE )
@@ -920,23 +920,23 @@ void GenPspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
{
ImplFontAttributes aDFA = Info2FontAttributes( aInfo );
static_cast<ImplFontAttributes&>(*pMetric) = aDFA;
- pMetric->mbDevice = aDFA.IsBuiltInFont();
- pMetric->mbScalableFont = true;
- pMetric->mbTrueTypeFont = false; // FIXME, needed?
+ pMetric->SetBuiltInFontFlag( aDFA.IsBuiltInFont() );
+ pMetric->SetScalableFlag( true );
+ pMetric->SetTrueTypeFlag( false ); // FIXME, needed?
- pMetric->mnOrientation = m_pPrinterGfx->GetFontAngle();
- pMetric->mnSlant = 0;
+ pMetric->SetOrientation( m_pPrinterGfx->GetFontAngle() );
+ pMetric->SetSlant( 0 );
sal_Int32 nTextHeight = m_pPrinterGfx->GetFontHeight();
sal_Int32 nTextWidth = m_pPrinterGfx->GetFontWidth();
if( ! nTextWidth )
nTextWidth = nTextHeight;
- pMetric->mnWidth = nTextWidth;
- pMetric->mnAscent = ( aInfo.m_nAscend * nTextHeight + 500 ) / 1000;
- pMetric->mnDescent = ( aInfo.m_nDescend * nTextHeight + 500 ) / 1000;
- pMetric->mnIntLeading = ( aInfo.m_nLeading * nTextHeight + 500 ) / 1000;
- pMetric->mnExtLeading = 0;
+ 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 );
}
}
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index 1ed1e41560c9..a3c50e6697d9 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -100,7 +100,7 @@ private:
long mnExtLeading; // External Leading
long mnLineHeight; // Ascent+Descent+EmphasisMark
long mnSlant; // Slant
- long mnBulletOffset;// Offset for non-priting character
+ long mnBulletOffset;// Offset for non-printing character
sal_uInt16 mnMiscFlags; // Misc Flags
sal_uInt32 mnRefCount; // Reference Counter
diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index 5fca3e11b1cb..50d5137b9894 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -48,7 +48,7 @@ public:
const OUString& GetStyleName() const { return maStyleName; }
FontWeight GetWeight() const { return meWeight; }
- FontItalic GetSlant() const { return meItalic; }
+ FontItalic GetSlantType() const { return meItalic; }
FontPitch GetPitch() const { return mePitch; }
FontWidth GetWidthType() const { return meWidthType; }
@@ -179,10 +179,72 @@ class ImplFontMetricData : public ImplFontAttributes
public:
explicit ImplFontMetricData( const FontSelectPattern& );
+ // font instance attributes from the font request
+ long GetWidth() { return mnWidth; }
+ short GetOrientation() { return mnOrientation; }
+
+ void SetWidth(long nWidth) { mnWidth=nWidth; }
+ void SetOrientation(short nOrientation) { mnOrientation=nOrientation; }
+
+ // font metrics measured for the font instance
+ long GetAscent() { return mnAscent; }
+ long GetDescent() { return mnDescent; }
+ long GetInternalLeading() { return mnIntLeading; }
+ long GetExternalLeading() { return mnExtLeading; }
+ int GetSlant() { return mnSlant; }
+ long GetMinKashida() { return mnMinKashida; }
+
+ void SetAscent(long nAscent) { mnAscent=nAscent; }
+ void SetDescent(long nDescent) { mnDescent=nDescent; }
+ void SetInternalLeading(long nIntLeading) { mnIntLeading = nIntLeading; }
+ void SetExternalLeading(long nExtLeading) { mnExtLeading = nExtLeading; }
+ void SetSlant(int nSlant) { mnSlant=nSlant; }
+ void SetMinKashida( long nMinKashida ) { mnMinKashida=nMinKashida; }
+
+ // font attributes queried from the font instance
+ bool IsScalable() { return mbScalableFont; }
+ bool IsTrueTypeFont() { return mbTrueTypeFont; }
+ bool IsKernable() { return mbKernableFont; }
+ bool IsFullstopCentered() { return mbFullstopCentered; }
+ long GetBulletOffset() { return mnBulletOffset; }
+
+ void SetScalableFlag(bool bScalable) { mbScalableFont = bScalable; }
+ void SetTrueTypeFlag(bool bTrueTypeFont) { mbTrueTypeFont = bTrueTypeFont; }
+ void SetKernableFlag(bool bKernable) { mbKernableFont = bKernable; }
+ void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; }
+ void SetBulletOffset(long nBulletOffset) { mnBulletOffset = nBulletOffset; }
+
+ // font metrics that are usually derived from the measurements
+ long GetUnderlineSize() { return mnUnderlineSize; }
+ long GetUnderlineOffset() { return mnUnderlineOffset; }
+ long GetBoldUnderlineSize() { return mnBUnderlineSize; }
+ long GetBoldUnderlineOffset() { return mnBUnderlineOffset; }
+ long GetDoubleUnderlineSize() { return mnDUnderlineSize; }
+ long GetDoubleUnderlineOffset1() { return mnDUnderlineOffset1; }
+ long GetDoubleUnderlineOffset2() { return mnDUnderlineOffset2; }
+ long GetWavelineUnderlineSize() { return mnWUnderlineSize; }
+ long GetWavelineUnderlineOffset() { return mnWUnderlineOffset; }
+ long GetAboveUnderlineSize() { return mnAboveUnderlineSize; }
+ long GetAboveUnderlineOffset() { return mnAboveUnderlineOffset; }
+ long GetAboveBoldUnderlineSize() { return mnAboveBUnderlineSize; }
+ long GetAboveBoldUnderlineOffset() { return mnAboveBUnderlineOffset; }
+ long GetAboveDoubleUnderlineSize() { return mnAboveDUnderlineSize; }
+ long GetAboveDoubleUnderlineOffset1() { return mnAboveDUnderlineOffset1; }
+ long GetAboveDoubleUnderlineOffset2() { return mnAboveDUnderlineOffset2; }
+ long GetAboveWavelineUnderlineSize() { return mnAboveWUnderlineSize; }
+ long GetAboveWavelineUnderlineOffset() { return mnAboveWUnderlineOffset; }
+ long GetStrikeoutSize() { return mnStrikeoutSize; }
+ long GetStrikeoutOffset() { return mnStrikeoutOffset; }
+ long GetBoldStrikeoutSize() { return mnBStrikeoutSize; }
+ long GetBoldStrikeoutOffset() { return mnBStrikeoutOffset; }
+ long GetDoubleStrikeoutSize() { return mnDStrikeoutSize; }
+ long GetDoubleStrikeoutOffset1() { return mnDStrikeoutOffset1; }
+ long GetDoubleStrikeoutOffset2() { return mnDStrikeoutOffset2; }
+
void ImplInitTextLineSize( const OutputDevice* pDev );
void ImplInitAboveTextLineSize();
-public: // TODO: hide members behind accessor methods
+private:
// font instance attributes from the font request
long mnWidth; // Reference Width
short mnOrientation; // Rotation in 1/10 degrees
@@ -196,8 +258,6 @@ public: // TODO: hide members behind accessor methods
long mnMinKashida; // Minimal width of kashida (Arabic)
// font attributes queried from the font instance
- int meFamilyType; // Font Family Type
- bool mbDevice; // Flag for Device Fonts
bool mbScalableFont;
bool mbTrueTypeFont;
bool mbKernableFont;
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 980ffa24f581..a9a70e83f5d1 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -86,9 +86,9 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD )
}
// fake italic
- if (((pReqFont->GetSlant() == ITALIC_NORMAL) ||
- (pReqFont->GetSlant() == ITALIC_OBLIQUE)) &&
- (mpFontData->GetSlant() == ITALIC_NONE))
+ if (((pReqFont->GetSlantType() == ITALIC_NORMAL) ||
+ (pReqFont->GetSlantType() == ITALIC_OBLIQUE)) &&
+ (mpFontData->GetSlantType() == ITALIC_NONE))
{
aMatrix = CGAffineTransformConcat(aMatrix, CGAffineTransformMake(1, 0, toRadian(120), 1, 0, 0));
}
@@ -124,20 +124,20 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricData& rMetric ) const
const CGFloat fAscent = CTFontGetAscent( aCTFontRef );
const CGFloat fCapHeight = CTFontGetCapHeight( aCTFontRef );
- rMetric.mnAscent = lrint( fAscent );
- rMetric.mnDescent = lrint( CTFontGetDescent( aCTFontRef ));
- rMetric.mnExtLeading = lrint( CTFontGetLeading( aCTFontRef ));
- rMetric.mnIntLeading = lrint( fAscent - fCapHeight );
+ rMetric.SetAscent( lrint( fAscent ) );
+ rMetric.SetDescent( lrint( CTFontGetDescent( aCTFontRef )) );
+ rMetric.SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) );
+ rMetric.SetInternalLeading( lrint( fAscent - fCapHeight ) );
// since ImplFontMetricData::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.mnWidth = lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch);
+ rMetric.SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) );
// all CoreText fonts are scalable
- rMetric.mbScalableFont = true;
- rMetric.mbTrueTypeFont = true; // Not sure, but this field is used only for Windows so far
- rMetric.mbKernableFont = true;
+ rMetric.SetScalableFlag( true );
+ rMetric.SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far
+ rMetric.SetKernableFlag( true );
}
bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index bfff1fd79554..436890af72c0 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -440,7 +440,7 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac
<< " for " << pReqFont->GetFamilyName()
<< ", " << pReqFont->GetStyleName()
<< " weight=" << pReqFont->GetWeight()
- << " slant=" << pReqFont->GetSlant()
+ << " slant=" << pReqFont->GetSlantType()
<< " size=" << pReqFont->mnHeight << "x" << pReqFont->mnWidth
<< " orientation=" << pReqFont->mnOrientation
);
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 0b86c8ced34c..6f5a44a59fb3 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -1272,7 +1272,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByFont( FontSelectPatt
PhysicalFontFamily::CalcType( nSearchType, eSearchWeight, eSearchWidth, rFSD.GetFamilyType(), pFontAttr );
PhysicalFontFamily* pFoundData = FindFontFamilyByAttributes( nSearchType,
- eSearchWeight, eSearchWidth, rFSD.GetSlant(), aSearchFamilyName );
+ eSearchWeight, eSearchWidth, rFSD.GetSlantType(), aSearchFamilyName );
if( pFoundData )
{
@@ -1292,8 +1292,8 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByFont( FontSelectPatt
}
if( (nSearchType & ImplFontAttrs::Italic) &&
- ((rFSD.GetSlant() == ITALIC_DONTKNOW) ||
- (rFSD.GetSlant() == ITALIC_NONE)) &&
+ ((rFSD.GetSlantType() == ITALIC_DONTKNOW) ||
+ (rFSD.GetSlantType() == ITALIC_NONE)) &&
(pFoundData->GetTypeFaces() & FONT_FAMILY_ITALIC) )
{
rFSD.SetItalic( ITALIC_NORMAL );
diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx
index 7bebc992297b..3a770b6ce873 100644
--- a/vcl/source/font/PhysicalFontFace.cxx
+++ b/vcl/source/font/PhysicalFontFace.cxx
@@ -49,9 +49,9 @@ sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther )
else if( GetWeight() > rOther.GetWeight() )
return 1;
- if( GetSlant() < rOther.GetSlant() )
+ if( GetSlantType() < rOther.GetSlantType() )
return -1;
- else if( GetSlant() > rOther.GetSlant() )
+ else if( GetSlantType() > rOther.GetSlantType() )
return 1;
sal_Int32 nRet = GetFamilyName().compareTo( rOther.GetFamilyName() );
@@ -142,18 +142,18 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
}
// if requiring custom matrix to fake italic, prefer upright font
- FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.GetSlant();
+ FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.GetSlantType();
if ( ePatternItalic == ITALIC_NONE )
{
- if( GetSlant() == ITALIC_NONE )
+ if( GetSlantType() == ITALIC_NONE )
nMatch += 900;
}
else
{
- if( ePatternItalic == GetSlant() )
+ if( ePatternItalic == GetSlantType() )
nMatch += 900;
- else if( GetSlant() != ITALIC_NONE )
+ else if( GetSlantType() != ITALIC_NONE )
nMatch += 600;
}
diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx
index 8cc691bb9b36..20a72e068625 100644
--- a/vcl/source/font/PhysicalFontFamily.cxx
+++ b/vcl/source/font/PhysicalFontFamily.cxx
@@ -150,10 +150,10 @@ bool PhysicalFontFamily::AddFontFace( PhysicalFontFace* pNewFontFace )
mnTypeFaces |= FONT_FAMILY_NORMAL;
}
- if( pNewFontFace->GetSlant() == ITALIC_NONE )
+ if( pNewFontFace->GetSlantType() == ITALIC_NONE )
mnTypeFaces |= FONT_FAMILY_NONEITALIC;
- else if( (pNewFontFace->GetSlant() == ITALIC_NORMAL)
- || (pNewFontFace->GetSlant() == ITALIC_OBLIQUE) )
+ else if( (pNewFontFace->GetSlantType() == ITALIC_NORMAL)
+ || (pNewFontFace->GetSlantType() == ITALIC_OBLIQUE) )
mnTypeFaces |= FONT_FAMILY_ITALIC;
// reassign name (sharing saves memory)
diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx
index 48c506f67895..cfa9eaedc985 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -245,7 +245,7 @@ OUString EmbeddedFontsHelper::fontFileUrl( const OUString& familyName, FontFamil
// It is possible that it still may be needed to do at least some checks here
// for some encodings (can one font have more font files for more encodings?).
if(( family == FAMILY_DONTKNOW || f->GetFamilyType() == family )
- && ( italic == ITALIC_DONTKNOW || f->GetSlant() == italic )
+ && ( italic == ITALIC_DONTKNOW || f->GetSlantType() == italic )
&& ( weight == WEIGHT_DONTKNOW || f->GetWeight() == weight )
&& ( pitch == PITCH_DONTKNOW || f->GetPitch() == pitch ))
{ // Exact match, return it immediately.
@@ -253,7 +253,7 @@ OUString EmbeddedFontsHelper::fontFileUrl( const OUString& familyName, FontFamil
break;
}
if(( f->GetFamilyType() == FAMILY_DONTKNOW || family == FAMILY_DONTKNOW || f->GetFamilyType() == family )
- && ( f->GetSlant() == ITALIC_DONTKNOW || italic == ITALIC_DONTKNOW || f->GetSlant() == italic )
+ && ( f->GetSlantType() == ITALIC_DONTKNOW || italic == ITALIC_DONTKNOW || f->GetSlantType() == italic )
&& ( f->GetWeight() == WEIGHT_DONTKNOW || weight == WEIGHT_DONTKNOW || f->GetWeight() == weight )
&& ( f->GetPitch() == PITCH_DONTKNOW || pitch == PITCH_DONTKNOW || f->GetPitch() == pitch ))
{ // Some fonts specify 'DONTKNOW' for some things, still a good match, if we don't find a better one.
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 9ccdbd091125..b423a392fd13 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -3531,9 +3531,9 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
aErrorComment.append( "GetEmbedFontData failed for font \"" );
aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) );
aErrorComment.append( '\"' );
- if( pFont->GetSlant() == ITALIC_NORMAL )
+ if( pFont->GetSlantType() == ITALIC_NORMAL )
aErrorComment.append( " italic" );
- else if( pFont->GetSlant() == ITALIC_OBLIQUE )
+ else if( pFont->GetSlantType() == ITALIC_OBLIQUE )
aErrorComment.append( " oblique" );
aErrorComment.append( " weight=" );
aErrorComment.append( sal_Int32(pFont->GetWeight()) );
@@ -3601,7 +3601,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
pRef->SetMapMode( MapMode( MAP_PIXEL ) );
Font aFont( pFont->GetFamilyName(), pFont->GetStyleName(), Size( 0, 1000 ) );
aFont.SetWeight( pFont->GetWeight() );
- aFont.SetItalic( pFont->GetSlant() );
+ aFont.SetItalic( pFont->GetSlantType() );
aFont.SetPitch( pFont->GetPitch() );
pRef->SetFont( aFont );
pRef->ImplNewFont();
@@ -3816,7 +3816,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font
// possibly characters outside Adobe standard encoding
// so set Symbolic flag
sal_Int32 nFontFlags = (1<<2);
- if( pFont->GetSlant() == ITALIC_NORMAL || pFont->GetSlant() == ITALIC_OBLIQUE )
+ if( pFont->GetSlantType() == ITALIC_NORMAL || pFont->GetSlantType() == ITALIC_OBLIQUE )
nFontFlags |= (1 << 6);
if( pFont->GetPitch() == PITCH_FIXED )
nFontFlags |= 1;
@@ -3846,7 +3846,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font
aLine.append( ' ' );
aLine.append( (sal_Int32)(rInfo.m_aFontBBox.BottomRight().Y()+1) );
aLine.append( "]/ItalicAngle " );
- if( pFont->GetSlant() == ITALIC_OBLIQUE || pFont->GetSlant() == ITALIC_NORMAL )
+ if( pFont->GetSlantType() == ITALIC_OBLIQUE || pFont->GetSlantType() == ITALIC_NORMAL )
aLine.append( "-30" );
else
aLine.append( "0" );
@@ -4121,9 +4121,9 @@ bool PDFWriterImpl::emitFonts()
aErrorComment.append( "CreateFontSubset failed for font \"" );
aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) );
aErrorComment.append( '\"' );
- if( pFont->GetSlant() == ITALIC_NORMAL )
+ if( pFont->GetSlantType() == ITALIC_NORMAL )
aErrorComment.append( " italic" );
- else if( pFont->GetSlant() == ITALIC_OBLIQUE )
+ else if( pFont->GetSlantType() == ITALIC_OBLIQUE )
aErrorComment.append( " oblique" );
aErrorComment.append( " weight=" );
aErrorComment.append( sal_Int32(pFont->GetWeight()) );
@@ -8869,8 +8869,8 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
// perform artificial italics if necessary
if( ( m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_NORMAL ||
m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_OBLIQUE ) &&
- !( m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData->GetSlant() == ITALIC_NORMAL ||
- m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData->GetSlant() == ITALIC_OBLIQUE )
+ !( m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData->GetSlantType() == ITALIC_NORMAL ||
+ m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData->GetSlantType() == ITALIC_OBLIQUE )
)
{
fSkew = M_PI/12.0;
@@ -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.mnDescent + nEmphYOff;
+ aOffset.Y() += m_pReferenceDevice->mpFontEntry->maMetric.GetDescent() + nEmphYOff;
else
- aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maMetric.mnAscent + nEmphYOff;
+ aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maMetric.GetAscent() + nEmphYOff;
long nEmphWidth2 = nEmphWidth / 2;
long nEmphHeight2 = nEmphHeight / 2;
aOffset += Point( nEmphWidth2, nEmphHeight2 );
if ( eAlign == ALIGN_BOTTOM )
- aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maMetric.mnDescent;
+ aOffset.Y() -= m_pReferenceDevice->mpFontEntry->maMetric.GetDescent();
else if ( eAlign == ALIGN_TOP )
- aOffset.Y() += m_pReferenceDevice->mpFontEntry->maMetric.mnAscent;
+ aOffset.Y() += m_pReferenceDevice->mpFontEntry->maMetric.GetAscent();
for( int nStart = 0;;)
{
@@ -9496,17 +9496,17 @@ void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontUnd
if ( bIsAbove )
{
- if ( !pFontEntry->maMetric.mnAboveWUnderlineSize )
+ if ( !pFontEntry->maMetric.GetAboveWavelineUnderlineSize() )
m_pReferenceDevice->ImplInitAboveTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnAboveWUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnAboveWUnderlineOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetAboveWavelineUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetAboveWavelineUnderlineOffset() );
}
else
{
- if ( !pFontEntry->maMetric.mnWUnderlineSize )
+ if ( !pFontEntry->maMetric.GetWavelineUnderlineSize() )
m_pReferenceDevice->ImplInitTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnWUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnWUnderlineOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetWavelineUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.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.mnAboveUnderlineSize )
+ if ( !pFontEntry->maMetric.GetAboveUnderlineSize() )
m_pReferenceDevice->ImplInitAboveTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnAboveUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnAboveUnderlineOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetAboveUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetAboveUnderlineOffset() );
}
else
{
- if ( !pFontEntry->maMetric.mnUnderlineSize )
+ if ( !pFontEntry->maMetric.GetUnderlineSize() )
m_pReferenceDevice->ImplInitTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnUnderlineOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.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.mnAboveBUnderlineSize )
+ if ( !pFontEntry->maMetric.GetAboveBoldUnderlineSize() )
m_pReferenceDevice->ImplInitAboveTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnAboveBUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnAboveBUnderlineOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetAboveBoldUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetAboveBoldUnderlineOffset() );
}
else
{
- if ( !pFontEntry->maMetric.mnBUnderlineSize )
+ if ( !pFontEntry->maMetric.GetBoldUnderlineSize() )
m_pReferenceDevice->ImplInitTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnBUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnBUnderlineOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetBoldUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetBoldUnderlineOffset() );
nLinePos += nLineHeight/2;
}
break;
case UNDERLINE_DOUBLE:
if ( bIsAbove )
{
- if ( !pFontEntry->maMetric.mnAboveDUnderlineSize )
+ if ( !pFontEntry->maMetric.GetAboveDoubleUnderlineSize() )
m_pReferenceDevice->ImplInitAboveTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnAboveDUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnAboveDUnderlineOffset1 );
- nLinePos2 = HCONV( pFontEntry->maMetric.mnAboveDUnderlineOffset2 );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetAboveDoubleUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetAboveDoubleUnderlineOffset1() );
+ nLinePos2 = HCONV( pFontEntry->maMetric.GetAboveDoubleUnderlineOffset2() );
}
else
{
- if ( !pFontEntry->maMetric.mnDUnderlineSize )
+ if ( !pFontEntry->maMetric.GetDoubleUnderlineSize() )
m_pReferenceDevice->ImplInitTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnDUnderlineSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnDUnderlineOffset1 );
- nLinePos2 = HCONV( pFontEntry->maMetric.mnDUnderlineOffset2 );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetDoubleUnderlineSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetDoubleUnderlineOffset1() );
+ nLinePos2 = HCONV( pFontEntry->maMetric.GetDoubleUnderlineOffset2() );
}
break;
default:
@@ -9738,23 +9738,23 @@ void PDFWriterImpl::drawStrikeoutLine( OStringBuffer& aLine, long nWidth, FontSt
switch ( eStrikeout )
{
case STRIKEOUT_SINGLE:
- if ( !pFontEntry->maMetric.mnStrikeoutSize )
+ if ( !pFontEntry->maMetric.GetStrikeoutSize() )
m_pReferenceDevice->ImplInitTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnStrikeoutSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnStrikeoutOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetStrikeoutSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetStrikeoutOffset() );
break;
case STRIKEOUT_BOLD:
- if ( !pFontEntry->maMetric.mnBStrikeoutSize )
+ if ( !pFontEntry->maMetric.GetBoldStrikeoutSize() )
m_pReferenceDevice->ImplInitTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnBStrikeoutSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnBStrikeoutOffset );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetBoldStrikeoutSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetBoldStrikeoutOffset() );
break;
case STRIKEOUT_DOUBLE:
- if ( !pFontEntry->maMetric.mnDStrikeoutSize )
+ if ( !pFontEntry->maMetric.GetDoubleStrikeoutSize() )
m_pReferenceDevice->ImplInitTextLineSize();
- nLineHeight = HCONV( pFontEntry->maMetric.mnDStrikeoutSize );
- nLinePos = HCONV( pFontEntry->maMetric.mnDStrikeoutOffset1 );
- nLinePos2 = HCONV( pFontEntry->maMetric.mnDStrikeoutOffset2 );
+ nLineHeight = HCONV( pFontEntry->maMetric.GetDoubleStrikeoutSize() );
+ nLinePos = HCONV( pFontEntry->maMetric.GetDoubleStrikeoutOffset1() );
+ nLinePos2 = HCONV( pFontEntry->maMetric.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.mnAscent );
+ aPos.Y() += HCONV( pFontEntry->maMetric.GetAscent() );
else if( eAlign == ALIGN_BOTTOM )
- aPos.Y() -= HCONV( pFontEntry->maMetric.mnDescent );
+ aPos.Y() -= HCONV( pFontEntry->maMetric.GetDescent() );
OStringBuffer aLine( 512 );
// save GS
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 01bfe3aed900..7511d59d19b8 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.mnOrientation;
+ pFontEntry->mnOrientation = pFontEntry->maMetric.GetOrientation();
}
void Printer::DrawImage( const Point&, const Image&, DrawImageFlags )
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index ca0fcbceb8ec..07f476d2b956 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -566,7 +566,7 @@ long VirtualDevice::GetFontExtLeading() const
ImplFontEntry* pEntry = mpFontEntry;
ImplFontMetricData* pMetric = &(pEntry->maMetric);
- return pMetric->mnExtLeading;
+ return pMetric->GetExternalLeading();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 1c6512020ac5..f5ab39fe4130 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -77,7 +77,7 @@ vcl::FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
aFontInfo.SetFamily( rData.GetFamilyType() );
aFontInfo.SetPitch( rData.GetPitch() );
aFontInfo.SetWeight( rData.GetWeight() );
- aFontInfo.SetItalic( rData.GetSlant() );
+ aFontInfo.SetItalic( rData.GetSlantType() );
aFontInfo.SetWidthType( rData.GetWidthType() );
if( rData.IsScalable() )
aFontInfo.mpImplMetric->mnMiscFlags |= ImplFontMetric::SCALABLE_FLAG;
@@ -196,35 +196,35 @@ FontMetric OutputDevice::GetFontMetric() const
// set aMetric with info from font
aMetric.SetName( maFont.GetName() );
aMetric.SetStyleName( pMetric->GetStyleName() );
- aMetric.SetSize( PixelToLogic( Size( pMetric->mnWidth, pMetric->mnAscent+pMetric->mnDescent-pMetric->mnIntLeading ) ) );
+ 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->GetSlant() );
+ aMetric.SetItalic( pMetric->GetSlantType() );
aMetric.SetWidthType( pMetric->GetWidthType() );
if ( pEntry->mnOwnOrientation )
aMetric.SetOrientation( pEntry->mnOwnOrientation );
else
- aMetric.SetOrientation( pMetric->mnOrientation );
- if( !pEntry->maMetric.mbKernableFont )
+ aMetric.SetOrientation( pMetric->GetOrientation() );
+ if( !pEntry->maMetric.IsKernable() )
aMetric.SetKerning( maFont.GetKerning() & ~FontKerning::FontSpecific );
// set remaining metric fields
aMetric.mpImplMetric->mnMiscFlags = 0;
- if( pMetric->mbDevice )
+ if( pMetric->IsBuiltInFont() )
aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::DEVICE_FLAG;
- if( pMetric->mbScalableFont )
+ if( pMetric->IsScalable() )
aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::SCALABLE_FLAG;
- if ( pMetric->mbFullstopCentered)
+ if ( pMetric->IsFullstopCentered())
aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::FULLSTOP_CENTERED_FLAG;
- aMetric.mpImplMetric->mnBulletOffset= pMetric->mnBulletOffset;
- aMetric.mpImplMetric->mnAscent = ImplDevicePixelToLogicHeight( pMetric->mnAscent+mnEmphasisAscent );
- aMetric.mpImplMetric->mnDescent = ImplDevicePixelToLogicHeight( pMetric->mnDescent+mnEmphasisDescent );
- aMetric.mpImplMetric->mnIntLeading = ImplDevicePixelToLogicHeight( pMetric->mnIntLeading+mnEmphasisAscent );
- aMetric.mpImplMetric->mnExtLeading = ImplDevicePixelToLogicHeight( GetFontExtLeading() );
- aMetric.mpImplMetric->mnLineHeight = ImplDevicePixelToLogicHeight( pMetric->mnAscent+pMetric->mnDescent+mnEmphasisAscent+mnEmphasisDescent );
- aMetric.mpImplMetric->mnSlant = ImplDevicePixelToLogicHeight( pMetric->mnSlant );
+ 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->mnExtLeading = ImplDevicePixelToLogicHeight( GetFontExtLeading() );
+ aMetric.mpImplMetric->mnLineHeight = ImplDevicePixelToLogicHeight( pMetric->GetAscent() + pMetric->GetDescent() + mnEmphasisAscent + mnEmphasisDescent );
+ aMetric.mpImplMetric->mnSlant = ImplDevicePixelToLogicHeight( pMetric->GetSlant() );
SAL_INFO("vcl.gdi.fontmetric", "OutputDevice::GetFontMetric:" << aMetric);
@@ -486,7 +486,7 @@ long OutputDevice::GetFontExtLeading() const
ImplFontEntry* pEntry = mpFontEntry;
ImplFontMetricData* pMetric = &(pEntry->maMetric);
- return pMetric->mnExtLeading;
+ return pMetric->GetExternalLeading();
}
void OutputDevice::ImplClearFontData( const bool bNewFontLists )
@@ -1132,7 +1132,7 @@ size_t FontSelectPatternAttributes::hashCode() const
}
nHash += 11 * mnHeight;
nHash += 19 * GetWeight();
- nHash += 29 * GetSlant();
+ nHash += 29 * GetSlantType();
nHash += 37 * mnOrientation;
nHash += 41 * meLanguage;
if( mbVertical )
@@ -1200,7 +1200,7 @@ bool ImplFontCache::IFSD_Equal::operator()(const FontSelectPattern& rA, const Fo
// check font face attributes
if( (rA.GetWeight() != rB.GetWeight())
- || (rA.GetSlant() != rB.GetSlant())
+ || (rA.GetSlantType() != rB.GetSlantType())
// || (rA.meFamily != rB.meFamily) // TODO: remove this mostly obsolete member
|| (rA.GetPitch() != rB.GetPitch()) )
return false;
@@ -1598,13 +1598,13 @@ bool OutputDevice::ImplNewFont() const
{
pFontEntry->mbInit = true;
- pFontEntry->maMetric.mnOrientation = sal::static_int_cast<short>(pFontEntry->maFontSelData.mnOrientation);
+ pFontEntry->maMetric.SetOrientation( sal::static_int_cast<short>(pFontEntry->maFontSelData.mnOrientation) );
pGraphics->GetFontMetric( &(pFontEntry->maMetric) );
pFontEntry->maMetric.ImplInitTextLineSize( this );
pFontEntry->maMetric.ImplInitAboveTextLineSize();
- pFontEntry->mnLineHeight = pFontEntry->maMetric.mnAscent + pFontEntry->maMetric.mnDescent;
+ pFontEntry->mnLineHeight = pFontEntry->maMetric.GetAscent() + pFontEntry->maMetric.GetDescent();
SetFontOrientation( pFontEntry );
}
@@ -1614,11 +1614,14 @@ bool OutputDevice::ImplNewFont() const
if ( maFont.GetKerning() & FontKerning::FontSpecific )
{
// TODO: test if physical font supports kerning and disable if not
- if( pFontEntry->maMetric.mbKernableFont )
+ if( pFontEntry->maMetric.IsKernable() )
mbKerning = true;
}
else
+ {
mbKerning = false;
+ }
+
if ( maFont.GetKerning() & FontKerning::Asian )
mbKerning = true;
@@ -1647,7 +1650,7 @@ bool OutputDevice::ImplNewFont() const
else if ( eAlign == ALIGN_TOP )
{
mnTextOffX = 0;
- mnTextOffY = +pFontEntry->maMetric.mnAscent + mnEmphasisAscent;
+ mnTextOffY = +pFontEntry->maMetric.GetAscent() + mnEmphasisAscent;
if ( pFontEntry->mnOrientation )
{
Point aOriginPt(0, 0);
@@ -1657,7 +1660,7 @@ bool OutputDevice::ImplNewFont() const
else // eAlign == ALIGN_BOTTOM
{
mnTextOffX = 0;
- mnTextOffY = -pFontEntry->maMetric.mnDescent + mnEmphasisDescent;
+ mnTextOffY = -pFontEntry->maMetric.GetDescent() + mnEmphasisDescent;
if ( pFontEntry->mnOrientation )
{
Point aOriginPt(0, 0);
@@ -1675,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.mnWidth;
+ int nOrigWidth = pFontEntry->maMetric.GetWidth();
float fStretch = (float)maMapRes.mnMapScNumX * maMapRes.mnMapScDenomY;
fStretch /= (float)maMapRes.mnMapScNumY * maMapRes.mnMapScDenomX;
int nNewWidth = (int)(nOrigWidth * fStretch + 0.5);
@@ -1696,14 +1699,14 @@ bool OutputDevice::ImplNewFont() const
void OutputDevice::SetFontOrientation( ImplFontEntry* const pFontEntry ) const
{
- if( pFontEntry->maFontSelData.mnOrientation && !pFontEntry->maMetric.mnOrientation )
+ if( pFontEntry->maFontSelData.mnOrientation && !pFontEntry->maMetric.GetOrientation() )
{
pFontEntry->mnOwnOrientation = sal::static_int_cast<short>(pFontEntry->maFontSelData.mnOrientation);
pFontEntry->mnOrientation = pFontEntry->mnOwnOrientation;
}
else
{
- pFontEntry->mnOrientation = pFontEntry->maMetric.mnOrientation;
+ pFontEntry->mnOrientation = pFontEntry->maMetric.GetOrientation();
}
}
@@ -1746,7 +1749,6 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
, mnExtLeading( 0 )
, mnSlant( 0 )
, mnMinKashida( 0 )
- , meFamilyType(FAMILY_DONTKNOW)
, mbScalableFont(false)
, mbTrueTypeFont(false)
, mbFullstopCentered(false)
@@ -1782,16 +1784,16 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
{
SetFamilyName( rFontSelData.mpFontData->GetFamilyName() );
SetStyleName( rFontSelData.mpFontData->GetStyleName() );
- mbDevice = rFontSelData.mpFontData->IsBuiltInFont();
- mbKernableFont = true;
+ SetBuiltInFontFlag( rFontSelData.mpFontData->IsBuiltInFont() );
+ SetKernableFlag( true );
}
else
{
sal_Int32 nTokenPos = 0;
SetFamilyName( GetNextFontToken( rFontSelData.GetFamilyName(), nTokenPos ) );
SetStyleName( rFontSelData.GetStyleName() );
- mbDevice = false;
- mbKernableFont = false;
+ SetBuiltInFontFlag( false );
+ SetKernableFlag( false );
}
}
@@ -1864,9 +1866,8 @@ void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev )
else
mnWUnderlineSize = ((nWCalcSize*50)+50) / 100;
- // #109280# the following line assures that wavelines are never placed below the descent, however
- // for most fonts the waveline then is drawn into the text, so we better keep the old solution
- // pFontEntry->maMetric.mnWUnderlineOffset = pFontEntry->maMetric.mnDescent + 1 - pFontEntry->maMetric.mnWUnderlineSize;
+ // Don't assume that wavelines are never placed below the descent, because for most fonts the waveline
+ // is drawn into the text
mnWUnderlineOffset = nUnderlineOffset;
mnStrikeoutSize = nLineHeight;
@@ -1892,7 +1893,7 @@ void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev )
// In general, nB/nH < 5% for most Japanese fonts.
bCentered = nB > (((nH >> 1)+nH)>>3);
}
- mbFullstopCentered = bCentered ;
+ SetFullstopCenteredFlag( bCentered );
mnBulletOffset = ( pDev->GetTextWidth( OUString( sal_Unicode( 0x20 ) ) ) - pDev->GetTextWidth( OUString( sal_Unicode( 0xb7 ) ) ) ) >> 1 ;
@@ -2034,9 +2035,9 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
Point aOffset = Point(0,0);
if ( nEmphasisMark & EMPHASISMARK_POS_BELOW )
- aOffset.Y() += mpFontEntry->maMetric.mnDescent + nEmphasisYOff;
+ aOffset.Y() += mpFontEntry->maMetric.GetDescent() + nEmphasisYOff;
else
- aOffset.Y() -= mpFontEntry->maMetric.mnAscent + nEmphasisYOff;
+ aOffset.Y() -= mpFontEntry->maMetric.GetAscent() + nEmphasisYOff;
long nEmphasisWidth2 = nEmphasisWidth / 2;
long nEmphasisHeight2 = nEmphasisHeight / 2;
@@ -2199,7 +2200,7 @@ long OutputDevice::GetMinKashida() const
ImplFontEntry* pEntry = mpFontEntry;
ImplFontMetricData* pMetric = &(pEntry->maMetric);
- return ImplDevicePixelToLogicWidth( pMetric->mnMinKashida );
+ return ImplDevicePixelToLogicWidth( pMetric->GetMinKashida() );
}
sal_Int32 OutputDevice::ValidateKashidas ( const OUString& rTxt,
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 37edc64ae6e0..1686dbf5a926 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.mnAscent + mnEmphasisAscent),
+ ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.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.mnAscent + mnEmphasisAscent;
+ nY -= mpFontEntry->maMetric.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.mnAscent + mnEmphasisAscent;
+ int nTop = mpFontEntry->maMetric.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.mnAscent + mnEmphasisAscent);
+ aTopLeft.Y()+= mnTextOffY - (mpFontEntry->maMetric.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 19a2fac70aea..50707b5de757 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -221,13 +221,13 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
if ( bIsAbove )
{
- nLineHeight = pFontEntry->maMetric.mnAboveWUnderlineSize;
- nLinePos = pFontEntry->maMetric.mnAboveWUnderlineOffset;
+ nLineHeight = pFontEntry->maMetric.GetAboveWavelineUnderlineSize();
+ nLinePos = pFontEntry->maMetric.GetAboveWavelineUnderlineOffset();
}
else
{
- nLineHeight = pFontEntry->maMetric.mnWUnderlineSize;
- nLinePos = pFontEntry->maMetric.mnWUnderlineOffset;
+ nLineHeight = pFontEntry->maMetric.GetWavelineUnderlineSize();
+ nLinePos = pFontEntry->maMetric.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.mnAboveUnderlineSize;
- nLinePos = nY + pFontEntry->maMetric.mnAboveUnderlineOffset;
+ nLineHeight = pFontEntry->maMetric.GetAboveUnderlineSize();
+ nLinePos = nY + pFontEntry->maMetric.GetAboveUnderlineOffset();
}
else
{
- nLineHeight = pFontEntry->maMetric.mnUnderlineSize;
- nLinePos = nY + pFontEntry->maMetric.mnUnderlineOffset;
+ nLineHeight = pFontEntry->maMetric.GetUnderlineSize();
+ nLinePos = nY + pFontEntry->maMetric.GetUnderlineOffset();
}
break;
case UNDERLINE_BOLD:
@@ -320,27 +320,27 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
case UNDERLINE_BOLDDASHDOTDOT:
if ( bIsAbove )
{
- nLineHeight = pFontEntry->maMetric.mnAboveBUnderlineSize;
- nLinePos = nY + pFontEntry->maMetric.mnAboveBUnderlineOffset;
+ nLineHeight = pFontEntry->maMetric.GetAboveBoldUnderlineSize();
+ nLinePos = nY + pFontEntry->maMetric.GetAboveBoldUnderlineOffset();
}
else
{
- nLineHeight = pFontEntry->maMetric.mnBUnderlineSize;
- nLinePos = nY + pFontEntry->maMetric.mnBUnderlineOffset;
+ nLineHeight = pFontEntry->maMetric.GetBoldUnderlineSize();
+ nLinePos = nY + pFontEntry->maMetric.GetBoldUnderlineOffset();
}
break;
case UNDERLINE_DOUBLE:
if ( bIsAbove )
{
- nLineHeight = pFontEntry->maMetric.mnAboveDUnderlineSize;
- nLinePos = nY + pFontEntry->maMetric.mnAboveDUnderlineOffset1;
- nLinePos2 = nY + pFontEntry->maMetric.mnAboveDUnderlineOffset2;
+ nLineHeight = pFontEntry->maMetric.GetAboveDoubleUnderlineSize();
+ nLinePos = nY + pFontEntry->maMetric.GetAboveDoubleUnderlineOffset1();
+ nLinePos2 = nY + pFontEntry->maMetric.GetAboveDoubleUnderlineOffset2();
}
else
{
- nLineHeight = pFontEntry->maMetric.mnDUnderlineSize;
- nLinePos = nY + pFontEntry->maMetric.mnDUnderlineOffset1;
- nLinePos2 = nY + pFontEntry->maMetric.mnDUnderlineOffset2;
+ nLineHeight = pFontEntry->maMetric.GetDoubleUnderlineSize();
+ nLinePos = nY + pFontEntry->maMetric.GetDoubleUnderlineOffset1();
+ nLinePos2 = nY + pFontEntry->maMetric.GetDoubleUnderlineOffset2();
}
break;
default:
@@ -538,17 +538,17 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
switch ( eStrikeout )
{
case STRIKEOUT_SINGLE:
- nLineHeight = pFontEntry->maMetric.mnStrikeoutSize;
- nLinePos = nY + pFontEntry->maMetric.mnStrikeoutOffset;
+ nLineHeight = pFontEntry->maMetric.GetStrikeoutSize();
+ nLinePos = nY + pFontEntry->maMetric.GetStrikeoutOffset();
break;
case STRIKEOUT_BOLD:
- nLineHeight = pFontEntry->maMetric.mnBStrikeoutSize;
- nLinePos = nY + pFontEntry->maMetric.mnBStrikeoutOffset;
+ nLineHeight = pFontEntry->maMetric.GetBoldStrikeoutSize();
+ nLinePos = nY + pFontEntry->maMetric.GetBoldStrikeoutOffset();
break;
case STRIKEOUT_DOUBLE:
- nLineHeight = pFontEntry->maMetric.mnDStrikeoutSize;
- nLinePos = nY + pFontEntry->maMetric.mnDStrikeoutOffset1;
- nLinePos2 = nY + pFontEntry->maMetric.mnDStrikeoutOffset2;
+ nLineHeight = pFontEntry->maMetric.GetDoubleStrikeoutSize();
+ nLinePos = nY + pFontEntry->maMetric.GetDoubleStrikeoutOffset1();
+ nLinePos2 = nY + pFontEntry->maMetric.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.mnDescent;
- aPixelRect.Top() = nBaseY-mpFontEntry->maMetric.mnAscent;
+ aPixelRect.Bottom() = nBaseY+mpFontEntry->maMetric.GetDescent();
+ aPixelRect.Top() = nBaseY-mpFontEntry->maMetric.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.mnWUnderlineSize )
+ if( nWaveHeight > pFontEntry->maMetric.GetWavelineUnderlineSize() )
{
- nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
+ nWaveHeight = pFontEntry->maMetric.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 e92aa5552253..f7585503a847 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -444,7 +444,7 @@ FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttribut
psp::FastPrintFontInfo aInfo;
aInfo.m_aFamilyName = rFontAttributes.GetFamilyName();
- aInfo.m_eItalic = rFontAttributes.GetSlant();
+ aInfo.m_eItalic = rFontAttributes.GetSlantType();
aInfo.m_eWeight = rFontAttributes.GetWeight();
aInfo.m_eWidth = rFontAttributes.GetWidthType();
diff --git a/vcl/win/gdi/salgdi3.cxx b/vcl/win/gdi/salgdi3.cxx
index 8d69c6026b95..40213934b9fe 100644
--- a/vcl/win/gdi/salgdi3.cxx
+++ b/vcl/win/gdi/salgdi3.cxx
@@ -165,7 +165,7 @@ ImplFontAttrCache::~ImplFontAttrCache()
write_uInt16_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.GetFamilyName(), RTL_TEXTENCODING_UTF8);
aCacheFile.WriteInt16(rDFA.GetWeight());
- aCacheFile.WriteInt16(rDFA.GetSlant());
+ aCacheFile.WriteInt16(rDFA.GetSlantType());
aCacheFile.WriteInt16(rDFA.GetPitch());
aCacheFile.WriteInt16(rDFA.GetWidthType());
aCacheFile.WriteInt16(rDFA.GetFamilyType());
@@ -546,7 +546,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFon
pFontFamily = pFontCollection->FindFontFamilyByAttributes( ImplFontAttrs::Symbol,
rFontSelData.GetWeight(),
rFontSelData.GetWidthType(),
- rFontSelData.GetSlant(),
+ rFontSelData.GetSlantType(),
rFontSelData.maSearchName );
if( pFontFamily )
{
@@ -1309,7 +1309,7 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
rLogFont.lfWidth = (LONG)pFont->mnWidth;
rLogFont.lfUnderline = 0;
rLogFont.lfStrikeOut = 0;
- rLogFont.lfItalic = (pFont->GetSlant()) != ITALIC_NONE;
+ rLogFont.lfItalic = (pFont->GetSlantType()) != ITALIC_NONE;
rLogFont.lfEscapement = pFont->mnOrientation;
rLogFont.lfOrientation = rLogFont.lfEscapement;
rLogFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
@@ -1502,58 +1502,58 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
pMetric->SetWeight(ImplWeightToSal( aWinMetric.tmWeight ));
pMetric->SetPitch(ImplMetricPitchToSal( aWinMetric.tmPitchAndFamily ));
pMetric->SetItalic(aWinMetric.tmItalic ? ITALIC_NORMAL : ITALIC_NONE);
- pMetric->mnSlant = 0;
+ pMetric->SetSlant( 0 );
// device dependent font attributes
- pMetric->mbDevice = (aWinMetric.tmPitchAndFamily & TMPF_DEVICE) != 0;
- pMetric->mbScalableFont = (aWinMetric.tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE)) != 0;
- pMetric->mbTrueTypeFont = (aWinMetric.tmPitchAndFamily & TMPF_TRUETYPE) != 0;
- if( pMetric->mbScalableFont )
+ 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() )
{
// check if there are kern pairs
// TODO: does this work with GPOS kerning?
DWORD nKernPairs = ::GetKerningPairsA( getHDC(), 0, NULL );
- pMetric->mbKernableFont = (nKernPairs > 0);
+ pMetric->SetKernableFlag( (nKernPairs > 0) );
}
else
{
// bitmap fonts cannot be rotated directly
- pMetric->mnOrientation = 0;
+ pMetric->SetOrientation( 0 );
// bitmap fonts have no kerning
- pMetric->mbKernableFont = false;
+ pMetric->SetKernableFlag( false );
}
// transformation dependent font metrics
- pMetric->mnWidth = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAveCharWidth );
- pMetric->mnIntLeading = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmInternalLeading );
- pMetric->mnExtLeading = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmExternalLeading );
- pMetric->mnAscent = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAscent );
- pMetric->mnDescent = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmDescent );
+ pMetric->SetWidth( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAveCharWidth ) );
+ pMetric->SetInternalLeading( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmInternalLeading ) );
+ pMetric->SetExternalLeading( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmExternalLeading ) );
+ pMetric->SetAscent( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAscent ) );
+ pMetric->SetDescent( static_cast<int>( 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->mnIntLeading += pMetric->mnExtLeading;
+ pMetric->SetInternalLeading( pMetric->GetInternalLeading() + pMetric->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->mnExtLeading / 2;
- const long nOtherHalfTmpExtLeading = pMetric->mnExtLeading - nHalfTmpExtLeading;
+ const long nHalfTmpExtLeading = pMetric->GetExternalLeading() / 2;
+ const long nOtherHalfTmpExtLeading = pMetric->GetExternalLeading() - nHalfTmpExtLeading;
// #110641# external leading for Asian fonts.
// The factor 0.3 has been confirmed with experiments.
- long nCJKExtLeading = static_cast<long>(0.30 * (pMetric->mnAscent + pMetric->mnDescent));
- nCJKExtLeading -= pMetric->mnExtLeading;
- pMetric->mnExtLeading = (nCJKExtLeading > 0) ? nCJKExtLeading : 0;
+ long nCJKExtLeading = static_cast<long>(0.30 * (pMetric->GetAscent() + pMetric->GetDescent()));
+ nCJKExtLeading -= pMetric->GetExternalLeading();
+ pMetric->SetExternalLeading( (nCJKExtLeading > 0) ? nCJKExtLeading : 0 );
- pMetric->mnAscent += nHalfTmpExtLeading;
- pMetric->mnDescent += nOtherHalfTmpExtLeading;
+ pMetric->SetAscent( pMetric->GetAscent() + nHalfTmpExtLeading );
+ pMetric->SetDescent( pMetric->GetDescent() + nOtherHalfTmpExtLeading );
}
- pMetric->mnMinKashida = GetMinKashidaWidth();
+ pMetric->SetMinKashida( GetMinKashidaWidth() );
}
const FontCharMapPtr WinSalGraphics::GetFontCharMap() const
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 75d3467803ef..841b64b3156e 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.mbTrueTypeFont)
+ if (!mrWinFontEntry.maMetric.IsTrueTypeFont())
return false;
mrWinFontEntry.setupGLyphy(mhDC);