[Libreoffice-commits] core.git: vcl/inc vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Aug 21 19:37:45 UTC 2018
vcl/inc/PhysicalFontCollection.hxx | 3 ++-
vcl/source/font/PhysicalFontCollection.cxx | 15 ++++++++-------
vcl/source/font/fontcache.cxx | 2 +-
3 files changed, 11 insertions(+), 9 deletions(-)
New commits:
commit 01aef877c2e8df428fa68ce9be7695b0407c433a
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 20 15:55:07 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 21 21:37:21 2018 +0200
split into FontSelectPatternAttributes and LogicalFontInstance args
Change-Id: I099d9de60e6ca85f6cf048fe935cdfe5a804e78b
Reviewed-on: https://gerrit.libreoffice.org/59374
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx
index 08ce6dcf98c1..d8b6006cd6bf 100644
--- a/vcl/inc/PhysicalFontCollection.hxx
+++ b/vcl/inc/PhysicalFontCollection.hxx
@@ -55,7 +55,8 @@ public:
FontItalic, const OUString& rSearchFamily) const;
// suggest fonts for glyph fallback
- PhysicalFontFamily* GetGlyphFallbackFont( FontSelectPattern&,
+ PhysicalFontFamily* GetGlyphFallbackFont( FontSelectPatternAttributes&,
+ LogicalFontInstance* pLogicalFont,
OUString& rMissingCodes, int nFallbackLevel ) const;
// prepare platform specific font substitutions
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 77bbfd57a061..fc5a08ca8feb 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -170,7 +170,8 @@ void PhysicalFontCollection::ImplInitGenericGlyphFallback() const
mpFallbackList = std::move(pFallbackList);
}
-PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPattern& rFontSelData,
+PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatternAttributes& rFontSelData,
+ LogicalFontInstance* pFontInstance,
OUString& rMissingCodes,
int nFallbackLevel ) const
{
@@ -187,7 +188,7 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatt
while( nStrIndex < rMissingCodes.getLength() )
{
cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
- bCached = rFontSelData.mpFontInstance->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName );
+ bCached = pFontInstance->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName );
// ignore entries which don't have a fallback
if( !bCached || !rFontSelData.maSearchName.isEmpty() )
@@ -205,7 +206,7 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatt
while( nStrIndex < rMissingCodes.getLength() )
{
cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
- bCached = rFontSelData.mpFontInstance->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &aFontName );
+ bCached = pFontInstance->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &aFontName );
if( !bCached || (rFontSelData.maSearchName != aFontName) )
pRemainingCodes[ nRemainingLength++ ] = cChar;
}
@@ -216,7 +217,7 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatt
OUString aOldMissingCodes = rMissingCodes;
// call the hook to query the best matching glyph fallback font
- if (mpFallbackHook->FindFontSubstitute(rFontSelData, rFontSelData.mpFontInstance.get(), rMissingCodes))
+ if (mpFallbackHook->FindFontSubstitute(rFontSelData, pFontInstance, rMissingCodes))
// apply outdev3.cxx specific fontname normalization
rFontSelData.maSearchName = GetEnglishSearchFontName( rFontSelData.maSearchName );
else
@@ -233,8 +234,8 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatt
{
for(;;)
{
- if( !rFontSelData.mpFontInstance->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName ) )
- rFontSelData.mpFontInstance->AddFallbackForUnicode( cChar, rFontSelData.GetWeight(), rFontSelData.maSearchName );
+ if( !pFontInstance->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName ) )
+ pFontInstance->AddFallbackForUnicode( cChar, rFontSelData.GetWeight(), rFontSelData.maSearchName );
if( nStrIndex >= aOldMissingCodes.getLength() )
break;
cChar = aOldMissingCodes.iterateCodePoints( &nStrIndex );
@@ -245,7 +246,7 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatt
for( nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
{
cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
- rFontSelData.mpFontInstance->IgnoreFallbackForUnicode( cChar, rFontSelData.GetWeight(), rFontSelData.maSearchName );
+ pFontInstance->IgnoreFallbackForUnicode( cChar, rFontSelData.GetWeight(), rFontSelData.maSearchName );
}
}
}
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index 5355fb3b97f0..5ab66052e9c1 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -212,7 +212,7 @@ rtl::Reference<LogicalFontInstance> ImplFontCache::GetGlyphFallbackFont( Physica
if (nFallbackLevel == 1)
pFallbackData = pFontCollection->FindFontFamily("EUDC");
if (!pFallbackData)
- pFallbackData = pFontCollection->GetGlyphFallbackFont(rFontSelData, rMissingCodes, nFallbackLevel-1);
+ pFallbackData = pFontCollection->GetGlyphFallbackFont(rFontSelData, rFontSelData.mpFontInstance.get(), rMissingCodes, nFallbackLevel-1);
// escape when there are no font candidates
if( !pFallbackData )
return nullptr;
More information about the Libreoffice-commits
mailing list