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

Add Uniwidth variants #351

Closed
naiyerasif opened this issue Feb 17, 2021 · 10 comments
Closed

Add Uniwidth variants #351

naiyerasif opened this issue Feb 17, 2021 · 10 comments
Labels
Add Enhancement, Improvement, addition or new feature

Comments

@naiyerasif
Copy link

Since, Inter is widely used on the web, a uniwidth variant of the font will help avoid layout shifts when a state change is indicated by a change in weight.

Additional context
Consider a button with text displayed in regular weight. The weight is styled to shift to bold when a user hovers / focuses on the button. Currently, changing the weight changes the dimensions of the button. In case of uniwidth variant, this would not happen.

For more context, please refer to Lisa Staudinger's excellent piece on Uniwidth typefaces for interface design. The following GIF from the mentioned article showcases this request (with a comparison between IBM Plex Sans which is not a uniwidth font and Recursive which is).

Using a uniwidth typeface one can easily animate the weight of interactive text elements without affecting the surrounding layout.

@KrasnayaPloshchad
Copy link

This could be done by adding hwid feature

@rsms rsms added the Add Enhancement, Improvement, addition or new feature label Mar 23, 2021
@rsms
Copy link
Owner

rsms commented Mar 28, 2021

Thanks @KrasnayaPloshchad but I think @naiyerasif is asking for a monospace version of inter; where the width of all glyphs is the same. My understanding is that fwid is specifically for CJK fullwidth glyphs and wouldn't be appropriate nor probably solve the problem in this case.

Recursive is an example of a variable font with a custom MONO axis which accomplishes what is being asked for.

However, Inter Mono is currently not planned. It might never happen. There are simply so many good, freely-available monospace typefaces out there, many that works well with Inter.

Here are a few freely-available fonts you can try @naiyerasif with Inter: JetBrains Mono, Recursive, Roboto Mono, Hack, Inconsolata (I see you're already using Recursive :–)

@rsms rsms closed this as completed Mar 28, 2021
@rsms rsms marked this as a duplicate of #128 Mar 28, 2021
@naiyerasif
Copy link
Author

naiyerasif commented Mar 29, 2021

@rsms I am definitely not asking for monospace version 😺 . Once again I'll quote from Lisa's article linked above:

A monospaced font, also called non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space (e.g. an uppercase A is the same width as a lowercase w, or a -sign ). Monospaced fonts are traditionally used for typewriters, or nowadays for setting computer code.

Uniwidth typefaces, on the other hand, are proportionally-spaced typefaces, but every character occupies the same space across different cuts or weights. What this means in practice is that no matter which weight you set your text in, it will never change its length or cause text to reflow.

Uniwidth typefaces solve a very specific problem: text reflow / layout shifts when font-weight is used as a cue to indicate a change on an event (like focus or hover of a cursor). I have already embedded a gif above that illustrates this.

@rsms rsms reopened this Mar 31, 2021
@rsms
Copy link
Owner

rsms commented Mar 31, 2021

Got it! Thanks for the clarification.
It would be too much work to do this manually for a second family I think, but it may be possible to generate automatically from source. I'm thinking something like this:

for each glyph
  let L' & R' be the relative LSB & RSB for current bounding box
  let W be max(x)-min(x) of all masters for glyph
  adjust LSB & RSB while keeping the ratios L' & R', so that glyph's width is equal to W

This may be good enough. Thoughts?

@naiyerasif
Copy link
Author

naiyerasif commented Apr 4, 2021

@rsms Automating this would make sense.

I'm definitely not qualified enough to comment on how part. Maybe @KrasnayaPloshchad can remark on that?

@robworks-xyz
Copy link

I think you can simulate the uniwidth behaviour by adjusting the letter spacing. Not a scalable solution, but it might help in some cases. In this example, I added letter-spacing: 0.02em; to the smaller weight.

Screen Recording 2022-09-02 at 22 22 29

@rsms rsms marked this as not a duplicate of #128 Apr 8, 2023
@naiyerasif
Copy link
Author

It has been a while since I raised this request. I've found a new usecase for adding a GRAD axis: it allows me to adjust the contrast for a font to support light and dark modes. An example of this in action using Roboto Flex is here: https://youtu.be/8B7xOgp5Aow

@rsms
Copy link
Owner

rsms commented Nov 19, 2024

Shipped with version 4.0

@rsms rsms closed this as completed Nov 19, 2024
@KTibow
Copy link

KTibow commented Dec 21, 2024

How can I use uniwidth bold or grade? I can't find any reference to uniwidth options or grade in Inter.

@mrjbq7
Copy link

mrjbq7 commented Jan 31, 2025

Shipped with version 4.0

How do I use the uniwidth version? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add Enhancement, Improvement, addition or new feature
Projects
None yet
Development

No branches or pull requests

6 participants