diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2021-09-26 08:17:26 +1000 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-27 22:13:02 +0200 |
commit | 2f51bf35daa7d2e1612647e1768c443028e87c39 (patch) | |
tree | 95fd29350da03666c21319d8d2b275a479ad94b2 /vcl/unx/generic/fontmanager/fontsubst.cxx | |
parent | 5e4e1cdb1e14354b42838e1dfcf82873b3071896 (diff) |
vcl: move FontSelectPattern to own file and into vcl::font namespace
Change-Id: I2f01a8e67c52ece9b434777203aa9fbc9ac8be02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122613
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl/unx/generic/fontmanager/fontsubst.cxx')
-rw-r--r-- | vcl/unx/generic/fontmanager/fontsubst.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/vcl/unx/generic/fontmanager/fontsubst.cxx b/vcl/unx/generic/fontmanager/fontsubst.cxx index 6a363fd79f53..9559a252b089 100644 --- a/vcl/unx/generic/fontmanager/fontsubst.cxx +++ b/vcl/unx/generic/fontmanager/fontsubst.cxx @@ -32,8 +32,8 @@ class FcPreMatchSubstitution : public ImplPreMatchFontSubstitution { public: - bool FindFontSubstitute( FontSelectPattern& ) const override; - typedef ::std::pair<FontSelectPattern, FontSelectPattern> value_type; + bool FindFontSubstitute( vcl::font::FontSelectPattern& ) const override; + typedef ::std::pair<vcl::font::FontSelectPattern, vcl::font::FontSelectPattern> value_type; private: typedef ::std::list<value_type> CachedFontMapType; mutable CachedFontMapType maCachedFontMap; @@ -44,7 +44,7 @@ class FcGlyphFallbackSubstitution { // TODO: add a cache public: - bool FindFontSubstitute(FontSelectPattern&, LogicalFontInstance* pLogicalFont, OUString& rMissingCodes) const override; + bool FindFontSubstitute(vcl::font::FontSelectPattern&, LogicalFontInstance* pLogicalFont, OUString& rMissingCodes) const override; }; } @@ -60,9 +60,9 @@ void SalGenericInstance::RegisterFontSubstitutors( PhysicalFontCollection* pFont pFontCollection->SetFallbackHook( &aSubstFallback ); } -static FontSelectPattern GetFcSubstitute(const FontSelectPattern &rFontSelData, OUString& rMissingCodes) +static vcl::font::FontSelectPattern GetFcSubstitute(const vcl::font::FontSelectPattern &rFontSelData, OUString& rMissingCodes) { - FontSelectPattern aSubstituted(rFontSelData); + vcl::font::FontSelectPattern aSubstituted(rFontSelData); psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); rMgr.Substitute(aSubstituted, rMissingCodes); return aSubstituted; @@ -70,7 +70,7 @@ static FontSelectPattern GetFcSubstitute(const FontSelectPattern &rFontSelData, namespace { - bool uselessmatch(const FontSelectPattern &rOrig, const FontSelectPattern &rNew) + bool uselessmatch(const vcl::font::FontSelectPattern &rOrig, const vcl::font::FontSelectPattern &rNew) { return ( @@ -85,9 +85,9 @@ namespace class equal { private: - const FontSelectPattern& mrAttributes; + const vcl::font::FontSelectPattern& mrAttributes; public: - explicit equal(const FontSelectPattern& rAttributes) + explicit equal(const vcl::font::FontSelectPattern& rAttributes) : mrAttributes(rAttributes) { } @@ -96,7 +96,7 @@ namespace }; } -bool FcPreMatchSubstitution::FindFontSubstitute(FontSelectPattern &rFontSelData) const +bool FcPreMatchSubstitution::FindFontSubstitute(vcl::font::FontSelectPattern &rFontSelData) const { // We don't actually want to talk to Fontconfig at all for symbol fonts if( rFontSelData.IsSymbolFont() ) @@ -110,7 +110,7 @@ bool FcPreMatchSubstitution::FindFontSubstitute(FontSelectPattern &rFontSelData) //different fonts depending on fontsize, bold, etc settings so don't cache //just on the name, cache map all the input and all the output not just map //from original selection to output fontname - FontSelectPattern& rPatternAttributes = rFontSelData; + vcl::font::FontSelectPattern& rPatternAttributes = rFontSelData; CachedFontMapType &rCachedFontMap = maCachedFontMap; CachedFontMapType::iterator itr = std::find_if(rCachedFontMap.begin(), rCachedFontMap.end(), equal(rPatternAttributes)); if (itr != rCachedFontMap.end()) @@ -126,7 +126,7 @@ bool FcPreMatchSubstitution::FindFontSubstitute(FontSelectPattern &rFontSelData) } OUString aDummy; - const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, aDummy ); + const vcl::font::FontSelectPattern aOut = GetFcSubstitute( rFontSelData, aDummy ); if( aOut.maSearchName.isEmpty() ) return false; @@ -170,7 +170,7 @@ bool FcPreMatchSubstitution::FindFontSubstitute(FontSelectPattern &rFontSelData) return bHaveSubstitute; } -bool FcGlyphFallbackSubstitution::FindFontSubstitute(FontSelectPattern& rFontSelData, +bool FcGlyphFallbackSubstitution::FindFontSubstitute(vcl::font::FontSelectPattern& rFontSelData, LogicalFontInstance* /*pLogicalFont*/, OUString& rMissingCodes ) const { @@ -181,7 +181,7 @@ bool FcGlyphFallbackSubstitution::FindFontSubstitute(FontSelectPattern& rFontSel if ( IsStarSymbol(rFontSelData.maSearchName) ) return false; - const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, rMissingCodes ); + const vcl::font::FontSelectPattern aOut = GetFcSubstitute( rFontSelData, rMissingCodes ); // TODO: cache the unicode + srcfont specific result // FC doing it would be preferable because it knows the invariables // e.g. FC knows the FC rule that all Arial gets replaced by LiberationSans |