Bug 159243 - Armenian characters displaying incorrectly (as boxes) on macOS (fonts not packaged properly)
Summary: Armenian characters displaying incorrectly (as boxes) on macOS (fonts not pac...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.2.0.1 rc
Hardware: All macOS (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0 target:24.2.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-17 14:21 UTC by Mike Saunders
Modified: 2024-01-23 11:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot showing the problem (145.63 KB, image/png)
2024-01-17 14:21 UTC, Mike Saunders
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Saunders 2024-01-17 14:21:12 UTC
Description:
LibreOffice 24.2 (since RC2) supports the Armenian language. Armenian has its own alphabet. On macOS (tested with 11.7) the Armenian characters in LibreOffice dialogs and widgets are not displayed properly - only boxes. Latin characters still appear, as per the screenshot.

Steps to Reproduce:
1. Install LibreOffice
2. Install macOS language pack
3. Switch to Armenian in the Preferences dialog

Actual Results:
Armenian characters appear as boxes.

Expected Results:
Normal characters.


Reproducible: Always


User Profile Reset: No

Additional Info:
-
Comment 1 Mike Saunders 2024-01-17 14:21:43 UTC
Created attachment 192019 [details]
Screenshot showing the problem

Adding screenshot showing the problem.
Comment 2 Christian Lohmaier 2024-01-17 18:10:49 UTC
confirming (not reproducible in instdir, but with packages)

Reason why it works from instdir, but not from installed package is a bug in the external/more_fonts makefiles. All the Noto variants share the "fonts_noto" package name, and hence it is more or less random which of the noto fonts gets packaged into the installation set. Whatever one is processed last will write their fontnames into workdir/Package/fonts_noto.filelist (and that file in turn is read by the installation set creation framework)

(so to reproduce in workdir, remove the instdir/LibreOffice.app/Contents/Resourcs/fonts/truetype/NotoSansArmenian*ttf files)

So bug is twofold, dealing with the first one here:
* LibreOffice not packaging all expected fonts
* LibreOffice not using a system provided font on macOS and instead showing "mojibake"/"tofu"/the squares.
Comment 3 Commit Notification 2024-01-17 21:35:23 UTC
Christian Lohmaier committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fcff7f72611d0b389b876d772038f095350ebdfd

tdf#159243 fix packaging of Noto fonts/fix Armenian UI on macOS

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2024-01-18 02:55:54 UTC
Christian Lohmaier committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/1b415b33651f6cbf57658a0d1ae822f1fa7f12ec

tdf#159243 fix packaging of Noto fonts/fix Armenian UI on macOS

It will be available in 24.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Adolfo Jayme Barrientos 2024-01-18 03:02:02 UTC
(In reply to Christian Lohmaier from comment #2)
> So bug is twofold [...]
> * LibreOffice not using a system provided font on macOS [...]

Yeah, that is bug 91400.
Comment 6 Commit Notification 2024-01-18 10:36:46 UTC
Christian Lohmaier committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-0":

https://git.libreoffice.org/core/commit/b5887fe96b87ad7130d4c34718a6fa5aaac98632

tdf#159243 fix packaging of Noto fonts/fix Armenian UI on macOS

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Christian Lohmaier 2024-01-18 21:50:20 UTC
(In reply to Adolfo Jayme Barrientos from comment #5)
> (In reply to Christian Lohmaier from comment #2)
> > So bug is twofold [...]
> > * LibreOffice not using a system provided font on macOS [...]
> 
> Yeah, that is bug 91400.

That's not the whole story - even when the San Francisco / the default UI fonts weren't usable, there's still a version of NotoSansArmenian available by default/provided by macOS that LO fails to use for the glyph fallback.

So the tofu/mojibake/squares shouldn't happen - poking around I also saw it is picked up by LO and put into its fontcache... So another question is why LO is happy with a shipped NotoSansArmenian, but not with the one provided by macOS...
Comment 8 Christian Lohmaier 2024-01-23 11:21:06 UTC
(In reply to Christian Lohmaier from comment #7)
> (In reply to Adolfo Jayme Barrientos from comment #5)
> > (In reply to Christian Lohmaier from comment #2)
> > > So bug is twofold [...]
> > > * LibreOffice not using a system provided font on macOS [...]
> > 
> > Yeah, that is bug 91400.
> 
> That's not the whole story - even when the San Francisco / the default UI
> fonts weren't usable, there's still a version of NotoSansArmenian available
> by default/provided by macOS that LO fails to use for the glyph fallback.

Sound out the reason for that - Noto Sans Armenian as shipped with macOS along with so called "Document-support fonts" - "These fonts are available only to documents that already use the font, or to apps that request the font by name. Some are older fonts that were included with earlier versions of macOS or Apple apps."

So when adding a snippet to LO to explicitly add the font to LO's internally cached list of fonts, then the fallback would succeed and the fallback would work for UI.
Noto Sans Armenian is also returned when using the corefont API to request a code covering certain glyphs (CTFontCreateForStringWithLanguage) - but that's not the method LO uses/it doesn't do that individually, but creates a list of fonts along with the codes they cover and then only consults that.

So one problem solved, nothing magic about it being used in UI, just a matter of how macOS has different levels of fonts - UI fonts exclusively to be used for the UI (the San Francisco family fonts), the Document-support fonts that are hidden and only used when explicitly requested and finally the globally available ones that show up in default fontlist (and even there it has downloadable/active/disabled toggles)