Bug 136634 - Font feature descriptions for "Linux Biolinum G" et al. can't be localized
Summary: Font feature descriptions for "Linux Biolinum G" et al. can't be localized
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Rendering Not-Localizable
  Show dependency treegraph
 
Reported: 2020-09-10 05:14 UTC by Ming Hua
Modified: 2023-05-15 16:03 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of font feature dialog for "Linux Biolinum G" (45.19 KB, image/png)
2020-09-10 05:16 UTC, Ming Hua
Details
Screenshot of font feature dialog for "Times New Roman" (9.66 KB, image/png)
2020-09-10 05:18 UTC, Ming Hua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ming Hua 2020-09-10 05:14:25 UTC
My understanding is that the three fonts "Linux Biolinum G", "Linux Libertine G", and "Linux Libertine Display G" have a rather special place in the fonts bundled by LibreOffice, as they provice some feautures that are not available in other free fonts.

However, if a user wants to explore the features provided by these fonts, they are going to see a list of English text, instead of in their favorite local language, even though these feature descriptions have been translated for LO, and other fonts display localized feature descriptions.

Steps to reproduce:
1. Switch to a non-English UI language with font feature descriptions translated (I use simplified Chinese, zh-CN);
2. Open a dialog that shows the font features button, for example in Writer, the Format > Characters menu item, then select "Font" tab;
3. Choose "Linux Biolinum G" font, press "Features" button;
4. English feature descriptions are displayed (will attach screenshot);
5. Press "Cancel" to quit the features dialog, and choose a different font, say "Times New Roman", then press "Features" button again;
5. Now localized feature descriptions are displayed (will also attach screenshot).

This problem has been present for quite some time, I can now reproduce with 6.4.6 and 7.0.1, but likely reproducible with earlier versions as well.

Version: 7.0.1.2 (x64)
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 2; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); 界面: zh-CN
Calc: threaded
and
Version: 6.4.6.2 (x64)
Build ID: 0ce51a4fd21bff07a5c061082cc82c5ed232f115
CPU threads: 2; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; 
Locale: zh-CN (zh_CN); UI-Language: en-US
Calc: threaded
Comment 1 Ming Hua 2020-09-10 05:16:51 UTC
Created attachment 165344 [details]
Screenshot of font feature dialog for "Linux Biolinum G"

The font descriptions are displayed in English, even in Chinese UI
Comment 2 Ming Hua 2020-09-10 05:18:28 UTC
Created attachment 165345 [details]
Screenshot of font feature dialog for "Times New Roman"

The font feature descriptions for other fonts are properly displayed in Chinese
Comment 3 Mihkel Tõnnov 2020-09-10 06:19:22 UTC
Confirmed.
Comment 4 Tomaz Vajngerl 2020-09-10 06:48:11 UTC
The difference is that these fonts are Graphite fonts and fonts like "Times New Roman" are OpenType fonts.

OpenType fonts have a fixed set of font features, and the description (including translation) of these is left to the application. This is different with Graphite fonts as they can have arbitrary font features (some that are unique to the font) and the application itself doesn't need to know anything about them. The effect of this is that the font itself must provide descriptions and all the translations of font features for the font. 

So the issue is with the font and not with LibreOffice, unless the translations are available in the font, but we don't correctly show them.
Comment 5 Ming Hua 2020-09-10 07:20:23 UTC
(In reply to Tomaz Vajngerl from comment #4)
> OpenType fonts have a fixed set of font features, and the description
> (including translation) of these is left to the application. This is
> different with Graphite fonts as they can have arbitrary font features (some
> that are unique to the font) and the application itself doesn't need to know
> anything about them. The effect of this is that the font itself must provide
> descriptions and all the translations of font features for the font. 
The difference between Graphite fonts and OpenType fonts are real, however I'm not convinced there is no way to provide translations of these feature descriptions to LO users other than having translated descriptions in the font itself.

Take the first feature listed in attachment 165344 [details] for example.  The "c2sc" feature is also available in OpenType, with the same four-letter abbreviation:
https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#tag-c2sc
And even the longer description "Capitals to Small Capitals" is word-for-word identical to the current translatable strings used by LO (presumably for OpenType fonts with the same feature):
https://weblate.documentfoundation.org/translate/libo_ui-master/vclmessages/zh_Hans/?checksum=e3ee94f5c836b952

Therefore it should be possible to utilize the existing translations for Graphite fonts, just with some extra work of string manipulation.  The Graphite-specific features with no equivalent in OpenType can of course stay in English, at least for now.
Comment 6 Mihkel Tõnnov 2020-09-10 07:40:07 UTC
Wasn't aware that this is caused by those being Graphite fonts - thanks.

I don't think string manipulation on LibO side would be a good approach to this, because that kind of "software smarts" sooner or later break something for one language or another :) E.g. some languages utilize different punctuation / spacing around punctuation, or differ in capital vs. small first letter, or demand a specific case form or suchlike.

So if it's deemed unreasonable to enable translation of these exact strings for all the bundled (!) fonts on LibO side, then we the translators would have to try and get the translations into the fonts themselves. (I would prefer the 1st option, though.)
Comment 7 QA Administrators 2022-09-11 03:42:44 UTC Comment hidden (obsolete)
Comment 8 ⁨خالد حسني⁩ 2023-05-15 16:01:52 UTC
Unlike OpenType, Graphite does not have standardized feature registry and even if a feature tag happens to match an OpenType feature tag, there is no guarantee it does the same thing, so application provided feature names should not be used.

OpenType also have something similar, ssNN and cvNN features (stylistic sets and character variants) can supply their names in OpenType fonts and when present we will show then instead of the generic Stylistic Set N, and in this case it is also up to the font to provide appropriate localization.