[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Fri Jan 8 16:45:02 PST 2016
vcl/inc/PhysicalFontCollection.hxx | 2
vcl/source/font/PhysicalFontCollection.cxx | 2
vcl/source/font/fontcache.cxx | 2
vcl/source/font/fontselect.cxx | 68 +++++++++++++++++++++++++++++
vcl/source/outdev/font.cxx | 32 -------------
5 files changed, 71 insertions(+), 35 deletions(-)
New commits:
commit 85ac3cd63f6720ff2d3c4b7491f4ad296219fa53
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sat Jan 9 11:44:01 2016 +1100
vcl: move FontSelectPatternAttributes constructor to fontselect.cxx
Change-Id: I49041e086c1da6d9cc23781e10b00997f227da8e
diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx
index e1b8757..82c33f5 100644
--- a/vcl/source/font/fontselect.cxx
+++ b/vcl/source/font/fontselect.cxx
@@ -71,6 +71,40 @@ FontSelectPattern::FontSelectPattern( const vcl::Font& rFont,
{
}
+
+FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont,
+ const OUString& rSearchName, const Size& rSize, float fExactHeight )
+ : maSearchName( rSearchName )
+ , mnWidth( rSize.Width() )
+ , mnHeight( rSize.Height() )
+ , mfExactHeight( fExactHeight)
+ , mnOrientation( rFont.GetOrientation() )
+ , meLanguage( rFont.GetLanguage() )
+ , mbVertical( rFont.IsVertical() )
+ , mbNonAntialiased( false )
+ , mbEmbolden( false )
+{
+ maTargetName = GetFamilyName();
+
+ rFont.GetFontAttributes( *this );
+
+ // normalize orientation between 0 and 3600
+ if( 3600 <= (unsigned)mnOrientation )
+ {
+ if( mnOrientation >= 0 )
+ mnOrientation %= 3600;
+ else
+ mnOrientation = 3600 - (-mnOrientation % 3600);
+ }
+
+ // normalize width and height
+ if( mnHeight < 0 )
+ mnHeight = -mnHeight;
+ if( mnWidth < 0 )
+ mnWidth = -mnWidth;
+}
+
+
// NOTE: this ctor is still used on Windows. Do not remove.
#ifdef WNT
FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace& rFontData,
@@ -89,6 +123,40 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace
// NOTE: no normalization for width/height/orientation
}
+
+FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont,
+ const OUString& rSearchName, const Size& rSize, float fExactHeight )
+ : maSearchName( rSearchName )
+ , mnWidth( rSize.Width() )
+ , mnHeight( rSize.Height() )
+ , mfExactHeight( fExactHeight)
+ , mnOrientation( rFont.GetOrientation() )
+ , meLanguage( rFont.GetLanguage() )
+ , mbVertical( rFont.IsVertical() )
+ , mbNonAntialiased( false )
+ , mbEmbolden( false )
+{
+ maTargetName = GetFamilyName();
+
+ rFont.GetFontAttributes( *this );
+
+ // normalize orientation between 0 and 3600
+ if( 3600 <= (unsigned)mnOrientation )
+ {
+ if( mnOrientation >= 0 )
+ mnOrientation %= 3600;
+ else
+ mnOrientation = 3600 - (-mnOrientation % 3600);
+ }
+
+ // normalize width and height
+ if( mnHeight < 0 )
+ mnHeight = -mnHeight;
+ if( mnWidth < 0 )
+ mnWidth = -mnWidth;
+}
+
+
FontSelectPattern::FontSelectPattern( const PhysicalFontFace& rFontData,
const Size& rSize, float fExactHeight, int nOrientation, bool bVertical )
: FontSelectPatternAttributes(rFontData, rSize, fExactHeight, nOrientation, bVertical)
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 5032cbb..80c85fc 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -979,38 +979,6 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan
return aFont;
}
-FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont,
- const OUString& rSearchName, const Size& rSize, float fExactHeight )
- : maSearchName( rSearchName )
- , mnWidth( rSize.Width() )
- , mnHeight( rSize.Height() )
- , mfExactHeight( fExactHeight)
- , mnOrientation( rFont.GetOrientation() )
- , meLanguage( rFont.GetLanguage() )
- , mbVertical( rFont.IsVertical() )
- , mbNonAntialiased( false )
- , mbEmbolden( false )
-{
- maTargetName = GetFamilyName();
-
- rFont.GetFontAttributes( *this );
-
- // normalize orientation between 0 and 3600
- if( 3600 <= (unsigned)mnOrientation )
- {
- if( mnOrientation >= 0 )
- mnOrientation %= 3600;
- else
- mnOrientation = 3600 - (-mnOrientation % 3600);
- }
-
- // normalize width and height
- if( mnHeight < 0 )
- mnHeight = -mnHeight;
- if( mnWidth < 0 )
- mnWidth = -mnWidth;
-}
-
void OutputDevice::ImplInitFontList() const
{
if( !mpFontCollection->Count() )
commit 6ee8ba1e451f7a2bd890b265d0c0c0030519da31
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sat Jan 9 04:03:26 2016 +1100
vcl: FindFontFamilyByFont is not the best name after all
On second thoughts, FindFontFamilyByName is not a good name at all. I'm
changing it back to FindFontFamily. The parameter tells you how it's
being found.
Change-Id: Ie8278e1727075a49331135a149361a484aba91e5
diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx
index 87f4181..5b506a3 100644
--- a/vcl/inc/PhysicalFontCollection.hxx
+++ b/vcl/inc/PhysicalFontCollection.hxx
@@ -47,7 +47,7 @@ public:
// find the device font family
PhysicalFontFamily* FindFontFamily( const OUString& rFontName ) const;
PhysicalFontFamily* FindOrCreateFontFamily( const OUString &rFamilyName );
- PhysicalFontFamily* FindFontFamilyByFont( FontSelectPattern& ) const;
+ PhysicalFontFamily* FindFontFamily( FontSelectPattern& ) const;
PhysicalFontFamily* FindFontFamilyByTokenNames(const OUString& rTokenStr) const;
PhysicalFontFamily* FindFontFamilyByAttributes(ImplFontAttrs nSearchType, FontWeight, FontWidth,
FontItalic, const OUString& rSearchFamily) const;
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index bcfd9a7..0772310 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -986,7 +986,7 @@ ImplDeviceFontSizeList* PhysicalFontCollection::GetDeviceFontSizeList( const OUS
return pDeviceFontSizeList;
}
-PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByFont( FontSelectPattern& rFSD ) const
+PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& rFSD ) const
{
// give up if no fonts are available
if( !Count() )
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index d9e0dff..41723f8 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -170,7 +170,7 @@ LogicalFontInstance* ImplFontCache::GetFontInstance( PhysicalFontCollection* pFo
if( !pFontInstance ) // no direct cache hit
{
// find the best matching logical font family and update font selector accordingly
- pFontFamily = pFontList->FindFontFamilyByFont( aFontSelData );
+ pFontFamily = pFontList->FindFontFamily( aFontSelData );
DBG_ASSERT( (pFontFamily != nullptr), "ImplFontCache::Get() No logical font found!" );
if( pFontFamily )
aFontSelData.maSearchName = pFontFamily->GetSearchName();
More information about the Libreoffice-commits
mailing list