summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-03 15:34:45 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-03 06:14:41 +0000
commit7b974e056df3ad023b18592bc01394943305dc41 (patch)
tree8636d213740ec1ee2943105d65af147b8d6de2b7 /vcl/inc
parent694ec8930ab7d7a54805ec598be84845b502772c (diff)
vcl: merge ImplFontMetricData with ImplFontAttributes
Change-Id: Ia2fe20559745e705667f23cdd73cbe50c6371aaa Reviewed-on: https://gerrit.libreoffice.org/21053 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/cairotextrender.hxx2
-rw-r--r--vcl/inc/generic/genpspgraphics.h2
-rw-r--r--vcl/inc/generic/glyphcache.hxx2
-rw-r--r--vcl/inc/headless/svpgdi.hxx2
-rw-r--r--vcl/inc/outfont.hxx155
-rw-r--r--vcl/inc/quartz/salgdi.h4
-rw-r--r--vcl/inc/salgdi.hxx4
-rw-r--r--vcl/inc/textrender.hxx2
-rw-r--r--vcl/inc/unx/salgdi.h4
-rw-r--r--vcl/inc/win/salgdi.h2
10 files changed, 90 insertions, 89 deletions
diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx
index a40eab0a9ff6..87a501f080d4 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( ImplFontMetricData*, int nFallbackLevel ) override;
+ virtual void GetFontMetric( 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 947f2cae1066..286e84bbe14d 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( ImplFontMetricData*, int nFallbackLevel ) override;
+ virtual void GetFontMetric( 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 9ebe7f7ccfe0..9ead91b0ade3 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -160,7 +160,7 @@ public:
const FontSelectPattern& GetFontSelData() const { return maFontSelData; }
- void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
+ void FetchFontMetric( 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 d8cdaf16d6c1..d3ed113f0bcf 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( ImplFontMetricData*, int nFallbackLevel ) override;
+ virtual void GetFontMetric( 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 50d5137b9894..bba74b6c9e50 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -38,10 +38,14 @@ namespace vcl { class Font; }
class ConvertChar;
class OutputDevice;
class Size;
+class FontSelectPattern;
class ImplFontAttributes
{
public:
+ explicit ImplFontAttributes() {}
+ explicit ImplFontAttributes( const FontSelectPattern& );
+
// device independent font functions
const OUString& GetFamilyName() const { return maFamilyName; }
FontFamily GetFamilyType() const { return meFamily; }
@@ -102,82 +106,7 @@ public:
void SetSubsettableFlag( bool bSubsettable ) { mbSubsettable = bSubsettable; }
void SetOrientationFlag( bool bCanRotate ) { mbOrientation = bCanRotate; }
-private:
- // device independent variables
- OUString maFamilyName; // Font Family Name
- OUString maStyleName; // Font Style Name
- FontWeight meWeight; // Weight Type
- FontItalic meItalic; // Slant Type
- FontFamily meFamily; // Family Type
- FontPitch mePitch; // Pitch Type
- FontWidth meWidthType; // Width Type
- bool mbSymbolFlag; // Is font a symbol?
-
- // device dependent variables
- OUString maMapNames; // List of family name aliases separated with ';'
- int mnQuality; // Quality (used when similar fonts compete)
- bool mbOrientation; // true: physical font can be rotated
- bool mbDevice; // true: built in font
- bool mbSubsettable; // true: a subset of the font can be created
- bool mbEmbeddable; // true: the font can be embedded
-};
-
-class FontSelectPatternAttributes : public ImplFontAttributes
-{
-public:
- FontSelectPatternAttributes( const vcl::Font&, const OUString& rSearchName,
- const Size&, float fExactHeight );
-#ifdef WNT
- FontSelectPatternAttributes( const PhysicalFontFace&, const Size&,
- float fExactHeight, int nOrientation, bool bVertical );
-#endif
-
- size_t hashCode() const;
- bool operator==(const FontSelectPatternAttributes& rOther) const;
- bool operator!=(const FontSelectPatternAttributes& rOther) const
- {
- return !(*this == rOther);
- }
-
-public:
- OUString maTargetName; // name of the font name token that is chosen
- OUString maSearchName; // name of the font that matches best
- int mnWidth; // width of font in pixel units
- int mnHeight; // height of font in pixel units
- float mfExactHeight; // requested height (in pixels with subpixel details)
- int mnOrientation; // text orientation in 3600 system
- LanguageType meLanguage; // text language
- bool mbVertical; // vertical mode of requested font
- bool mbNonAntialiased; // true if antialiasing is disabled
-
- bool mbEmbolden; // Force emboldening
- ItalicMatrix maItalicMatrix; // Force matrix for slant
-};
-
-class FontSelectPattern : public FontSelectPatternAttributes
-{
-public:
- FontSelectPattern( const vcl::Font&, const OUString& rSearchName,
- const Size&, float fExactHeight );
-#ifdef WNT
-// ifdeffed to prevent it going into unusedcode.easy
- FontSelectPattern( const PhysicalFontFace&, const Size&,
- float fExactHeight, int nOrientation, bool bVertical );
-#endif
-
-public: // TODO: change to private
- const PhysicalFontFace* mpFontData; // a matching PhysicalFontFace object
- ImplFontEntry* mpFontEntry; // pointer to the resulting FontCache entry
-
- void copyAttributes(const FontSelectPatternAttributes &rAttributes);
-};
-
-// - ImplFontMetricData -
-
-class ImplFontMetricData : public ImplFontAttributes
-{
-public:
- explicit ImplFontMetricData( const FontSelectPattern& );
+ // Font metrics below
// font instance attributes from the font request
long GetWidth() { return mnWidth; }
@@ -241,10 +170,31 @@ public:
long GetDoubleStrikeoutOffset1() { return mnDStrikeoutOffset1; }
long GetDoubleStrikeoutOffset2() { return mnDStrikeoutOffset2; }
+
void ImplInitTextLineSize( const OutputDevice* pDev );
void ImplInitAboveTextLineSize();
private:
+ // device independent variables
+ OUString maFamilyName; // Font Family Name
+ OUString maStyleName; // Font Style Name
+ FontWeight meWeight; // Weight Type
+ FontItalic meItalic; // Slant Type
+ FontFamily meFamily; // Family Type
+ FontPitch mePitch; // Pitch Type
+ FontWidth meWidthType; // Width Type
+ bool mbSymbolFlag; // Is font a symbol?
+
+ // device dependent variables
+ OUString maMapNames; // List of family name aliases separated with ';'
+ int mnQuality; // Quality (used when similar fonts compete)
+ bool mbOrientation; // true: physical font can be rotated
+ bool mbDevice; // true: built in font
+ bool mbSubsettable; // true: a subset of the font can be created
+ bool mbEmbeddable; // true: the font can be embedded
+
+ // Font metrics below
+
// font instance attributes from the font request
long mnWidth; // Reference Width
short mnOrientation; // Rotation in 1/10 degrees
@@ -290,6 +240,57 @@ private:
long mnDStrikeoutSize; // Height of double strike-out
long mnDStrikeoutOffset1; // Offset of double strike-out to baseline
long mnDStrikeoutOffset2; // Offset of double strike-out to baseline
+
+};
+
+class FontSelectPatternAttributes : public ImplFontAttributes
+{
+public:
+ FontSelectPatternAttributes( const vcl::Font&, const OUString& rSearchName,
+ const Size&, float fExactHeight );
+#ifdef WNT
+ FontSelectPatternAttributes( const PhysicalFontFace&, const Size&,
+ float fExactHeight, int nOrientation, bool bVertical );
+#endif
+
+ size_t hashCode() const;
+ bool operator==(const FontSelectPatternAttributes& rOther) const;
+ bool operator!=(const FontSelectPatternAttributes& rOther) const
+ {
+ return !(*this == rOther);
+ }
+
+public:
+ OUString maTargetName; // name of the font name token that is chosen
+ OUString maSearchName; // name of the font that matches best
+ int mnWidth; // width of font in pixel units
+ int mnHeight; // height of font in pixel units
+ float mfExactHeight; // requested height (in pixels with subpixel details)
+ int mnOrientation; // text orientation in 3600 system
+ LanguageType meLanguage; // text language
+ bool mbVertical; // vertical mode of requested font
+ bool mbNonAntialiased; // true if antialiasing is disabled
+
+ bool mbEmbolden; // Force emboldening
+ ItalicMatrix maItalicMatrix; // Force matrix for slant
+};
+
+class FontSelectPattern : public FontSelectPatternAttributes
+{
+public:
+ FontSelectPattern( const vcl::Font&, const OUString& rSearchName,
+ const Size&, float fExactHeight );
+#ifdef WNT
+// ifdeffed to prevent it going into unusedcode.easy
+ FontSelectPattern( const PhysicalFontFace&, const Size&,
+ float fExactHeight, int nOrientation, bool bVertical );
+#endif
+
+public: // TODO: change to private
+ const PhysicalFontFace* mpFontData; // a matching PhysicalFontFace object
+ ImplFontEntry* mpFontEntry; // pointer to the resulting FontCache entry
+
+ void copyAttributes(const FontSelectPatternAttributes &rAttributes);
};
// - ImplFontEntry -
@@ -306,7 +307,7 @@ public:
public: // TODO: make data members private
ImplFontCache * m_pFontCache;
FontSelectPattern maFontSelData; // FontSelectionData
- ImplFontMetricData maMetric; // Font Metric
+ ImplFontAttributes maMetric; // Font Metric
const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol
long mnLineHeight;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 557e7d65c130..8b78337743ef 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -94,7 +94,7 @@ public:
SalLayout* GetTextLayout( void ) const;
- void GetFontMetric( ImplFontMetricData& ) const;
+ void GetFontMetric( 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( ImplFontMetricData*, int nFallbackLevel ) override;
+ virtual void GetFontMetric( 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 9fd39796a8e8..f3c105f3148f 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -41,7 +41,7 @@
class PhysicalFontCollection;
class SalBitmap;
class FontSelectPattern;
-class ImplFontMetricData;
+class ImplFontAttributes;
class PhysicalFontFace;
class SalLayout;
class ImplLayoutArgs;
@@ -145,7 +145,7 @@ public:
void ReleaseFonts() { SetFont( nullptr, 0 ); }
// get the current font's metrics
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
+ virtual void GetFontMetric( 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 32795fb0c4a9..938acaba4c76 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( ImplFontMetricData*, int nFallbackLevel ) = 0;
+ virtual void GetFontMetric( 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 ffe0918bb7ad..9f93d18337e2 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -36,7 +36,7 @@
#include <deque>
#include <memory>
-class ImplFontMetricData;
+class ImplFontAttributes;
class FontSelectPattern;
class SalBitmap;
class SalColormap;
@@ -114,7 +114,7 @@ public:
virtual void SetTextColor( SalColor nSalColor ) override;
virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override;
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) override;
+ virtual void GetFontMetric( 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 7372c46c2f97..f822d9a2f81b 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( ImplFontMetricData*, int nFallbackLevel ) override;
+ virtual void GetFontMetric( 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