[Libreoffice-commits] core.git: vcl/inc vcl/qa vcl/source
Khaled Hosny
khaledhosny at eglug.org
Mon Jun 18 12:54:08 UTC 2018
vcl/inc/font/OpenTypeFeatureDefinitonList.hxx | 2
vcl/inc/font/OpenTypeFeatureStrings.hrc | 52 ----------------
vcl/qa/cppunit/FontFeatureTest.cxx | 12 +--
vcl/source/font/FeatureCollector.cxx | 3
vcl/source/font/OpenTypeFeatureDefinitonList.cxx | 72 +++++++----------------
5 files changed, 34 insertions(+), 107 deletions(-)
New commits:
commit 80e9f9f8d8cc3e1073f98b1413bc0b80b93ec4f9
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Sun Jun 17 15:48:14 2018 +0200
Skip required features from the features dialog
Many OpenType features are required features that are applied to certain
context determined by the layout engine, or should always be on. There
is no value in presenting these features to the user and they just
clutter the dialog for fonts that usually have many of such features
(e.g. Arabic or Indic fonts).
Change-Id: Idc3d7d3a9eb1c4f693ea6fdf9f26f0264b910f91
Reviewed-on: https://gerrit.libreoffice.org/55951
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/inc/font/OpenTypeFeatureDefinitonList.hxx b/vcl/inc/font/OpenTypeFeatureDefinitonList.hxx
index f606017d7412..b5abb2708f4f 100644
--- a/vcl/inc/font/OpenTypeFeatureDefinitonList.hxx
+++ b/vcl/inc/font/OpenTypeFeatureDefinitonList.hxx
@@ -26,12 +26,14 @@ class VCL_DLLPUBLIC OpenTypeFeatureDefinitonListPrivate
private:
std::vector<FeatureDefinition> m_aFeatureDefinition;
std::unordered_map<sal_uInt32, size_t> m_aCodeToIndex;
+ std::vector<sal_uInt32> m_aRequiredFeatures;
void init();
public:
OpenTypeFeatureDefinitonListPrivate();
FeatureDefinition getDefinition(sal_uInt32 nFeatureCode);
+ bool isRequired(sal_uInt32 nFeatureCode);
};
class VCL_DLLPUBLIC OpenTypeFeatureDefinitonList
diff --git a/vcl/inc/font/OpenTypeFeatureStrings.hrc b/vcl/inc/font/OpenTypeFeatureStrings.hrc
index 379a013b9f89..3ed3df4b90f4 100644
--- a/vcl/inc/font/OpenTypeFeatureStrings.hrc
+++ b/vcl/inc/font/OpenTypeFeatureStrings.hrc
@@ -23,27 +23,16 @@
#define NC_(Context, String) (Context "\004" u8##String)
#define STR_FONT_FEATURE_ID_AALT NC_("STR_FONT_FEATURE_ID_AALT", "Access All Alternates")
-#define STR_FONT_FEATURE_ID_ABVF NC_("STR_FONT_FEATURE_ID_ABVF", "Above Base Forms")
-#define STR_FONT_FEATURE_ID_ABVM NC_("STR_FONT_FEATURE_ID_ABVM", "Above Base Mark Positioning")
-#define STR_FONT_FEATURE_ID_ABVS NC_("STR_FONT_FEATURE_ID_ABVS", "Above Base Substitutions")
#define STR_FONT_FEATURE_ID_AFRC NC_("STR_FONT_FEATURE_ID_AFRC", "Alternative (Vertical) Fractions")
-#define STR_FONT_FEATURE_ID_AKHN NC_("STR_FONT_FEATURE_ID_AKHN", "Akhands")
#define STR_FONT_FEATURE_ID_ALIG NC_("STR_FONT_FEATURE_ID_ALIG", "Ancient Ligatures")
-#define STR_FONT_FEATURE_ID_BLWF NC_("STR_FONT_FEATURE_ID_BLWF", "Below Base Forms")
-#define STR_FONT_FEATURE_ID_BLWM NC_("STR_FONT_FEATURE_ID_BLWM", "Below Base Mark Positioning")
-#define STR_FONT_FEATURE_ID_BLWS NC_("STR_FONT_FEATURE_ID_BLWS", "Below Base Substitutions")
#define STR_FONT_FEATURE_ID_C2PC NC_("STR_FONT_FEATURE_ID_C2PC", "Capitals to Petite Capitals")
#define STR_FONT_FEATURE_ID_C2SC NC_("STR_FONT_FEATURE_ID_C2SC", "Capitals to Small Capitals")
#define STR_FONT_FEATURE_ID_CALT NC_("STR_FONT_FEATURE_ID_CALT", "Contextual Alternates")
#define STR_FONT_FEATURE_ID_CASE NC_("STR_FONT_FEATURE_ID_CASE", "Case-Sensitive Forms")
-#define STR_FONT_FEATURE_ID_CCMP NC_("STR_FONT_FEATURE_ID_CCMP", "Glyph Composition / Decomposition")
-#define STR_FONT_FEATURE_ID_CFAR NC_("STR_FONT_FEATURE_ID_CFAR", "Conjunct Form After Ro")
-#define STR_FONT_FEATURE_ID_CJCT NC_("STR_FONT_FEATURE_ID_CJCT", "Conjunct Forms")
#define STR_FONT_FEATURE_ID_CLIG NC_("STR_FONT_FEATURE_ID_CLIG", "Contextual Ligatures")
#define STR_FONT_FEATURE_ID_CPCT NC_("STR_FONT_FEATURE_ID_CPCT", "Centered CJK Punctuation")
#define STR_FONT_FEATURE_ID_CPSP NC_("STR_FONT_FEATURE_ID_CPSP", "Capital Spacing")
#define STR_FONT_FEATURE_ID_CSWH NC_("STR_FONT_FEATURE_ID_CSWH", "Contextual Swash")
-#define STR_FONT_FEATURE_ID_CURS NC_("STR_FONT_FEATURE_ID_CURS", "Cursive Attachment")
#define STR_FONT_FEATURE_ID_CV01 NC_("STR_FONT_FEATURE_ID_CV01", "Character Variant 1")
#define STR_FONT_FEATURE_ID_CV02 NC_("STR_FONT_FEATURE_ID_CV02", "Character Variant 2")
#define STR_FONT_FEATURE_ID_CV03 NC_("STR_FONT_FEATURE_ID_CV03", "Character Variant 3")
@@ -56,32 +45,22 @@
#define STR_FONT_FEATURE_ID_CV10 NC_("STR_FONT_FEATURE_ID_CV10", "Character Variant 10")
#define STR_FONT_FEATURE_ID_CV11 NC_("STR_FONT_FEATURE_ID_CV11", "Character Variant 11")
#define STR_FONT_FEATURE_ID_DCAP NC_("STR_FONT_FEATURE_ID_DCAP", "Drop Caps")
-#define STR_FONT_FEATURE_ID_DIST NC_("STR_FONT_FEATURE_ID_DIST", "Distances")
#define STR_FONT_FEATURE_ID_DLIG NC_("STR_FONT_FEATURE_ID_DLIG", "Discretionary Ligatures")
#define STR_FONT_FEATURE_ID_DNOM NC_("STR_FONT_FEATURE_ID_DNOM", "Denominators")
#define STR_FONT_FEATURE_ID_DPNG NC_("STR_FONT_FEATURE_ID_DPNG", "Dipthongs (Obsolete)")
-#define STR_FONT_FEATURE_ID_DTLS NC_("STR_FONT_FEATURE_ID_DTLS", "Dotless Forms")
#define STR_FONT_FEATURE_ID_EXPT NC_("STR_FONT_FEATURE_ID_EXPT", "Expert Forms")
#define STR_FONT_FEATURE_ID_FALT NC_("STR_FONT_FEATURE_ID_FALT", "Final Glyph on Line Alternates")
-#define STR_FONT_FEATURE_ID_FIN2 NC_("STR_FONT_FEATURE_ID_FIN2", "Terminal Forms #2")
-#define STR_FONT_FEATURE_ID_FIN3 NC_("STR_FONT_FEATURE_ID_FIN3", "Terminal Forms #3")
-#define STR_FONT_FEATURE_ID_FINA NC_("STR_FONT_FEATURE_ID_FINA", "Terminal Forms")
-#define STR_FONT_FEATURE_ID_FLAC NC_("STR_FONT_FEATURE_ID_FLAC", "Flattened Accent Over Capitals")
#define STR_FONT_FEATURE_ID_FRAC NC_("STR_FONT_FEATURE_ID_FRAC", "DIagonal Fractions")
#define STR_FONT_FEATURE_ID_FRAC_PARAM_1 NC_("STR_FONT_FEATURE_ID_FRAC_PARAM_1", "Diagonal Fractions")
#define STR_FONT_FEATURE_ID_FRAC_PARAM_2 NC_("STR_FONT_FEATURE_ID_FRAC_PARAM_2", "Nut Fractions")
#define STR_FONT_FEATURE_ID_FWID NC_("STR_FONT_FEATURE_ID_FWID", "Full Widths")
-#define STR_FONT_FEATURE_ID_HALF NC_("STR_FONT_FEATURE_ID_HALF", "Half Forms")
-#define STR_FONT_FEATURE_ID_HALN NC_("STR_FONT_FEATURE_ID_HALN", "Halant Forms")
#define STR_FONT_FEATURE_ID_HALT NC_("STR_FONT_FEATURE_ID_HALT", "Alternate Half Widths")
#define STR_FONT_FEATURE_ID_HIST NC_("STR_FONT_FEATURE_ID_HIST", "Historical Forms")
#define STR_FONT_FEATURE_ID_HKNA NC_("STR_FONT_FEATURE_ID_HKNA", "Horizontal Kana Alternates")
#define STR_FONT_FEATURE_ID_HLIG NC_("STR_FONT_FEATURE_ID_HLIG", "Historical Ligatures")
-#define STR_FONT_FEATURE_ID_HNGL NC_("STR_FONT_FEATURE_ID_HNGL", "Hanja to Hangul")
+#define STR_FONT_FEATURE_ID_HNGL NC_("STR_FONT_FEATURE_ID_HNGL", "Hanja to Hangul (Obsolete)")
#define STR_FONT_FEATURE_ID_HOJO NC_("STR_FONT_FEATURE_ID_HOJO", "Hojo Kanji Forms (JIS X 0212-1990 Kanji Forms)")
#define STR_FONT_FEATURE_ID_HWID NC_("STR_FONT_FEATURE_ID_HWID", "Half Widths")
-#define STR_FONT_FEATURE_ID_INIT NC_("STR_FONT_FEATURE_ID_INIT", "Initial Forms")
-#define STR_FONT_FEATURE_ID_ISOL NC_("STR_FONT_FEATURE_ID_ISOL", "Isolated Forms")
#define STR_FONT_FEATURE_ID_ITAL NC_("STR_FONT_FEATURE_ID_ITAL", "Italics")
#define STR_FONT_FEATURE_ID_JALT NC_("STR_FONT_FEATURE_ID_JALT", "Justification Alternates")
#define STR_FONT_FEATURE_ID_JP04 NC_("STR_FONT_FEATURE_ID_JP04", "JIS2004 Forms")
@@ -91,20 +70,10 @@
#define STR_FONT_FEATURE_ID_KERN NC_("STR_FONT_FEATURE_ID_KERN", "Horizontal Kerning")
#define STR_FONT_FEATURE_ID_LFBD NC_("STR_FONT_FEATURE_ID_LFBD", "Left Bounds")
#define STR_FONT_FEATURE_ID_LIGA NC_("STR_FONT_FEATURE_ID_LIGA", "Standard Ligatures")
-#define STR_FONT_FEATURE_ID_LJMO NC_("STR_FONT_FEATURE_ID_LJMO", "Leading Jamo Forms")
#define STR_FONT_FEATURE_ID_LNUM NC_("STR_FONT_FEATURE_ID_LNUM", "Lining Figures")
-#define STR_FONT_FEATURE_ID_LOCL NC_("STR_FONT_FEATURE_ID_LOCL", "Localized Forms")
-#define STR_FONT_FEATURE_ID_LTRA NC_("STR_FONT_FEATURE_ID_LTRA", "Left to Right Alternates")
-#define STR_FONT_FEATURE_ID_LTRM NC_("STR_FONT_FEATURE_ID_LTRM", "Left to Right Mirrored Forms")
-#define STR_FONT_FEATURE_ID_MARK NC_("STR_FONT_FEATURE_ID_MARK", "Mark Positioning")
-#define STR_FONT_FEATURE_ID_MED2 NC_("STR_FONT_FEATURE_ID_MED2", "Medial Forms #2")
-#define STR_FONT_FEATURE_ID_MEDI NC_("STR_FONT_FEATURE_ID_MEDI", "Medial Forms")
#define STR_FONT_FEATURE_ID_MGRK NC_("STR_FONT_FEATURE_ID_MGRK", "Mathematical Greek")
-#define STR_FONT_FEATURE_ID_MKMK NC_("STR_FONT_FEATURE_ID_MKMK", "Mark to Mark Positioning")
-#define STR_FONT_FEATURE_ID_MSET NC_("STR_FONT_FEATURE_ID_MSET", "Mark Positioning via Substitution")
#define STR_FONT_FEATURE_ID_NALT NC_("STR_FONT_FEATURE_ID_NALT", "Alternate Annotation Forms")
#define STR_FONT_FEATURE_ID_NLCK NC_("STR_FONT_FEATURE_ID_NLCK", "NLC Kanji Forms")
-#define STR_FONT_FEATURE_ID_NUKT NC_("STR_FONT_FEATURE_ID_NUKT", "Nukta Forms")
#define STR_FONT_FEATURE_ID_NUMR NC_("STR_FONT_FEATURE_ID_NUMR", "Numerators")
#define STR_FONT_FEATURE_ID_ONUM NC_("STR_FONT_FEATURE_ID_ONUM", "Oldstyle Figures")
#define STR_FONT_FEATURE_ID_OPBD NC_("STR_FONT_FEATURE_ID_OPBD", "Optical Bounds")
@@ -114,25 +83,12 @@
#define STR_FONT_FEATURE_ID_PCAP NC_("STR_FONT_FEATURE_ID_PCAP", "Lowercase to Petite Capitals")
#define STR_FONT_FEATURE_ID_PKNA NC_("STR_FONT_FEATURE_ID_PKNA", "Proportional Kana")
#define STR_FONT_FEATURE_ID_PNUM NC_("STR_FONT_FEATURE_ID_PNUM", "Proportional Numbers")
-#define STR_FONT_FEATURE_ID_PREF NC_("STR_FONT_FEATURE_ID_PREF", "Pre Base Forms")
-#define STR_FONT_FEATURE_ID_PRES NC_("STR_FONT_FEATURE_ID_PRES", "Pre Base Substitutions")
-#define STR_FONT_FEATURE_ID_PSTF NC_("STR_FONT_FEATURE_ID_PSTF", "Post Base Forms")
-#define STR_FONT_FEATURE_ID_PSTS NC_("STR_FONT_FEATURE_ID_PSTS", "Post Base Substitutions")
#define STR_FONT_FEATURE_ID_PWID NC_("STR_FONT_FEATURE_ID_PWID", "Proportional Widths")
#define STR_FONT_FEATURE_ID_QWID NC_("STR_FONT_FEATURE_ID_QWID", "Quarter Widths")
-#define STR_FONT_FEATURE_ID_RAND NC_("STR_FONT_FEATURE_ID_RAND", "Randomize")
-#define STR_FONT_FEATURE_ID_RCLT NC_("STR_FONT_FEATURE_ID_RCLT", "Required Contextual Alternates")
-#define STR_FONT_FEATURE_ID_RKRF NC_("STR_FONT_FEATURE_ID_RKRF", "Rakar Forms")
-#define STR_FONT_FEATURE_ID_RLIG NC_("STR_FONT_FEATURE_ID_RLIG", "Required Ligatures")
-#define STR_FONT_FEATURE_ID_RPHF NC_("STR_FONT_FEATURE_ID_RPHF", "Reph Forms")
#define STR_FONT_FEATURE_ID_RTBD NC_("STR_FONT_FEATURE_ID_RTBD", "Right Bounds")
-#define STR_FONT_FEATURE_ID_RTLA NC_("STR_FONT_FEATURE_ID_RTLA", "Right to Left Alternates")
-#define STR_FONT_FEATURE_ID_RTLM NC_("STR_FONT_FEATURE_ID_RTLM", "Right to Left Mirrored Forms")
#define STR_FONT_FEATURE_ID_RUBY NC_("STR_FONT_FEATURE_ID_RUBY", "Ruby Notation Forms")
-#define STR_FONT_FEATURE_ID_RVRN NC_("STR_FONT_FEATURE_ID_RVRN", "Required Variation Alternates")
#define STR_FONT_FEATURE_ID_SALT NC_("STR_FONT_FEATURE_ID_SALT", "Stylistic Alternates")
#define STR_FONT_FEATURE_ID_SINF NC_("STR_FONT_FEATURE_ID_SINF", "Scientific Inferiors")
-#define STR_FONT_FEATURE_ID_SIZE NC_("STR_FONT_FEATURE_ID_SIZE", "Optical Size")
#define STR_FONT_FEATURE_ID_SMCP NC_("STR_FONT_FEATURE_ID_SMCP", "Lowercase to Small Capitals")
#define STR_FONT_FEATURE_ID_SMPL NC_("STR_FONT_FEATURE_ID_SMPL", "Simplified Forms")
#define STR_FONT_FEATURE_ID_SS01 NC_("STR_FONT_FEATURE_ID_SS01", "Stylistic Set 1")
@@ -155,23 +111,17 @@
#define STR_FONT_FEATURE_ID_SS18 NC_("STR_FONT_FEATURE_ID_SS18", "Stylistic Set 18")
#define STR_FONT_FEATURE_ID_SS19 NC_("STR_FONT_FEATURE_ID_SS19", "Stylistic Set 19")
#define STR_FONT_FEATURE_ID_SS20 NC_("STR_FONT_FEATURE_ID_SS20", "Stylistic Set 20")
-#define STR_FONT_FEATURE_ID_SSTY NC_("STR_FONT_FEATURE_ID_SSTY", "Script Style")
-#define STR_FONT_FEATURE_ID_STCH NC_("STR_FONT_FEATURE_ID_STCH", "Stretching Glyph Decomposition")
#define STR_FONT_FEATURE_ID_SUBS NC_("STR_FONT_FEATURE_ID_SUBS", "Subscript")
#define STR_FONT_FEATURE_ID_SUPS NC_("STR_FONT_FEATURE_ID_SUPS", "Superscript")
#define STR_FONT_FEATURE_ID_SWSH NC_("STR_FONT_FEATURE_ID_SWSH", "Swash")
#define STR_FONT_FEATURE_ID_TITL NC_("STR_FONT_FEATURE_ID_TITL", "Titling")
-#define STR_FONT_FEATURE_ID_TJMO NC_("STR_FONT_FEATURE_ID_TJMO", "Trailing Jamo Forms")
#define STR_FONT_FEATURE_ID_TNAM NC_("STR_FONT_FEATURE_ID_TNAM", "Traditional Name Forms")
#define STR_FONT_FEATURE_ID_TNUM NC_("STR_FONT_FEATURE_ID_TNUM", "Tabular Numbers")
#define STR_FONT_FEATURE_ID_TRAD NC_("STR_FONT_FEATURE_ID_TRAD", "Traditional Forms")
#define STR_FONT_FEATURE_ID_TWID NC_("STR_FONT_FEATURE_ID_TWID", "Third Widths")
#define STR_FONT_FEATURE_ID_UNIC NC_("STR_FONT_FEATURE_ID_UNIC", "Unicase")
#define STR_FONT_FEATURE_ID_VALT NC_("STR_FONT_FEATURE_ID_VALT", "Alternate Vertical Metrics")
-#define STR_FONT_FEATURE_ID_VATU NC_("STR_FONT_FEATURE_ID_VATU", "Vattu Variants")
-#define STR_FONT_FEATURE_ID_VERT NC_("STR_FONT_FEATURE_ID_VERT", "Vertical Alternatives")
#define STR_FONT_FEATURE_ID_VHAL NC_("STR_FONT_FEATURE_ID_VHAL", "Alternate Vertical Half Metrics")
-#define STR_FONT_FEATURE_ID_VJMO NC_("STR_FONT_FEATURE_ID_VJMO", "Vowel Jamo Forms")
#define STR_FONT_FEATURE_ID_VKNA NC_("STR_FONT_FEATURE_ID_VKNA", "Vertical Kana Alternates")
#define STR_FONT_FEATURE_ID_VKRN NC_("STR_FONT_FEATURE_ID_VKRN", "Vertical Kerning")
#define STR_FONT_FEATURE_ID_VPAL NC_("STR_FONT_FEATURE_ID_VPAL", "Proportional Alternate Vertical Metrics")
diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx
index 63cc4913bb8d..5ab293574d71 100644
--- a/vcl/qa/cppunit/FontFeatureTest.cxx
+++ b/vcl/qa/cppunit/FontFeatureTest.cxx
@@ -59,12 +59,12 @@ void FontFeatureTest::testGetFontFeatures()
}
}
- CPPUNIT_ASSERT_EQUAL(size_t(31), rDefaultFontFeatures.size());
+ CPPUNIT_ASSERT_EQUAL(size_t(27), rDefaultFontFeatures.size());
- OUString aExpectedFeaturesString = "aalt c2sc case ccmp dlig fina frac hlig "
- "liga lnum nalt onum pnum salt sinf smcp "
- "ss01 ss02 ss03 ss04 ss05 ss06 sups tnum "
- "zero cpsp kern lfbd mark mkmk rtbd ";
+ OUString aExpectedFeaturesString = "aalt c2sc case dlig frac hlig liga lnum "
+ "nalt onum pnum salt sinf smcp ss01 ss02 "
+ "ss03 ss04 ss05 ss06 sups tnum zero cpsp "
+ "kern lfbd rtbd ";
CPPUNIT_ASSERT_EQUAL(aExpectedFeaturesString, aFeaturesString);
// Check C2SC feature
@@ -83,7 +83,7 @@ void FontFeatureTest::testGetFontFeatures()
// Check FRAC feature
{
- vcl::font::Feature& rFeature = rDefaultFontFeatures[6];
+ vcl::font::Feature& rFeature = rDefaultFontFeatures[4];
CPPUNIT_ASSERT_EQUAL(vcl::font::featureCode("frac"), rFeature.m_aID.m_aFeatureCode);
vcl::font::FeatureDefinition& rFracFeatureDefinition = rFeature.m_aDefinition;
diff --git a/vcl/source/font/FeatureCollector.cxx b/vcl/source/font/FeatureCollector.cxx
index 1087a9311daf..790c3a484dcb 100644
--- a/vcl/source/font/FeatureCollector.cxx
+++ b/vcl/source/font/FeatureCollector.cxx
@@ -92,6 +92,9 @@ void FeatureCollector::collectForLanguage(hb_tag_t aTableTag, sal_uInt32 nScript
for (hb_tag_t aFeatureTag : aFeatureTags)
{
+ if (OpenTypeFeatureDefinitonList::get().isRequired(aFeatureTag))
+ continue;
+
m_rFontFeatures.emplace_back();
vcl::font::Feature& rFeature = m_rFontFeatures.back();
rFeature.m_aID = { aFeatureTag, aScriptTag, aLanguageTag };
diff --git a/vcl/source/font/OpenTypeFeatureDefinitonList.cxx b/vcl/source/font/OpenTypeFeatureDefinitonList.cxx
index 17ee8268c741..8b5ce4858956 100644
--- a/vcl/source/font/OpenTypeFeatureDefinitonList.cxx
+++ b/vcl/source/font/OpenTypeFeatureDefinitonList.cxx
@@ -22,27 +22,16 @@ void OpenTypeFeatureDefinitonListPrivate::init()
{
m_aFeatureDefinition.assign({
{ featureCode("aalt"), STR_FONT_FEATURE_ID_AALT },
- { featureCode("abvf"), STR_FONT_FEATURE_ID_ABVF },
- { featureCode("abvm"), STR_FONT_FEATURE_ID_ABVM },
- { featureCode("abvs"), STR_FONT_FEATURE_ID_ABVS },
{ featureCode("afrc"), STR_FONT_FEATURE_ID_AFRC },
- { featureCode("akhn"), STR_FONT_FEATURE_ID_AKHN },
{ featureCode("alig"), STR_FONT_FEATURE_ID_ALIG },
- { featureCode("blwf"), STR_FONT_FEATURE_ID_BLWF },
- { featureCode("blwm"), STR_FONT_FEATURE_ID_BLWM },
- { featureCode("blws"), STR_FONT_FEATURE_ID_BLWS },
{ featureCode("c2pc"), STR_FONT_FEATURE_ID_C2PC },
{ featureCode("c2sc"), STR_FONT_FEATURE_ID_C2SC },
{ featureCode("calt"), STR_FONT_FEATURE_ID_CALT },
{ featureCode("case"), STR_FONT_FEATURE_ID_CASE },
- { featureCode("ccmp"), STR_FONT_FEATURE_ID_CCMP },
- { featureCode("cfar"), STR_FONT_FEATURE_ID_CFAR },
- { featureCode("cjct"), STR_FONT_FEATURE_ID_CJCT },
{ featureCode("clig"), STR_FONT_FEATURE_ID_CLIG },
{ featureCode("cpct"), STR_FONT_FEATURE_ID_CPCT },
{ featureCode("cpsp"), STR_FONT_FEATURE_ID_CPSP },
{ featureCode("cswh"), STR_FONT_FEATURE_ID_CSWH },
- { featureCode("curs"), STR_FONT_FEATURE_ID_CURS },
{ featureCode("cv01"), STR_FONT_FEATURE_ID_CV01 },
{ featureCode("cv02"), STR_FONT_FEATURE_ID_CV02 },
{ featureCode("cv03"), STR_FONT_FEATURE_ID_CV03 },
@@ -53,23 +42,15 @@ void OpenTypeFeatureDefinitonListPrivate::init()
{ featureCode("cv08"), STR_FONT_FEATURE_ID_CV08 },
{ featureCode("cv09"), STR_FONT_FEATURE_ID_CV09 },
{ featureCode("dcap"), STR_FONT_FEATURE_ID_DCAP },
- { featureCode("dist"), STR_FONT_FEATURE_ID_DIST },
{ featureCode("dlig"), STR_FONT_FEATURE_ID_DLIG },
{ featureCode("dnom"), STR_FONT_FEATURE_ID_DNOM },
{ featureCode("dpng"), STR_FONT_FEATURE_ID_DPNG },
- { featureCode("dtls"), STR_FONT_FEATURE_ID_DTLS },
{ featureCode("expt"), STR_FONT_FEATURE_ID_EXPT },
{ featureCode("falt"), STR_FONT_FEATURE_ID_FALT },
- { featureCode("fin2"), STR_FONT_FEATURE_ID_FIN2 },
- { featureCode("fin3"), STR_FONT_FEATURE_ID_FIN3 },
- { featureCode("fina"), STR_FONT_FEATURE_ID_FINA },
- { featureCode("flac"), STR_FONT_FEATURE_ID_FLAC },
{ featureCode("frac"), STR_FONT_FEATURE_ID_FRAC,
std::vector<FeatureParameter>{ { 1, STR_FONT_FEATURE_ID_FRAC_PARAM_1 },
{ 2, STR_FONT_FEATURE_ID_FRAC_PARAM_2 } } },
{ featureCode("fwid"), STR_FONT_FEATURE_ID_FWID },
- { featureCode("half"), STR_FONT_FEATURE_ID_HALF },
- { featureCode("haln"), STR_FONT_FEATURE_ID_HALN },
{ featureCode("halt"), STR_FONT_FEATURE_ID_HALT },
{ featureCode("hist"), STR_FONT_FEATURE_ID_HIST },
{ featureCode("hkna"), STR_FONT_FEATURE_ID_HKNA },
@@ -77,8 +58,6 @@ void OpenTypeFeatureDefinitonListPrivate::init()
{ featureCode("hngl"), STR_FONT_FEATURE_ID_HNGL },
{ featureCode("hojo"), STR_FONT_FEATURE_ID_HOJO },
{ featureCode("hwid"), STR_FONT_FEATURE_ID_HWID },
- { featureCode("init"), STR_FONT_FEATURE_ID_INIT },
- { featureCode("isol"), STR_FONT_FEATURE_ID_ISOL },
{ featureCode("ital"), STR_FONT_FEATURE_ID_ITAL },
{ featureCode("jalt"), STR_FONT_FEATURE_ID_JALT },
{ featureCode("jp78"), STR_FONT_FEATURE_ID_JP78 },
@@ -88,20 +67,10 @@ void OpenTypeFeatureDefinitonListPrivate::init()
{ featureCode("kern"), STR_FONT_FEATURE_ID_KERN },
{ featureCode("lfbd"), STR_FONT_FEATURE_ID_LFBD },
{ featureCode("liga"), STR_FONT_FEATURE_ID_LIGA },
- { featureCode("ljmo"), STR_FONT_FEATURE_ID_LJMO },
{ featureCode("lnum"), STR_FONT_FEATURE_ID_LNUM },
- { featureCode("locl"), STR_FONT_FEATURE_ID_LOCL },
- { featureCode("ltra"), STR_FONT_FEATURE_ID_LTRA },
- { featureCode("ltrm"), STR_FONT_FEATURE_ID_LTRM },
- { featureCode("mark"), STR_FONT_FEATURE_ID_MARK },
- { featureCode("med2"), STR_FONT_FEATURE_ID_MED2 },
- { featureCode("medi"), STR_FONT_FEATURE_ID_MEDI },
{ featureCode("mgrk"), STR_FONT_FEATURE_ID_MGRK },
- { featureCode("mkmk"), STR_FONT_FEATURE_ID_MKMK },
- { featureCode("mset"), STR_FONT_FEATURE_ID_MSET },
{ featureCode("nalt"), STR_FONT_FEATURE_ID_NALT },
{ featureCode("nlck"), STR_FONT_FEATURE_ID_NLCK },
- { featureCode("nukt"), STR_FONT_FEATURE_ID_NUKT },
{ featureCode("numr"), STR_FONT_FEATURE_ID_NUMR },
{ featureCode("onum"), STR_FONT_FEATURE_ID_ONUM },
{ featureCode("opbd"), STR_FONT_FEATURE_ID_OPBD },
@@ -111,25 +80,12 @@ void OpenTypeFeatureDefinitonListPrivate::init()
{ featureCode("pcap"), STR_FONT_FEATURE_ID_PCAP },
{ featureCode("pkna"), STR_FONT_FEATURE_ID_PKNA },
{ featureCode("pnum"), STR_FONT_FEATURE_ID_PNUM },
- { featureCode("pref"), STR_FONT_FEATURE_ID_PREF },
- { featureCode("pres"), STR_FONT_FEATURE_ID_PRES },
- { featureCode("pstf"), STR_FONT_FEATURE_ID_PSTF },
- { featureCode("psts"), STR_FONT_FEATURE_ID_PSTS },
{ featureCode("pwid"), STR_FONT_FEATURE_ID_PWID },
{ featureCode("qwid"), STR_FONT_FEATURE_ID_QWID },
- { featureCode("rand"), STR_FONT_FEATURE_ID_RAND },
- { featureCode("rclt"), STR_FONT_FEATURE_ID_RCLT },
- { featureCode("rkrf"), STR_FONT_FEATURE_ID_RKRF },
- { featureCode("rlig"), STR_FONT_FEATURE_ID_RLIG },
- { featureCode("rphf"), STR_FONT_FEATURE_ID_RPHF },
{ featureCode("rtbd"), STR_FONT_FEATURE_ID_RTBD },
- { featureCode("rtla"), STR_FONT_FEATURE_ID_RTLA },
- { featureCode("rtlm"), STR_FONT_FEATURE_ID_RTLM },
{ featureCode("ruby"), STR_FONT_FEATURE_ID_RUBY },
- { featureCode("rvrn"), STR_FONT_FEATURE_ID_RVRN },
{ featureCode("salt"), STR_FONT_FEATURE_ID_SALT },
{ featureCode("sinf"), STR_FONT_FEATURE_ID_SINF },
- { featureCode("size"), STR_FONT_FEATURE_ID_SIZE },
{ featureCode("smcp"), STR_FONT_FEATURE_ID_SMCP },
{ featureCode("smpl"), STR_FONT_FEATURE_ID_SMPL },
{ featureCode("ss01"), STR_FONT_FEATURE_ID_SS01 },
@@ -152,23 +108,17 @@ void OpenTypeFeatureDefinitonListPrivate::init()
{ featureCode("ss18"), STR_FONT_FEATURE_ID_SS18 },
{ featureCode("ss19"), STR_FONT_FEATURE_ID_SS19 },
{ featureCode("ss20"), STR_FONT_FEATURE_ID_SS20 },
- { featureCode("ssty"), STR_FONT_FEATURE_ID_SSTY },
- { featureCode("stch"), STR_FONT_FEATURE_ID_STCH },
{ featureCode("subs"), STR_FONT_FEATURE_ID_SUBS },
{ featureCode("sups"), STR_FONT_FEATURE_ID_SUPS },
{ featureCode("swsh"), STR_FONT_FEATURE_ID_SWSH },
{ featureCode("titl"), STR_FONT_FEATURE_ID_TITL },
- { featureCode("tjmo"), STR_FONT_FEATURE_ID_TJMO },
{ featureCode("tnam"), STR_FONT_FEATURE_ID_TNAM },
{ featureCode("tnum"), STR_FONT_FEATURE_ID_TNUM },
{ featureCode("trad"), STR_FONT_FEATURE_ID_TRAD },
{ featureCode("twid"), STR_FONT_FEATURE_ID_TWID },
{ featureCode("unic"), STR_FONT_FEATURE_ID_UNIC },
{ featureCode("valt"), STR_FONT_FEATURE_ID_VALT },
- { featureCode("vatu"), STR_FONT_FEATURE_ID_VATU },
- { featureCode("vert"), STR_FONT_FEATURE_ID_VERT },
{ featureCode("vhal"), STR_FONT_FEATURE_ID_VHAL },
- { featureCode("vjmo"), STR_FONT_FEATURE_ID_VJMO },
{ featureCode("vkna"), STR_FONT_FEATURE_ID_VKNA },
{ featureCode("vkrn"), STR_FONT_FEATURE_ID_VKRN },
{ featureCode("vpal"), STR_FONT_FEATURE_ID_VPAL },
@@ -181,6 +131,22 @@ void OpenTypeFeatureDefinitonListPrivate::init()
{
m_aCodeToIndex.emplace(m_aFeatureDefinition[i].getCode(), i);
}
+
+ m_aRequiredFeatures.assign({
+ featureCode("abvf"), featureCode("abvm"), featureCode("abvs"), featureCode("akhn"),
+ featureCode("blwf"), featureCode("blwm"), featureCode("blws"), featureCode("ccmp"),
+ featureCode("cfar"), featureCode("cjct"), featureCode("curs"), featureCode("dist"),
+ featureCode("dtls"), featureCode("fin2"), featureCode("fin3"), featureCode("fina"),
+ featureCode("flac"), featureCode("half"), featureCode("haln"), featureCode("init"),
+ featureCode("isol"), featureCode("ljmo"), featureCode("locl"), featureCode("ltra"),
+ featureCode("ltrm"), featureCode("mark"), featureCode("med2"), featureCode("medi"),
+ featureCode("mkmk"), featureCode("mset"), featureCode("nukt"), featureCode("pref"),
+ featureCode("pres"), featureCode("pstf"), featureCode("psts"), featureCode("rand"),
+ featureCode("rclt"), featureCode("rkrf"), featureCode("rlig"), featureCode("rphf"),
+ featureCode("rtla"), featureCode("rtlm"), featureCode("rvrn"), featureCode("size"),
+ featureCode("ssty"), featureCode("stch"), featureCode("tjmo"), featureCode("vatu"),
+ featureCode("vert"), featureCode("vjmo"),
+ });
}
FeatureDefinition OpenTypeFeatureDefinitonListPrivate::getDefinition(sal_uInt32 nFeatureCode)
@@ -193,6 +159,12 @@ FeatureDefinition OpenTypeFeatureDefinitonListPrivate::getDefinition(sal_uInt32
return FeatureDefinition();
}
+bool OpenTypeFeatureDefinitonListPrivate::isRequired(sal_uInt32 nFeatureCode)
+{
+ return std::find(m_aRequiredFeatures.begin(), m_aRequiredFeatures.end(), nFeatureCode)
+ != m_aRequiredFeatures.end();
+}
+
} // end font namespace
} // end vcl namespace
More information about the Libreoffice-commits
mailing list