Summary: | Alternate substitution feature does not work when AAT tables are present in font | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Y. Kawara <sutetecoaca> |
Component: | LibreOffice | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | khaled, stephane.guillou |
Priority: | medium | ||
Version: | 24.2.2.2 release | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Attachments: |
Test font generated from Four.sfd, with "Mac" option turned on (affected by this bug).
Test font generated from Four_noAAT.sfd, with "Mac" option turned off (not affected by this bug). FontForge data for Four.ttf FontForge data for Four_noAAT.ttf TTX data for Four.ttf TTX data for Four_noAAT.ttf |
Description
Y. Kawara
2024-04-12 01:46:14 UTC
Created attachment 193636 [details]
Test font generated from Four.sfd, with "Mac" option turned on (affected by this bug).
Created attachment 193637 [details]
Test font generated from Four_noAAT.sfd, with "Mac" option turned off (not affected by this bug).
Created attachment 193638 [details]
FontForge data for Four.ttf
Created attachment 193639 [details]
FontForge data for Four_noAAT.ttf
Created attachment 193640 [details]
TTX data for Four.ttf
Created attachment 193641 [details]
TTX data for Four_noAAT.ttf
Two typos in my bug description: U+FE41(﹂) → U+FE42(﹂) Four_noAAT.ttf was generated from Four_noAAT.ttf ↓ Four_noAAT.ttf was generated from Four_noAAT.sfd Thanks for the detailed report. Khaled, I thought you might be able to grep this issue about 100 times quicker than me. What do you think? If the font has a morx table HarfBuzz will use it for glyph substitution and will not look at GSUB table at all, since the two tables are exclusive, you can use one or the other but not both at the same time (one belongs to Apple Advanced Typography shaping model, and the other to OpenType shaping model). So if the font has a morx table but the alternate substitution feature is in GSUB table then the alternate substitution feature will be considered missing and will not be applied since the GSUB table is not consulted at all. I suggest to not include AAT tables at all. Sorry, but it is a bug. The feature is available in the UI (shows there are 4 alternates) but does nothing. "So if the font has a morx table but the alternate substitution feature is in GSUB table then the alternate substitution feature will be considered missing and will not be applied since the GSUB table is not consulted at all." I think this is a good description of the bug, from where things can be worked on. It is not impossible to take a different approach. Again, it works fine in Inkscape. To the previous message I would like to stress that there is a good reason to both have ATT and GSUB tables, as not all features exist in both sets, as seen from the N/A features described there: https://fontforge.org/docs/techref/gposgsub.html#gposgsub-conversion In that sense, I think LibreOffice UI's (and Inkscape's) approach at reading tables and enabling features is correct. Sorry, I meant AAT and OpenType tables. Is this bug due to HarfBuzz? If that's the case I might look into it and see what I can do, sometime in June. Manual of HarfBuzz says "If a font has an AAT morx table, then it is used for substitutions; if not, but there is a GSUB table, then the GSUB table is used." According to FontForge's OT->AAT equivalence for substitution: Single -> Non-Contextual Glyph Multiple -> N/A N/A -> Glyph Insertion Alternate -> N/A Ligature -> Ligature N/A -> Contextual Glyph Chaining / Chaining Context -> N/A Reverse Chaining Context -> N/A N/A -> Indic Rearrangement That boils down to 9 unique types of substitutions, some only available in OT, some only in AAT, some in both OT and AAT. A preference for AAT becomes problematic if the right side of the list above has "N/A". In my test case, I use Alternate type, which is only available in OT. Removing AAT tables completely as suggested would make it impossible to use those substitution types that have N/A on the left side. |