[MPEG-OTSPEC] OpenType 'palt' and 'kern' Documentation Revision Proposal
Nat McCully
nmccully at adobe.com
Thu Feb 22 06:20:27 CET 2024
Great idea! I like it better especially since now apps can rely on the font entirely to determine what gets kerned in the proportional Japanese case and not worry that 'kern' will affect Japanese without 'palt', and they also don't have to try to detect which glyphs are full width in the font or whatever (in our case we exclude upright in vertical characters/glyphs as the proxy for full width).
―Nat
________________________________
From: Peter Constable <pconstable at microsoft.com>
Sent: Wednesday, February 21, 2024 6:54:01 PM
To: Nat McCully <nmccully at adobe.com>; Josh Hadley <johadley at adobe.com>; mpeg-otspec at lists.aau.at <mpeg-otspec at lists.aau.at>
Cc: kida at mac.com <kida at mac.com>
Subject: RE: OpenType 'palt' and 'kern' Documentation Revision Proposal
EXTERNAL: Use caution when clicking on links or opening attachments.
Thanks for the info.
I understand the need, which is reasonable. I just suspect this approach will not work out well.
It all hinges on special and complex logic for determining over what text spans ‘kern’ can be on by default. (To do it properly, I think you’d want to parse coverage tables of lookups linked to ‘palt’ and map those glyphs back to characters, including any paths through GSUB substitutions.) If some apps were to attempt something, implementations would likely be very buggy and inconsistent with one another, which would likely lead to font vendors getting complaints from their customers regarding some mix of apps that are outside their control.
Rather than suggest complex logic for default setting of ‘kern’, wouldn’t it be much simpler to define a new feature to activate kerning actions on glyphs to which ‘palt’ has also been applied? Here’s a possibility:
――――
Tag: 'apkn'
Friendly name: Kerning for alternate proportional widths.
Function: Applies kerning adjustments to glyphs that have monospace advance widths by default but have been adjusted to proportional widths by application of the ‘palt’ feature.
Example: A user activates proportional metrics (‘palt’) in Japanese text, which results in some glyphs that had monospace advance widths by default now having proportional widths. By activating this feature as well, those glyphs are then kerned with other glyphs. For instance, the glyph for U+FF08 “(” has full-width advance by default; the ‘palt’ feature adjusts the glyph to have a narrower, proportional width; this feature then shifs this glyph closer to U+3078 “へ” in the combination “(へ”.
Recommended implementation: The font kerns Kanji, Kana, Latin, punctuation, or other glyphs if those glyphs also are adjusted to proportional widths by lookups linked to the ‘palt’ feature.
Primarily intended for use in the GPOS table. Positioning adjustments can be implemented using GPOS pair-adjustment (type 2) lookups. Single- and pair-adjustment lookups have simple additive effect, therefore relative ordering of lookups for this feature and type 1 or type 2 lookups for ‘palt’ or other similar features is not crucial.
It is strongly recommended that glyphs that have monospace widths by default not be kerned with other glyphs using the ‘kern’ feature but should only be kerned by activation of this feature.
UI suggestion: This feature should be off by default, and activation should only be possible if the ‘palt’ feature has been activated. If ‘palt’ has been activated, then this feature may be automatically activated, but the UI should also provide a way to deactivate the feature when ‘palt’ is activated. The UI could implement logic for controlling both this feature and the ‘kern’ feature using a single control, but such logic should ensure that this feature is only activated if ‘palt’ is activated.
Script/language sensitivity: Intended primarily for CJK fonts but can be used in fonts for any script that have monospace advance widths by default.
Feature interaction: Should only be implemented in fonts that also implement the ‘palt’ feature, which this feature is intended to complement. This feature should only be activated if ‘palt’ has been activated, but is not required to be activated if ‘palt’ is activated.
――――
This way, the description and implementation for ‘kern’ are much simpler: there’s no need for complex logic to determine over which spans ‘kern’ should be activated by default; the app simply should always activate ‘kern’ by default for all text. Assuming the above recommendations for the new feature are followed in a font, having ‘kern’ on by default doesn’t result in undesired results.
And, since the recommendation for the new feature is that it be off by default, the worst-case scenario of an app not having any logic about dependency on ‘palt’ also doesn’t lead to undesired results by default. A user might be able to activate this feature when ‘palt’ isn’t activated, but they can then turn it off.
I would think there’s a better chance apps will expose this feature along with ‘palt’ than implement special, complex and bug-prone logic around default activation of ‘kern’.
Peter Constable
From: Nat McCully <nmccully at adobe.com>
Sent: Wednesday, February 21, 2024 6:29 PM
To: Peter Constable <pconstable at microsoft.com>; Josh Hadley <johadley at adobe.com>; mpeg-otspec at lists.aau.at
Cc: kida at mac.com
Subject: [EXTERNAL] Re: OpenType 'palt' and 'kern' Documentation Revision Proposal
You don't often get email from nmccully at adobe.com<mailto:nmccully at adobe.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Thanks for the comments.
Adobe apps do implement palt and kern together when you select “metrics” kerning (also called “auto”. Fonts that set kerning values on kana glyphs set the kern amount as a delta from the ‘palt’ widths, so it actually would be incorrect only to turn ‘kern’ without also turning on ‘palt’. However this is problematic as a default value for Japanese, so we defined a new “Roman only kerning” setting that is the default and only kerns non-CJK glyphs and leaves CJK monospaced.
Most applications set kerning on by default. If you do not do the above complex thing the Japanese fonts that have kerning values for kana glyphs will not kern enough, and will not be monospaced by default, which makes it difficult to get a quality or desired result out of the box.
―Nat
________________________________
From: mpeg-otspec <mpeg-otspec-bounces at lists.aau.at<mailto:mpeg-otspec-bounces at lists.aau.at>> on behalf of Peter Constable via mpeg-otspec <mpeg-otspec at lists.aau.at<mailto:mpeg-otspec at lists.aau.at>>
Sent: Wednesday, February 21, 2024 5:04:19 PM
To: Josh Hadley <johadley at adobe.com<mailto:johadley at adobe.com>>; mpeg-otspec at lists.aau.at<mailto:mpeg-otspec at lists.aau.at> <mpeg-otspec at lists.aau.at<mailto:mpeg-otspec at lists.aau.at>>
Cc: kida at mac.com<mailto:kida at mac.com> <kida at mac.com<mailto:kida at mac.com>>
Subject: Re: [MPEG-OTSPEC] OpenType 'palt' and 'kern' Documentation Revision Proposal
EXTERNAL: Use caution when clicking on links or opening attachments.
This was reported last fall as an issue on the OpenType spec:
'kern' and 'palt' UI suggestions and feature interaction descriptions are confusing for CJK ・ Issue #1069 ・ MicrosoftDocs/typography-issues (github.com)<https://github.com/MicrosoftDocs/typography-issues/issues/1069>
I’ve added comments in the discussion for that issue.
I’m leery about feature descriptions recommending complex feature-application behaviours that are unlikely to get implemented in applications. I have that concern in this case.
The ‘palt’ feature was defined by Adobe in early 1998. The earliest description (OpenType 1.1) didn’t mention interaction with ‘kern’. Here’s an excerpt:
―――――
Tag: "kern"
…
UI suggestion: This feature should be active by default. Applications may wish to allow users to add further manually-specified adjustments to suit specific needs and tastes.
Script/language sensitivity: None.
Feature interaction: May be used in addition to any other feature.
…
Tag: "palt"
…
UI suggestion: This feature would be off by default.
Script/language sensitivity: Used mostly in CJKV fonts.
Feature interaction: This feature overrides the results of all other width features.
―――――
In OpenType 1.2 (October 1998), the relationship to ‘kern’ was recognized (emphasis added):
―――――
Feature interaction: This feature overrides the results of all other glyph-width features. Applying this feature should also activate the kern feature.
―――――
Some of the early Adobe feature descriptions are worded in ways that might suggest a wrong expectation that features in a font can control activation of other features in the font. I don’t know if that’s what the author of that description was assuming at the time. It’s worth pointing out, however, that the desired outcome of the above recommendation doesn’t require activating any other feature when ‘palt’ is activated: the lookups that implement kerning actions could simply be referenced by the ‘palt’ feature table directly.
By OpenType 1.3 (2000?), more subtle interaction between ‘kern’ and ‘palt’ was called out, though it appears the idea was emerging subtle that interaction between ‘palt’ and ‘kern’ could be more subtle, though the feature descriptions weren’t consistent with each other:
―――――
Tag: 'kern'
…
UI suggestion: This feature should be active by default for horizontal text setting. Applications may wish to allow users to add further manually-specified adjustments to suit specific needs and tastes.
…
Feature interaction: If 'kern' is activated, 'palt' must also be activated if it exists. (If 'palt' is activated, there is no requirement that 'kern' must also be activated.) May be used in addition to any other feature except those which result in fixed (uniform) advance widths (e.g. fwid, halt, hwid, qwid and twid)
…
Tag: 'palt'
…
Feature interaction: This feature is mutually exclusive with all other glyph-width features (e.g. fwid, halt, hwid, pwid, qwid and twid), which should be turned off when it's applied. Applying this feature should activate the kern feature. See also vpal.
―――――
By OpenType 1.5 (May 2008) the ‘palt’ description was updated to match interaction described in the ‘kern’ description.
―――――
Tag: 'palt'
…
Feature interaction: This feature is mutually exclusive with all other glyph-width features (e.g. fwid, halt, hwid, qwid and twid), which should be turned off when it’s applied. If palt is activated, there is no requirement that kern must also be activated. If kern is activated, palt must also be activated if it exists. See also vpal.
―――――
Since 2008, these feature descriptions have not changed in these regards.
So, it’s over 25 years since Adobe first registered ‘palt’, and at least 15 years since they recommended applications implement more subtle interaction between ‘palt’ and ‘kern’.
Now it’s proposed that applications should implement behaviour that’s even more involved, detecting whether glyphs are proportional or monospace and requiring that 'kern' “[by] default shall not be activated on monospaced glyphs, but may be activate on any proportional-width glyphs”. I’m not even sure how an app is expected to distinguish monospaced glyphs from proportional glyphs.
But even without this proposed revision, there’s been an assumption for over 15 years that apps would have some interaction between application of ‘palt’ and of ‘kern’. Does any app today implement that?
If any app does, I expect Adobe, which proposed ‘palt’, would have done so at some point in the past 25 years. I don’t see a way in InDesign to control ‘palt’―here are the options I see in InDesign with the Yu Gothic font, which implements both ‘palt’ and ‘kern’ in GPOS under the default language system for ‘hani, ‘kana’, ‘latn’ and other scripts:
[A screenshot of a computer Description automatically generated]
PhotoShop appears to be exposing ‘palt’ in UI, but it’s set on with no way to toggle it off:
[A screenshot of a computer menu Description automatically generated]
In both apps, it’s not exactly clear to me how kerning UI interacts with the ‘kern’ feature. By default kerning is set to “Metrics”, which I’m guessing uses ‘kern’ (and I assume it’s deactivated by selecting the “0” option):
[A screenshot of a computer Description automatically generated]
If that’s the case, then the default is that both ‘palt’ and ‘kern’ are activated by default for both Latin and CJK runs, with no way to disable ‘palt’ (that I’ve found).
[cid:image005.png at 01DA64F5.64B99520]
Peter Constable
From: mpeg-otspec <mpeg-otspec-bounces at lists.aau.at<mailto:mpeg-otspec-bounces at lists.aau.at>> On Behalf Of Josh Hadley via mpeg-otspec
Sent: Wednesday, February 21, 2024 11:45 AM
To: mpeg-otspec at lists.aau.at<mailto:mpeg-otspec at lists.aau.at>
Cc: kida at mac.com<mailto:kida at mac.com>
Subject: [EXTERNAL] [MPEG-OTSPEC] OpenType 'palt' and 'kern' Documentation Revision Proposal
(I’m posting this on behalf of Nat McCully for discussion at the next AHG meeting; he’s unavailable right now but wanted to get it on the agenda)
Vlad & AHG members,
Please consider the proposal posted at https://github.com/jcitpc/CJKFont/blob/main/docs/palt_kern.md for addition to the next AHG meeting agenda.
Thanks,
Josh Hadley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20240222/1b940588/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 15072 bytes
Desc: image001.png
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20240222/1b940588/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 29343 bytes
Desc: image002.png
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20240222/1b940588/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 12376 bytes
Desc: image004.png
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20240222/1b940588/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 37365 bytes
Desc: image005.png
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20240222/1b940588/attachment-0007.png>
More information about the mpeg-otspec
mailing list