Skip to content
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][css-text] Proposed Variable font spacing axis and CSS letter-spacing property #2102

Open
svgeesus opened this issue Dec 11, 2017 · 5 comments
Labels
css-fonts-4 Current Work css-text-4 i18n-alreq Arabic language enablement i18n-ilreq Indic language enablement i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.

Comments

@svgeesus
Copy link
Contributor

From John Hudson on www-style:

This is a proposal to register a standard OpenType design variations axis to affect glyph spacing:
https://github.com/Microsoft/OpenTypeDesignVariationAxisTags/blob/master/Proposals/Spacing_Axis/ProposalSummary.md

Implementations of this 'spac' axis in a variable font would enable font makers to provide superior results in letter-spacing conditions by providing proportional interaction between letter-spacing distance and kerning (via variable GPOS adjustments in the kerning values along the 'spac' axis), and by managing the design of joining letters in Arabic, Devanagari, etc. and in connecting styles of Latin or other scripts, which currently get broken connections when letter-spacing is applied.

I'm interested to hear ideas on how support for variable fonts with a 'spac' feature might be implemented in CSS. A couple of obvious options occur to me:

  1. User agents could apply 'spac' axis adjustments by default when the letter-spacing property is used to expand or contract spacing in text set in a variable font including this axis.
  1. The letter-spacing property could have a new value defined to allow authors to opt in to using 'spac' axis adjustments when applying letter-spacing.

Other possibilities or preferred approaches?

@svgeesus
Copy link
Contributor Author

@SergeyMalkin
Copy link

Just applying axis value to the font doesn't seem to be enough. I don't see what font can do on its own, beyond simply adding space between or around glyphs (with some adjustments to glyph outlines or kerning). It doesn't cover case when multiple adjacent runs are present, including runs of different scripts, fonts, direction, on line boundary. More complex protocol between UA and font may be needed here.

@litherum
Copy link
Contributor

If the proposal is for a font to implement letter-spacing itself, that’s not a great idea because browsers have lots of logic to answer the question of “what is a letter?” I’m pretty concerned about every font having to re-encode ICU breaking-iterator logic inside their GPOS tables.

A better solution would be for some way for a font to inform the browser with advice about how to place glyphs in the presence of letter-spacing, but the letter-spacing logic itself remains in the browser.

@litherum
Copy link
Contributor

litherum commented Mar 6, 2018

Any other thoughts? I see @SergeyMalkin and myself pushing against this; in the absence of anything else I'll close the issue.

@svgeesus
Copy link
Contributor Author

svgeesus commented Mar 6, 2018

Was just raising for awareness and possible discussion. I'm fine with closing. Maybe John Hudson has other opinions, but I suspect he was mainly musing how it would work with the rest of CSS.

@r12a r12a added i18n-ilreq Indic language enablement i18n-alreq Arabic language enablement i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. labels Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-fonts-4 Current Work css-text-4 i18n-alreq Arabic language enablement i18n-ilreq Indic language enablement i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.
Projects
None yet
Development

No branches or pull requests

4 participants