summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-11-16 20:48:50 +0200
committerTor Lillqvist <tml@collabora.com>2015-11-19 12:56:58 +0200
commit6190be11a69ba1c5007c10fdc6db0a8d35d12230 (patch)
tree88b99b7476b018c6c2826d6ff37593917190b8ec
parent149d889adc2997bf303c1e51cb183a5da24feb73 (diff)
Add ImplFontMetricData::mbTrueTypeFont
Indicates that the font truly is a TrueType one (FT_IS_SFNT in FreeType, TMPF_TRUETYPE in Win32). Change-Id: Ic9dbf5e5239ae2ca597c454091fc36073a3b19cc
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx3
-rw-r--r--vcl/generic/print/genpspgraphics.cxx1
-rw-r--r--vcl/inc/outfont.hxx1
-rw-r--r--vcl/quartz/ctfonts.cxx1
-rw-r--r--vcl/source/outdev/font.cxx1
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx1
6 files changed, 7 insertions, 1 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index bef54776e6b8..2e874e51eccc 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -636,7 +636,8 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
{
static_cast<ImplFontAttributes&>(rTo) = mpFontInfo->GetFontAttributes();
- rTo.mbScalableFont = true;
+ 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;
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index c0e214d51e51..f1f92020e7d0 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -923,6 +923,7 @@ void GenPspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
static_cast<ImplFontAttributes&>(*pMetric) = aDFA;
pMetric->mbDevice = aDFA.mbDevice;
pMetric->mbScalableFont = true;
+ pMetric->mbTrueTypeFont = false; // FIXME, needed?
pMetric->mnOrientation = m_pPrinterGfx->GetFontAngle();
pMetric->mnSlant = 0;
diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index 9511f230c31e..8eef436fa757 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -173,6 +173,7 @@ public: // TODO: hide members behind accessor methods
int meFamilyType; // Font Family Type
bool mbDevice; // Flag for Device Fonts
bool mbScalableFont;
+ bool mbTrueTypeFont;
bool mbKernableFont;
bool mbFullstopCentered;
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 204261833989..a5882ca717d8 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -136,6 +136,7 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricData& rMetric ) const
// 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;
}
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 3686d71ed76c..8f443ce5a252 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1746,6 +1746,7 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
, mnMinKashida( 0 )
, meFamilyType(FAMILY_DONTKNOW)
, mbScalableFont(false)
+ , mbTrueTypeFont(false)
, mbFullstopCentered(false)
, mnUnderlineSize( 0 )
, mnUnderlineOffset( 0 )
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index fbb3b872e6d8..94127996dba5 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1596,6 +1596,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// 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 )
{
// check if there are kern pairs