summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-12 14:47:34 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-12 05:36:04 +0000
commitb4b0cc2a5eef42434444e51fda4a13fc48183aa0 (patch)
tree1061efa135f480b37c90879d7c049872d0e738eb /vcl/quartz
parent414c5c5aee8692614e4e5a5f97d11bea157bcaef (diff)
vcl: resplit FontAttributes from ImplFontMetricData
The change I made in commit 7b974e056df3 ("vcl: merge ImplFontMetricData with ImplFontAttributes") was... ill-advised. For starters, there really needs to be this split as FontSelectPattern needs it, and PhysicalFontFace only requires the font attributes, not the metric data. So the merge was unfortunately, in my mind, a failure and I'm manually backing it out now. Change-Id: Iac38f0815f984541e2f55099c965376dd88eeb43 Reviewed-on: https://gerrit.libreoffice.org/21380 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/ctfonts.cxx20
-rw-r--r--vcl/quartz/salgdi.cxx6
2 files changed, 14 insertions, 12 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 5052f7888a7e..ef8767fbc587 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -117,7 +117,7 @@ CoreTextStyle::~CoreTextStyle()
CFRelease( mpStyleDict );
}
-void CoreTextStyle::GetFontAttributes( FontAttributes& rFontAttributes ) const
+void CoreTextStyle::GetFontMetric( ImplFontMetricData& rFontMetric ) const
{
// get the matching CoreText font handle
// TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it here?
@@ -125,20 +125,20 @@ void CoreTextStyle::GetFontAttributes( FontAttributes& rFontAttributes ) const
const CGFloat fAscent = CTFontGetAscent( aCTFontRef );
const CGFloat fCapHeight = CTFontGetCapHeight( aCTFontRef );
- rFontAttributes.SetAscent( lrint( fAscent ) );
- rFontAttributes.SetDescent( lrint( CTFontGetDescent( aCTFontRef )) );
- rFontAttributes.SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) );
- rFontAttributes.SetInternalLeading( lrint( fAscent - fCapHeight ) );
+ rFontMetric.SetAscent( lrint( fAscent ) );
+ rFontMetric.SetDescent( lrint( CTFontGetDescent( aCTFontRef )) );
+ rFontMetric.SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) );
+ rFontMetric.SetInternalLeading( lrint( fAscent - fCapHeight ) );
- // since FontAttributes::mnWidth is only used for stretching/squeezing fonts
+ // 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
- rFontAttributes.SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) );
+ rFontMetric.SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) );
// all CoreText fonts are scalable
- rFontAttributes.SetScalableFlag( true );
- rFontAttributes.SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far
- rFontAttributes.SetKernableFlag( true );
+ rFontMetric.SetScalableFlag( true );
+ rFontMetric.SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far
+ rFontMetric.SetKernableFlag( true );
}
bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 9785126ada48..fb9e8dbbe758 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -41,6 +41,8 @@
#include "fontsubset.hxx"
#include "impfont.hxx"
#include "impfontcharmap.hxx"
+#include "impfontmetricdata.hxx"
+
#ifdef MACOSX
#include "osx/salframe.h"
#endif
@@ -306,9 +308,9 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor )
// SAL_ DEBUG(std::hex << nSalColor << std::dec << "={" << maTextColor.GetRed() << ", " << maTextColor.GetGreen() << ", " << maTextColor.GetBlue() << ", " << maTextColor.GetAlpha() << "}");
}
-void AquaSalGraphics::GetFontAttributes( FontAttributes* pFontAttributes, int /*nFallbackLevel*/ )
+void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pFontMetric, int /*nFallbackLevel*/ )
{
- mpTextStyle->GetFontAttributes( *pFontAttributes );
+ mpTextStyle->GetFontMetric( *pFontMetric );
}
static bool AddTempDevFont(const OUString& rFontFileURL)