Skip to content

How do I correctly handle newlines? #86

Answered by wezm
mainrs asked this question in Q&A
Discussion options

You must be logged in to vote

The newline character \n is shaped as well. I would have expected that it does not get processed separately as a GlyphInfo but gets included by advancing vertically after the , character. Is that not the case?

Yes that is not the case. Line layout is a process separate from shaping. It needs to consider word-wrapping, hyphenation, etc. In a traditional open-source text rendering stack Fontconfig does font matching, Harfbuzz does the shaping, Pango does layout, freetype does rasterisation. Allsorts takes the place of Harfbuzz in this flow, so you still need something to do layout.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mainrs
Comment options

@wezm
Comment options

Answer selected by mainrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants