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

Small caps broken in v4.0 #630

Closed
saintasia opened this issue Nov 20, 2023 · 4 comments
Closed

Small caps broken in v4.0 #630

saintasia opened this issue Nov 20, 2023 · 4 comments

Comments

@saintasia
Copy link

Describe the bug
font-variant-caps: all-small-caps broken on v4.0

To Reproduce
Steps to reproduce the behavior:

  1. use css property font-variant-caps with the value all-small-caps
  2. behold it only working on select few characters

Expected behavior
All characters being capitalised and then scaled down to the intended small-caps size

Screenshots

v3 v4
Screenshot 2023-11-20 at 1 50 10 pm Screenshot 2023-11-20 at 1 50 40 pm
Screenshot 2023-11-20 at 1 54 20 pm Screenshot 2023-11-20 at 1 52 50 pm

Environment

  • OS (any)
  • Chrome, Firefox, Safari
  • Version of font 4.0
@jhpratt
Copy link

jhpratt commented Nov 24, 2023

A quick search shows that small-caps isn't technically supported (see #32), even if it did work quite well in the previous version. I don't know the technical cause behind the regression, but a big 👍 for it being (semi-)supported. In the meantime, I'm continuing to use v3.19 in places where small-caps may be used.

@rben01
Copy link

rben01 commented Nov 26, 2023

On https://rsms.me/inter/lab/?feat-c2sc=1, it is indicated that the small caps feature in v4.0 (c2sc) is incomplete, so at least this is already a known issue.

@Apreche
Copy link

Apreche commented Dec 11, 2023

opentype feature c2sc means that capital letters will be replaced with small caps glyphs.
The feature smcp means that lowercase letters will be replaced with small caps glyphs.
The css property font-variant-caps: all-small-caps enables both of these opentype features so that every character will be a small cap, regardless of whether the original is upper or lowercase.

If a font does not support these features, the browsers will take the uppercase glyphs and automatically scale them to create fake small caps. That appears to be what is happening in v3. This is undesirable mostly because the strokes are too light. If you look at it next to a font with proper small caps, you can see it's not great. That's why it's nice to have a font with proper small caps.

What appears to have happened in v4 is they have started working on #32 and implemented some of the small caps properly, but not all of them. I think what is happening is that the browsers see that at least some small caps are implemented in the font, so they disable their fake small caps autoscaling function. That explains the mixed bag of upper and lowercase.

I'm very happy that proper small caps are being worked on. However, if my evaluation of this issue is correct, they should not be included in a release until all of them are done. Including just a few creates this broken functionality that's even worse than the fake auto-scaled small caps.

@rsms
Copy link
Owner

rsms commented Mar 23, 2024

Inter does not support Small Caps (as of v4.0.) Hopefully proper support will be added in a future version. For now, what we can do it to remove the s2sc and smcp OpenType features. As @Apreche points out, web browsers will then manufacture small caps by approximation (AKA "faux" small caps) which will look quite bad but better than a mix of proper small caps and faux ones.

@rsms rsms closed this as completed in 883a326 Mar 23, 2024
rsms added a commit that referenced this issue Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants