From d07f18e0c3f8d50deea643c0ecab171795bd1231 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Thu, 28 Jul 2022 18:06:36 +0200 Subject: [PATCH] tdf#126754: Wrong OpenType tag for fractions in "font features" dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opentype defines only "frac" and not parameters values like 1 or 2 for "frac" See: https://en.wikipedia.org/wiki/List_of_typographic_features https://docs.microsoft.com/en-us/typography/opentype/spec/features_fj So remove STR_FONT_FEATURE_ID_FRAC_PARAM_0/1/2 + remove the extra ":" for STR_FONT_FEATURE_ID_FRAC I gave a try with "Alegraya" font, it worked. I also give a try with "Linux Biolinum G", there are still "None" (value "0"), "Diagonal fractions" (value "1") and "Nut fractions" (value "2"). It seems they're on the font itself like entry "'frac' Diagonal and nut Fractions". So it shouldn't bring regression. Change-Id: I2f46a3f4a53dc498b764dbeb1c1266589cc8d8c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137574 Reviewed-by: Caolán McNamara Tested-by: Jenkins Reviewed-by: Julien Nabet --- vcl/inc/font/OpenTypeFeatureStrings.hrc | 5 +---- vcl/source/font/OpenTypeFeatureDefinitionList.cxx | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/vcl/inc/font/OpenTypeFeatureStrings.hrc b/vcl/inc/font/OpenTypeFeatureStrings.hrc index 5e1960b95613..a8bb5473fafb 100644 --- a/vcl/inc/font/OpenTypeFeatureStrings.hrc +++ b/vcl/inc/font/OpenTypeFeatureStrings.hrc @@ -40,10 +40,7 @@ #define STR_FONT_FEATURE_ID_DPNG NC_("STR_FONT_FEATURE_ID_DPNG", "Diphthongs (Obsolete)") #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_FRAC NC_("STR_FONT_FEATURE_ID_FRAC", "Fraction style:") -#define STR_FONT_FEATURE_ID_FRAC_PARAM_0 NC_("STR_FONT_FEATURE_ID_FRAC_PARAM_0", "None") -#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_FRAC NC_("STR_FONT_FEATURE_ID_FRAC", "Fraction style") #define STR_FONT_FEATURE_ID_FWID NC_("STR_FONT_FEATURE_ID_FWID", "Full Widths") #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") diff --git a/vcl/source/font/OpenTypeFeatureDefinitionList.cxx b/vcl/source/font/OpenTypeFeatureDefinitionList.cxx index bd60c0e3bd32..f49837ccec43 100644 --- a/vcl/source/font/OpenTypeFeatureDefinitionList.cxx +++ b/vcl/source/font/OpenTypeFeatureDefinitionList.cxx @@ -45,10 +45,7 @@ void OpenTypeFeatureDefinitionListPrivate::init() { featureCode("dpng"), STR_FONT_FEATURE_ID_DPNG }, { featureCode("expt"), STR_FONT_FEATURE_ID_EXPT }, { featureCode("falt"), STR_FONT_FEATURE_ID_FALT }, - { featureCode("frac"), STR_FONT_FEATURE_ID_FRAC, - std::vector{ { 0, STR_FONT_FEATURE_ID_FRAC_PARAM_0 }, - { 1, STR_FONT_FEATURE_ID_FRAC_PARAM_1 }, - { 2, STR_FONT_FEATURE_ID_FRAC_PARAM_2 } } }, + { featureCode("frac"), STR_FONT_FEATURE_ID_FRAC }, { featureCode("fwid"), STR_FONT_FEATURE_ID_FWID }, { featureCode("halt"), STR_FONT_FEATURE_ID_HALT }, { featureCode("hist"), STR_FONT_FEATURE_ID_HIST },