Skip to content

font.covers: regex matching Unicode ranges regressed in v0.14.0 #7300

@tjensen42

Description

@tjensen42

Description

The covers: regex(...) functionality for font selection appears to have regressed in v0.14.0. A regex designed to match a specific Unicode range (e.g., [\u2780-\u2789] for Circled Sans-Serif Digits) no longer selects the specified font.

This exact code worked as expected in v0.13.1, correctly applying "Noto Sans" to the special character.

For other cases like a number matching ([0-9]) it works as expected.

Minimal Example

#set text(lang: "de", font: ((name: "Noto Sans", covers: regex("[\u2780-\u2789]")), "Georgia"))

Actual: Hello ➁

Desired: Hello #text(font: "Noto Sans")[➁]

➁ \u{2781}

Actual Behavior (v0.14.0)

The Actual: line renders the ➁ character using the font ("Georgia"), not "Noto Sans". The covers: regex(...) condition is seemingly ignored or fails to match.

Expected Behavior (v0.13.1)

The Actual: line should render the ➁ character using the "Noto Sans" font, as it matches the Unicode range in the regex. The output of the Actual: line should be identical to the output of the Desired: line.

Reproduction URL

https://typst.app/project/RbJrerbgRUJl8VZndalZyi

Operating system

No response

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    textRelated to the text category, which is all about text handling, shaping, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions