summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/FontFeaturesDialog.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-07-30 10:38:43 +0200
committerTomaž Vajngerl <quikee@gmail.com>2018-07-31 18:29:39 +0200
commit74317ed5f794816bc9b33e087c5412833fbba420 (patch)
treeb192e0a424d3434d3cbc8cc0db17029b9d640554 /cui/source/dialogs/FontFeaturesDialog.cxx
parentaa2e694e8d9e22de94dbf21f81883f9af0e34ce9 (diff)
Font features: Use Graphite instead of HarfBuzz if available
When searching for font features, use Graphtie if it is available instead of HarfBuzz, because HarfBuzz will only give a subset of OpenType features in a Graphite font, but will ignore additional features specific to Graphite. Change-Id: I00c8790ee4d1e1ab906928f649d2a3e54163557f Reviewed-on: https://gerrit.libreoffice.org/58306 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'cui/source/dialogs/FontFeaturesDialog.cxx')
-rw-r--r--cui/source/dialogs/FontFeaturesDialog.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx
index 21c71ce753b7..078e9a630a80 100644
--- a/cui/source/dialogs/FontFeaturesDialog.cxx
+++ b/cui/source/dialogs/FontFeaturesDialog.cxx
@@ -9,7 +9,6 @@
*/
#include <FontFeaturesDialog.hxx>
-
#include <vcl/font/FeatureParser.hxx>
#include <svx/dialmgr.hxx>
@@ -56,20 +55,32 @@ void FontFeaturesDialog::initialize()
if (!aVDev->GetFontFeatures(rFontFeatures))
return;
- vcl::font::FeatureParser aParser(m_sFontName);
- std::unordered_map<sal_uInt32, sal_uInt32> aExistingFeatures = aParser.getFeaturesMap();
-
std::unordered_set<sal_uInt32> aDoneFeatures;
+ std::vector<vcl::font::Feature> rFilteredFontFeatures;
- sal_Int32 i = 0;
for (vcl::font::Feature const& rFontFeature : rFontFeatures)
{
sal_uInt32 nFontFeatureCode = rFontFeature.m_aID.m_aFeatureCode;
-
if (aDoneFeatures.find(nFontFeatureCode) != aDoneFeatures.end())
continue;
-
aDoneFeatures.insert(nFontFeatureCode);
+ rFilteredFontFeatures.push_back(rFontFeature);
+ }
+
+ fillGrid(rFilteredFontFeatures);
+
+ updateFontPreview();
+}
+
+void FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures)
+{
+ vcl::font::FeatureParser aParser(m_sFontName);
+ std::unordered_map<sal_uInt32, sal_uInt32> aExistingFeatures = aParser.getFeaturesMap();
+
+ sal_Int32 i = 0;
+ for (vcl::font::Feature const& rFontFeature : rFontFeatures)
+ {
+ sal_uInt32 nFontFeatureCode = rFontFeature.m_aID.m_aFeatureCode;
vcl::font::FeatureDefinition aDefinition;
if (rFontFeature.m_aDefinition)
@@ -138,8 +149,6 @@ void FontFeaturesDialog::initialize()
i++;
}
-
- updateFontPreview();
}
void FontFeaturesDialog::updateFontPreview()