Skip to content

Text edge "bounds" not working for fonts without outlines #8074

Open

Description

@laurmaedje

Description

When selecting tight vertical bounds for a font that does not contain outlines (some color fonts), the vertical bounding box is tight at the baseline.

#set text(font: "Noto Color Emoji")
#set text(top-edge: "bounds", bottom-edge: "bounds")
#box(stroke: 1pt, "😇")
Image

Operating system

No response

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    text
    on Apr 7, 2026
  2. Lege19 commented on Jun 3, 2026

    @Lege19
    Contributor

    Typst currently uses ttf_parser::Face::glyph_bounding_box for this which only handles outline glyphs, not svg or raster glyphs.
    It looks like raster glyphs have enough metadata to find the bounding box without parsing the image data.
    SVG glyphs look like a nightmare though: need to get from a SvgDocument (which can contain multiple glyphs which can appear anywhere in the document tree) to a bounding box of a particular glyph.

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

    bugtext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions