diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-14 12:25:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-14 14:37:08 +0200 |
commit | a199e4ea389c934d169a178433f4b94033e60f93 (patch) | |
tree | 9db7593426247484053f927b0e206cda86b0996f /vcl/unx/generic/fontmanager | |
parent | 3a933fddfdbbe158caac47b9957fb3c8d92506fb (diff) |
add pitch to the pattern
Change-Id: Ic32527feabb0405f17bd59779cf19553afaa1e7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114086
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/generic/fontmanager')
-rw-r--r-- | vcl/unx/generic/fontmanager/fontconfig.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 748fbf2d7b9a..689c4816e174 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -63,6 +63,7 @@ struct FontOptionsKey FontItalic m_eItalic; FontWeight m_eWeight; FontWidth m_eWidth; + FontPitch m_ePitch; bool operator==(const FontOptionsKey& rOther) const { @@ -70,7 +71,8 @@ struct FontOptionsKey m_nFontSize == rOther.m_nFontSize && m_eItalic == rOther.m_eItalic && m_eWeight == rOther.m_eWeight && - m_eWidth == rOther.m_eWidth; + m_eWidth == rOther.m_eWidth && + m_ePitch == rOther.m_ePitch; } }; @@ -88,6 +90,7 @@ template <> struct hash<FontOptionsKey> boost::hash_combine(seed, k.m_eItalic); boost::hash_combine(seed, k.m_eWeight); boost::hash_combine(seed, k.m_eWidth); + boost::hash_combine(seed, k.m_ePitch); return seed; } }; @@ -1188,7 +1191,8 @@ void FontConfigFontOptions::SyncPattern(const OString& rFileName, sal_uInt32 nIn std::unique_ptr<FontConfigFontOptions> PrintFontManager::getFontOptions(const FontAttributes& rInfo, int nSize) { - FontOptionsKey aKey{ rInfo.GetFamilyName(), nSize, rInfo.GetItalic(), rInfo.GetWeight(), rInfo.GetWidthType() }; + FontOptionsKey aKey{ rInfo.GetFamilyName(), nSize, rInfo.GetItalic(), + rInfo.GetWeight(), rInfo.GetWidthType(), rInfo.GetPitch() }; FontCfgWrapper& rWrapper = FontCfgWrapper::get(); @@ -1207,8 +1211,7 @@ std::unique_ptr<FontConfigFontOptions> PrintFontManager::getFontOptions(const Fo if( !sFamily.isEmpty() ) FcPatternAddString(pPattern, FC_FAMILY, reinterpret_cast<FcChar8 const *>(sFamily.getStr())); - // TODO: ePitch argument of always PITCH_DONTKNOW is suspicious - addtopattern(pPattern, aKey.m_eItalic, aKey.m_eWeight, aKey.m_eWidth, PITCH_DONTKNOW); + addtopattern(pPattern, aKey.m_eItalic, aKey.m_eWeight, aKey.m_eWidth, aKey.m_ePitch); FcPatternAddDouble(pPattern, FC_PIXEL_SIZE, nSize); FcConfigSubstitute(pConfig, pPattern, FcMatchPattern); |