Skip to content

Experiment with a non-centenary font weight #65

@gnprice

Description

@gnprice

Flutter supports specifying what font weight to use for text.

The main API for this, FontWeight, provides the weights 100, 200, etc., up to 900. (For example FontWeight.normal is an alias for weight 400, and FontWeight.bold is 700.)

That's plenty for many purposes, but one sometimes wants finer control with a weight like 450 or 550. In particular @terpimost would like to have the design flexibility to use such weights. Some discussion in chat.

It looks like we should be able to accomplish that using TextStyle.fontVariations. That allows specifying an arbitrary weight, as a number, by using design axis wght.

  • In fact one can even use that to drive the weight with an animation, if you want; example here.
  • The docs suggest this feature is there for the sake of variable fonts. Probably it works fine even if the font isn’t variable, though, as long as you pick a weight the font does have.

So it would be good to try that out and demonstrate that it does indeed work.

In order to successfully carry out the experiment, we'll need a font that has such a weight in the first place. This probably means we'll need:

and specifically to bundle a variable font, like Source Sans 3 VF as seen in the web PR zulip/zulip#24833.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-contentParsing and rendering Zulip HTML content, notably message contentsa-designVisual and UX design

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions