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

Parentheses are not aligned #713

Closed
Alexn117 opened this issue May 31, 2024 · 5 comments
Closed

Parentheses are not aligned #713

Alexn117 opened this issue May 31, 2024 · 5 comments

Comments

@Alexn117
Copy link

Describe the bug
When the text inside parentheses begins with a capital letter and ends with a lowercase letter, or vice versa, the parentheses become misaligned.

To Reproduce
Steps to reproduce the behavior:

  1. Visit https://rsms.me/inter/
  2. Delete the entire placeholder text for a line and type ()
  3. Now begin typing Test inside the empty parentheses. The parentheses will move up and down as you type.

Expected behavior
Parentheses should be aligned.

Screenshots
Screenshot 2024-05-30 at 7 41 02 PM copy

Screenshot 2024-05-30 at 7 41 53 PM copy

Screenshot 2024-05-30 at 7 41 21 PM copy

Screenshot 2024-05-30 at 7 42 36 PM copy

Environment

  • macOS 14.5
  • Google Chrome, Safari
  • Inter 4.0
@kenmcd
Copy link

kenmcd commented Jun 4, 2024

That is the calt Contextual alternates feature.
Go further down the page: https://rsms.me/inter/#features
And look at these two OpenType features

  • calt Contextual alternates
  • case Case alternates

calt is On by default and is affecting the parentheses based on being next to uppercase or lowercase characters.
You can turn calt Off and you will get only the lower parentheses.
Or you can turn case On and get only the higher parentheses.

Go to the Lab page and test.
https://rsms.me/inter/lab/?antialias=default&size=76
The case toggle is near the top right
The calt toggle is near the lower right

@Alexn117
Copy link
Author

Alexn117 commented Jun 4, 2024

That is the calt Contextual alternates feature. Go further down the page: https://rsms.me/inter/#features And look at these two OpenType features

  • calt Contextual alternates
  • case Case alternates

calt is On by default and is affecting the parentheses based on being next to uppercase or lowercase characters. You can turn calt Off and you will get only the lower parentheses. Or you can turn case On and get only the higher parentheses.

Go to the Lab page and test. https://rsms.me/inter/lab/?antialias=default&size=76 The case toggle is near the top right The calt toggle is near the lower right

Interesting, I didn't know this was a thing. How do I turn it Off in CSS? Also, is the norm to have it On by default?

@kenmcd
Copy link

kenmcd commented Jun 4, 2024

Also, is the norm to have it On by default?

Yes. OpenType standards are for certain features to be On by default - so calt is On by default.

How do I turn it Off in CSS?

From the link at the top of the Features page...
https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings

@Alexn117
Copy link
Author

Alexn117 commented Jun 5, 2024

Also, is the norm to have it On by default?

Yes. OpenType standards are for certain features to be On by default - so calt is On by default.

How do I turn it Off in CSS?

From the link at the top of the Features page... https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings

Great! I found the section near the very bottom: https://rsms.me/inter/#faq-using-features

From Mozilla: https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings#syntax

Whenever possible, Web authors should instead use the font-variant shorthand property or an associated longhand property . . .

It seems it is recommended to use the font-variant properties when possible, so I turned calt Off with this:

font-variant-ligatures: no-contextual;

@kenmcd
Copy link

kenmcd commented Jun 5, 2024

Great. Sounds like you are all set.
Please close this issue.

@Alexn117 Alexn117 closed this as completed Jun 6, 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

2 participants