diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-03 09:33:28 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-03 03:29:55 +0000 |
commit | 694ec8930ab7d7a54805ec598be84845b502772c (patch) | |
tree | 9e44148884d0f01e21b853512fccc7b971f2f1f3 /vcl/quartz | |
parent | 91f41c3ec23eb063873db8a03c3f6806e2e68af8 (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/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 22 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 2 |
2 files changed, 12 insertions, 12 deletions
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 ); |