[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Thu Jan 21 23:20:11 PST 2016
include/vcl/font.hxx | 2 ++
vcl/inc/impfont.hxx | 8 +++-----
vcl/source/font/font.cxx | 15 ++++++++++-----
vcl/source/outdev/font.cxx | 5 +++++
4 files changed, 20 insertions(+), 10 deletions(-)
New commits:
commit b75cb14034b51e9a385be37cf7f70e0df40d50ec
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Fri Jan 22 15:10:14 2016 +1100
vcl: add font map names to Font class
Added getter and setter for font map names to the Font class.
See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor
and mutator for font scaling in FontMetric") for reasoning behind
patch.
Change-Id: I3e12c900da6f3abe60ea9c8dc39178fdd3f98bb7
Reviewed-on: https://gerrit.libreoffice.org/21695
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx
index 498c6a5..b728f87 100644
--- a/include/vcl/font.hxx
+++ b/include/vcl/font.hxx
@@ -84,6 +84,7 @@ public:
// Device dependent functions
int GetQuality() const;
+ OUString GetMapNames() const;
bool IsBuiltInFont() const;
bool CanEmbed() const;
@@ -92,6 +93,7 @@ public:
void SetQuality(int);
void IncreaseQualityBy(int);
void DecreaseQualityBy(int);
+ void SetMapNames(OUString const &);
void SetBuiltInFontFlag(bool);
void SetEmbeddableFlag(bool);
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index e522c28..52b9a1b 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -67,20 +67,17 @@ public:
// device dependent functions
int GetQuality() const { return mnQuality; }
+ OUString GetMapNames() const { return maMapNames; }
void SetQuality( int nQuality ) { mnQuality = nQuality; }
void IncreaseQualityBy( int nQualityAmount ) { mnQuality += nQualityAmount; }
void DecreaseQualityBy( int nQualityAmount ) { mnQuality -= nQualityAmount; }
- /* Missing function: OUString GetMapNames() const; */
+ void SetMapNames( OUString const & aMapNames ) { maMapNames = aMapNames; }
bool IsBuiltInFont() const { return mbDevice; }
bool CanEmbed() const { return mbEmbeddable; }
bool CanSubset() const { return mbSubsettable; }
/* Missing function: bool CanRotate() const; */
- /* Missing function: bool HasMapNames() const; */
-
- /* Missing function: void SetNames( OUString const& ); */
- /* Missing function: void AddMapName( OUString const& ); */
void SetBuiltInFontFlag( bool bIsBuiltInFont ) { mbDevice = bIsBuiltInFont; }
void SetEmbeddableFlag( bool bEmbeddable ) { mbEmbeddable = bEmbeddable; }
@@ -126,6 +123,7 @@ private:
mbEmbeddable:1,
mbSubsettable:1;
int mnQuality;
+ OUString maMapNames;
friend SvStream& ReadImplFont( SvStream& rIStm, ImplFont& );
friend SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& );
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx
index 62f35bd..554cdb4 100644
--- a/vcl/source/font/font.cxx
+++ b/vcl/source/font/font.cxx
@@ -472,9 +472,9 @@ void Font::GetFontAttributes( FontAttributes& rAttrs ) const
SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont )
{
VersionCompat aCompat( rIStm, StreamMode::READ );
- sal_uInt16 nTmp16;
+ sal_uInt16 nTmp16;
bool bTmp;
- sal_uInt8 nTmp8;
+ sal_uInt8 nTmp8;
rImplFont.SetFamilyName( rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet()) );
rImplFont.maStyleName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet());
@@ -500,14 +500,16 @@ SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont )
if( aCompat.GetVersion() >= 2 )
{
rIStm.ReadUChar( nTmp8 ); rImplFont.meRelief = (FontRelief)nTmp8;
- rIStm.ReadUInt16( nTmp16 ); rImplFont.maCJKLanguageTag.reset( (LanguageType)nTmp16);
- rIStm.ReadCharAsBool( bTmp ); rImplFont.mbVertical = bTmp;
- rIStm.ReadUInt16( nTmp16 ); rImplFont.meEmphasisMark = (FontEmphasisMark)nTmp16;
+ rIStm.ReadUInt16( nTmp16 ); rImplFont.maCJKLanguageTag.reset( (LanguageType)nTmp16);
+ rIStm.ReadCharAsBool( bTmp ); rImplFont.mbVertical = bTmp;
+ rIStm.ReadUInt16( nTmp16 ); rImplFont.meEmphasisMark = (FontEmphasisMark)nTmp16;
}
+
if( aCompat.GetVersion() >= 3 )
{
rIStm.ReadUInt16( nTmp16 ); rImplFont.meOverline = (FontUnderline) nTmp16;
}
+
// Relief
// CJKContextLanguage
@@ -813,6 +815,9 @@ void Font::SetQuality( int nQuality ) { mpImplFont->SetQuality( nQuality ); }
void Font::IncreaseQualityBy( int nQualityAmount ) { mpImplFont->IncreaseQualityBy( nQualityAmount ); }
void Font::DecreaseQualityBy( int nQualityAmount ) { mpImplFont->DecreaseQualityBy( nQualityAmount ); }
+OUString Font::GetMapNames() const { return mpImplFont->GetMapNames(); }
+void Font::SetMapNames( OUString const & aMapNames ) { mpImplFont->SetMapNames(aMapNames); }
+
bool Font::IsBuiltInFont() const { return mpImplFont->IsBuiltInFont(); }
void Font::SetBuiltInFontFlag( bool bIsBuiltInFontFlag ) { mpImplFont->SetBuiltInFontFlag( bIsBuiltInFontFlag ); }
bool Font::CanEmbed() const { return mpImplFont->CanEmbed(); }
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 208aaa0..a425f1e 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -85,6 +85,7 @@ FontMetric OutputDevice::GetDevFont( int nDevFontIndex ) const
aFontMetric.SetScalableFlag( rData.IsScalable() );
aFontMetric.SetBuiltInFontFlag( rData.IsBuiltInFont() );
aFontMetric.SetQuality( rData.GetQuality() );
+ aFontMetric.SetMapNames( rData.GetMapNames() );
}
return aFontMetric;
@@ -225,6 +226,10 @@ FontMetric OutputDevice::GetFontMetric() const
aMetric.SetLineHeight( ImplDevicePixelToLogicHeight( xFontMetric->GetAscent() + xFontMetric->GetDescent() + mnEmphasisAscent + mnEmphasisDescent ) );
aMetric.SetSlant( ImplDevicePixelToLogicHeight( xFontMetric->GetSlant() ) );
+ // get miscellaneous data
+ aMetric.SetQuality( xFontMetric->GetQuality() );
+ aMetric.SetMapNames( xFontMetric->GetMapNames() );
+
SAL_INFO("vcl.gdi.fontmetric", "OutputDevice::GetFontMetric:" << aMetric);
xFontMetric = nullptr;
More information about the Libreoffice-commits
mailing list