Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Allow font-size-adjust to be used in @font-face block #51

Open
floratmin opened this issue Mar 17, 2021 · 5 comments
Open

Allow font-size-adjust to be used in @font-face block #51

floratmin opened this issue Mar 17, 2021 · 5 comments

Comments

@floratmin
Copy link

When mixing fonts of different scripts into one font family with the @font-face declaration, sometimes the sizes of the fonts do not match. When mixing these scripts in one paragraph, we have to use spans to adjust the size of one of the fonts. But if we could define the font-size-adjust property directly in the @font-face declaration, then there would be no need to mark parts of different scripts (or even fonts) in paragraphs.

@tiroj
Copy link

tiroj commented Mar 17, 2021

This should probably be cross-posted as a CSS working group issue.

A related issue: the font-size-adjust property, as currently defined, is very Latin-centric, e.g. ‘All fonts have an "aspect value" which is the size-difference between the lowercase letter "x" and the uppercase letter "X".’ It works reasonably well for European scripts that have similar proportions to Latin, but is effectively meaningless for most of the world’s writing systems.

@floratmin
Copy link
Author

OK I updated the font-size-adjust property to be independent of the x-height to capital-height ratio and posted it to the CSS working group.

@frivoal
Copy link
Collaborator

frivoal commented Mar 18, 2021

The CSSWG has just resolved to do this in w3c/csswg-drafts#6075

@PeterConstable
Copy link

I'm reminded of a detail that went into the design of a Windows API added in Windows 8: the LanguageFontGroup class was added to provide font recommendations for different scripts or languages. One of the usage scenarios for the API was to support multilingual content in a single app UI; for example, the Windows 8 Start menu, with app tiles that each could show notifications that might be in different languages. So, the fonts for different languages should be aesthetically compatible and coherent. One particular problem was that the different system fonts might have been designed with different metrics, and if set at the same size would not look well matched—some of the text might look too bit or too small relative to other text in the same UI. And so the LanguageFont objects returned for a given script or language includes a ScaleFactor member that could be used to adjust relative size of the different fonts.

@fantasai
Copy link
Collaborator

fantasai commented Apr 6, 2021

@tiroj That's already filed as w3c/csswg-drafts#4540 :) We've got two solutions: w3c/csswg-drafts#6075 which introduces a scaling factor per @font-face block and w3c/csswg-drafts#6160 which extends the font-size-adjust property to work with metrics other than ex-height.

Which does leave the issue of Most Writing Systems Don't Have OpenType Metrics, which was filed as MicrosoftDocs/typography-issues#240 and https://lists.w3.org/Archives/Public/www-archive/2020Feb/att-0005/CSS-SC29-20200113.pdf and w3c/csswg-drafts#5244

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants