Skip to content

Add warning when a glyph isn't found in any font #5137

Open

Description

@Andrew15-5

Description

https://typst.app/docs/reference/text/text/#parameters-fallback:

Note: Currently, there are no warnings when fallback is disabled and no glyphs are found. Instead, your text shows up in the form of "tofus": Small boxes that indicate the lack of an appropriate glyph. In the future, you will be able to instruct Typst to issue warnings so you know something is up.

I didn't find an open issue for this, so here is one.

One thing that should be discussed is what would be the default behavior and how to toggle/enable/disable the warning (in the CLI and/or via #4459).

Use Case

Improved UX. You can just simply miss the fact that some glyphs aren't found without a warning.

Activity

  1. added
    feature request
    on Oct 5, 2024
  2. Andrew15-5 commented on Oct 5, 2024

    @Andrew15-5
    ContributorAuthor

    I'm on the "warning by default" train. I think it can be disabled via CLI flag or a future global warning suppression.

    Also want to note that a hint can be added in case fallback: false or --ignore-system-fonts is used. Something like

    can't find a glyph <this>, try setting `text(fallback: true)`
    
    or
    
    can't find <n> glyphs, try removing the `--ignore-system-fonts` flag
    

    This is what I would expect in #5134, for example.

  3. istudyatuni commented on Oct 5, 2024

    @istudyatuni
    Contributor

    I think it makes sense when fallback: true, but not when it's false

  4. Andrew15-5 commented on Oct 5, 2024

    @Andrew15-5
    ContributorAuthor

    Hmm, I guess that's a good point. If a user explicitly disables fallback fonts, then they probably don't want to see the warnings. But maybe in some rare cases the warnings are still desired.

  5. istudyatuni commented on Oct 5, 2024

    @istudyatuni
    Contributor

    Maybe make it

    #warn missing-glyphs.when(text.fallback)
    

    by default with the ability to override (when the warning system will be implemented)

  6. added
    text
    diagnostics
    on Oct 6, 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

    diagnosticsfeature requesttext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions