typst icon indicating copy to clipboard operation
typst copied to clipboard

Artefacts in assembled stretched glyphs

Open EpicEricEE opened this issue 1 year ago • 4 comments

Description

When assembled glyphs are built (via stretch, lr, underbrace or similar), the rendered PNG contains small artefacts where the glyph parts connect. This is especially visible in low resolutions, e.g. in the example for the underbracket docs.

300ppi 1000ppi (only small bumps visible)
image image

At some zoom levels, this is also be visible in PDF and SVG, probably depending on the viewer (e.g. in VSCode using "vscode-pdf" and "Svg Preview").

Reproduction URL

No response

Operating system

Web app, Windows

Typst version

  • [X] I am using the latest version of Typst

EpicEricEE avatar Oct 18 '24 14:10 EpicEricEE

The slight overlap is intended by the OpenType MATH spec.

laurmaedje avatar Oct 18 '24 14:10 laurmaedje

The only real way to solve this would be to merge the parts of the glyph in order to remove the overlap.

We'll see a lot more of this once typst gets variable font support.

Enivex avatar Oct 18 '24 14:10 Enivex

The slight overlap is intended by the OpenType MATH spec.

The overlap is intended, but it's not taken into account when anti-aliasing (it's done on each part individually), which can cause ugly results.

Enivex avatar Oct 18 '24 14:10 Enivex

Closely related issue

https://github.com/typst/typst/issues/4624

Enivex avatar Oct 18 '24 14:10 Enivex