Skip to content

Inconsistent font resolution: standalone vs fallback #4773

Open

Description

@memeplex

Description

#let fa(c, font) = text(str.from-unicode(c), font: font)

#fa(0xf113, ("Libertinus Sans", "Font Awesome 6 Free"))
#fa(0xf113, ("Libertinus Sans", "Font Awesome 6 Brands"))
#fa(0xf113, "Font Awesome 6 Free")
image

I wouldn't say this is a bug because that glyph is indeed defined in Brands and not in Free, but it's strange that when using Free as the only font it's nevertheless found.

Reproduction URL

No response

Operating system

macOS

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Aug 16, 2024
  2. added
    text
    on Aug 21, 2024
  3. laurmaedje commented on Oct 8, 2024

    @laurmaedje
    Member

    This invokes last resort fallback, which tries to find a font that is as close as possible to the primary font.

    In the first case, it tries to find a font as close as possible to Libertinus Sans which ends up with New CM math in the web app (crucially, it produces no tofu!). Not sure which font it picked for you. It kinda looks like a tofu, but that wouldn't make sense as then last resort fallback would not try to pick it. Would need the PDF to check.

    In the second case, it tries to find a font as close as possible to Font Awesome 6 Free. This increases the priority of Font Awesome 6 Brands because their name has a long shared prefix (this is taken into account.)

  4. removed
    bug
    on Oct 8, 2024
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

    text

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions