Skip to content

Embedded TrueType variable fonts lose weights on import #850

Closed

Description

@tikurahul

What happened

Bento lets users pick fonts using the Embed Font file feature. This makes the font an embedded font asset, and when used gets injected, into the shell.

When you pick True type font with variable width fonts, the model ends up losing font weight ranges that the font supports.

For e.g. if you pick Google Sans 1 - the embedded WOFF supports a weight range of 100 900, but we default to normal which gets mapped to 400. Additionally, when you use Bold you get the browser faux bold version, and its hard to tell the difference unless have a keen eye.

Workaround

The workaround is that the underlying Bento model allows you to specify exactly what range of weights is supported, so you can always override the defaults, by changing the JSON to something like:

"fonts": [
  {
    "family": "Google Sans",
    "asset": "font_google-sans",
    "weight": "100 900",
    "style": "normal"
  },
  {
    "family": "Google Sans Code",
    "asset": "font_google-sans-code",
    "weight": "100 900",
    "style": "normal"
  }
]

What should we do?

If we cannot determine what weights are supported out of the box, we might want to warn the user to make sure they check. This is a really easy thing to miss.

Alternatively, if we can introspct the asset, and determine that it supports a weight range, just use that instead.

Steps to reproduce

  1. Create a new Presentation
  2. Embed a font resource that supports True Type variable fonts
  3. The model loses the supported weights.

Environment

  • App version: main
  • Browser + version: Chrome 156.0.8078.47
  • OS: macOS

Notes
No warnings.

Activity

  1. nyblnet commented on Oct 24, 2026

    @nyblnet
    Owner

    Thanks @tikurahul, this was a really clear report, and the workaround in it pointed straight at the fix.

    #851 makes "Embed font file…" read the weights from the font file itself. A variable font gets its full range, for example 100 900, so Bold uses the font's real bold instead of a synthesized one. A static font gets its own weight, and italic where the file says so. WOFF2 is covered too.

    If you've already embedded Google Sans, embed it again once this lands and the weights will be picked up. No JSON editing needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions