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

Unwanted "smart" replacement of the letter x with a multiplication sign #222

Closed
captainmeta4 opened this issue Dec 17, 2019 · 3 comments
Closed

Comments

@captainmeta4
Copy link

@captainmeta4 captainmeta4 commented Dec 17, 2019

Describe the bug
Typing a lowercase x between two numbers causes the letter x to be "smart" replaced with a multiplication sign.

To Reproduce
Steps to reproduce the behavior:

  1. Type a numerical character
  2. type an x
  3. type another numerical character

Expected behavior
The letter x should remain as an x. The font should not trying to assume the user's intention and replacing characters with glyphs that belong to other characters. By doing this, the Inter font fails to accurately render string data.

Screenshots
A user signed up to our web site with the username "x0x7_". It was displayed like this (our usernames are prefixed with the "@" character, similar to twitter)

Removing Inter font from our site fixed this problem, and allowed the user's name to be correctly displayed.

Environment

  • OSX, iOS
@Euguar
Copy link

@Euguar Euguar commented Dec 18, 2019

Hi, @captainmeta4!

I guess it’s not a bug. You may to use CSS font-feature-settings property to disable liga option for element.
E.g.: p { font-feature-settings: "liga" 0; } — that’s line in CSS will allow you to disable transform from x (symbol) to × (multiply sign).

Good luck!

@be5invis
Copy link

@be5invis be5invis commented Jan 5, 2020

Should we use liga for "smart placements"? I think it should be calt, or even case.

@rsms
Copy link
Owner

@rsms rsms commented Jan 14, 2020

It should be part of calt as @be5invis points out and not liga, but it is. My bad.

# x surrounded by numbers, e.g. 3x4 -> 3×4
sub @Numeral x' @Numeral by multiply; # 3x9
sub @Numeral @Whitespace x' @Numeral by multiply; # 3 x9
sub @Numeral @Whitespace @Whitespace x' @Numeral by multiply; # 3 x9
sub @Numeral x' @Whitespace @Numeral by multiply; # 3x 9
sub @Numeral @Whitespace x' @Whitespace @Numeral by multiply; # 3 x 9
sub @Numeral @Whitespace @Whitespace x' @Whitespace @Numeral by multiply; # 3 x 9
sub @Numeral x' @Whitespace @Whitespace @Numeral by multiply; # 3x 9
sub @Numeral @Whitespace x' @Whitespace @Whitespace @Numeral by multiply; # 3 x 9
sub @Numeral @Whitespace @Whitespace x' @Whitespace @Whitespace @Numeral by multiply; # 3 x 9

I’ll move it to calt for the next release. Once that’s out, you can disable calt like this:

body {
  font-variant-ligatures: no-contextual;
}

Should work in a modern web browser. (https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures) You can use font-feature-settings too, but keep in mind that it resets all font features so you have to explicitly include all features you still want to keep enabled, like for instance liga or any cvXX or ssXX you may use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants