Skip to content

Discrepancy between emoji sizing between PDF and PNG/SVG #8072

Closed

Description

@JonPichel

Description

When using typst compile --format svg, the emojis are misaligned. I've tried both Twemoji and Noto Color Emoji fonts.

#set text(font: "Twemoji")
#box(stroke: 1pt + red, "😇")

#set text(font: "Noto Color Emoji")
#box(stroke: 1pt + red, "😇")
Image

I copied the snippet from #5242, which was similar but attributed only to Noto Color Emoji.

When compiling to PDF they show correctly centered.

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Apr 6, 2026
  2. added
    layout
    svg
    on Apr 6, 2026
  3. laurmaedje commented on Apr 7, 2026

    @laurmaedje
    Member

    It isn't really expected that it's centered because the box edges are determined by font-global metrics, not individual glyphs. To get a tight centering, you could in principle use #set text(top-edge: "bounds", bottom-edge: "bounds"), but it appears that this totally breaks down with Noto Color Emoji. I'll open a separate issue about that.

    That said, there is some discrepancy between PDF and PNG/SVG. It almost looks like the Emoji is a little stretched in PDF export.

    SVG PNG PDF
    Image Image Image

    (Ignore the different positions of the boxes, that's just me being bad at taking a consistent screenshot)

  4. changed the title [-]Emojis are not centered when exporting to SVG[/-] [+]Discrepancy between emoji sizing between PDF and PNG/SVG[/+] on Apr 7, 2026
  5. added
    pdf
    needs-investigation
    text
    and removed
    layout
    svg
    on Apr 7, 2026
  6. saecki commented on Jul 7, 2026

    @saecki
    Member

    I believe this has been fixed with #8440

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

    bugneeds-investigationpdftext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions