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

Preserve font weight/italic styles when switching fonts #2

Open
2 of 3 tasks
passiomatic opened this issue Dec 26, 2020 · 0 comments
Open
2 of 3 tasks

Preserve font weight/italic styles when switching fonts #2

passiomatic opened this issue Dec 26, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@passiomatic
Copy link
Owner

passiomatic commented Dec 26, 2020

When switching fonts the weight of the new font should match, or be closer as possible, to the weight of the old one.

The typical use-case is the following:

  • User sets some text using Work Sans Heavy Italic
  • User later switches the font family to Helvetica
  • Font weight abruptly change to Regular, which is the first available weight for Helvetica. Instead Elm Designer should land to the closer weight Helvetica has, that is bold, and keep the italicized text.

We can probably reuse the font-weight CSS mapping where Hairline is 100 and Heavy is 900 to figure out the best match we have available in the new font.

  • Fix weight on changing current node font family
  • Fix italic too
  • Fix weight and italic styles on children of the changed node when their node is set to Inherit
@passiomatic passiomatic added bug Something isn't working good first issue Good for newcomers labels Dec 26, 2020
@passiomatic passiomatic self-assigned this Jan 28, 2021
@passiomatic passiomatic removed the good first issue Good for newcomers label Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant