-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-fonts] Improve implementation guidance for font-kerning #7958
Comments
In addition, the reporter in https://bugzilla.mozilla.org/show_bug.cgi?id=1797431 points out that for CJK text, kerning should not be used by default. The testcase at https://tama-san.com/otf_test/ indicates that current browsers (I tried Firefox, Safari and Chrome) all apply kerning by default (i.e. when The spec currently leaves the behavior of |
Apologies for asking some basic questions. The spec says
So for CJK, does Is it possible for the browser to kern CJK fonts when no such information is included in the font? (Is there a general case here where we need to be more careful about script-specific assumptions before using values like 'normal'?) |
You could say that, yes. (But remember that the initial value of
Well, that's always part of the picture -- yes, a feature like kerning depends on font support. If the font doesn't define any kerning, then the
In theory (for any font, not just CJK), but I'm not aware of any browser engine that does so. (I believe some desktop publishing software such as InDesign may do things like that.)
Maybe. Though I tend to think of things like |
Based on the bug report and the "default" output (the first line of text) shown in there after your patch, am I correct that the intention for
|
My mental model is that text is segmented into script runs, with "neutrals" adopting the script of their context. (Some hand-waving about behavior of neutrals at boundaries....) At the point where the font shaping engine performs kerning of a given piece of text, some decision must have been made regarding script, because it is an input to the shaping process. Then it's as simple as letting the So in your example, I'd expect the parentheses to be considered part of the Japanese text run, where no kerning is to be applied. |
This was once discussed in JLTF, and IIUC we consider this part of the OpenType spec is controversial, may have a negative impact for CJK. I think what we should do is to file an issue to OpenType. /cc @kidayasuo @r12a How about discussing this in JLTF again? |
I noticed #6723 is about the same topic? I'm sending both to JLTF soon. |
I'm a reporter on Bugzilla#1797431. Thank you for your cooperation.
Seems like it. This isssue seems a bit more specific.
If possible, I would like to know a way to catch up on what you discuss (or outline) at JLTF and what you report to Opentype. |
I'll get back to here with the results. This seems complicated.
Both sides are already shipping fonts based on their assumptions. |
I am a font engineer in font vendor. So I understand the difficulty in changing font files that have already been released. It certainly seems to me that we need Opentype's cooperation on the issues you present. One of the issues seems to be the ability to specify glyph groups to which the Opentype Feature is applied. If so, I think it would be acceptable to follow the current Opentype behavior as the default behavior. I look forward to the results of the discussion in the JLTF. |
It seems to me from reading the above that some font designers do apply kerning to their CJK fonts, and presumably there should be a way for the content author to enable that as a default if the font kerns by default. So turning off any kerning for CJK characters seems a bit draconian. As for where to apply kerning and where not, doesn't that fall out of which font is being used for a range of characters, rather than which characters are being used? If so, perhaps Sorry if i'm barking up the wrong tree. |
Instead of the 'not-normal' In this proposal, Perhaps "kern non-CJK only" should be modified for proportional-only CJK fonts. Let's continue the discussion in #6723. |
This proposal satisfies all my requirements. |
The CSS Fonts spec says that when kerning is enabled (i.e. with
font-kerning: normal
, or with the initialauto
value "at the discretion of the user agent"), the OpenType 'kern' (horizontal) or 'vkrn' (vertical) feature should be applied.In https://bugzilla.mozilla.org/show_bug.cgi?id=1797431, the reporter points out that the OpenType feature registry says that
Similarly, 'vpal' is supposed to be applied along with 'vkrn'.
Current browser engines appear to have overlooked this, and by default apply 'kern' but not 'palt' in the reporter's testcase.
I'd suggest it would be helpful to mention these associated features in the CSS Fonts description of how kerning is implemented when using OpenType fonts.
The text was updated successfully, but these errors were encountered: