summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/fontmanager
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-04 19:38:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-05 11:20:23 +0200
commit7003fe557bd2223e9af1ed0eb6c97b209686a8ab (patch)
tree90c13717ebc2dce5859ce36fdc571e1fee0a90d2 /vcl/unx/generic/fontmanager
parent0b495a630b7c449b3e8911d3970449776e502ce9 (diff)
rhbz#1875377 if sort order is equivalent keep order fontconfig presents
there are two fonts in fedora 32/33 for regular Cantarell /usr/share/fonts/cantarell/Cantarell-Regular.otf and /usr/share/fonts/cantarell/Cantarell-VF.otf where VF is the Variable Font version. The Cantarell-Regular ones has a CFF table and export to pdf creates a font subset that works perfectly fine. The VF one does not have a CFF table and the fallback case doesn't work for pdf export. Both have the same version, use a stable sort to retain their relative order that fontconfig presents so we use the Cantarell-Regular version we would see if we didn't sort by version at all. Change-Id: I750006b980810fc59e0a152d42ae17f29f46e3b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102062 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.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index d8cc1db16849..65cba56e069c 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -213,7 +213,7 @@ FcFontSet* FontCfgWrapper::getFontSet()
addFontSet( FcSetSystem );
addFontSet( FcSetApplication );
- ::std::sort(m_pFontSet->fonts,m_pFontSet->fonts+m_pFontSet->nfont,SortFont());
+ std::stable_sort(m_pFontSet->fonts,m_pFontSet->fonts+m_pFontSet->nfont,SortFont());
}
return m_pFontSet;