Skip to content

How TTF is rendered? #16969

Discussion options

You must be logged in to vote

Do you actually parse TTF file using OpenType spec or do you use external library for parsing?

We use https://github.com/pop-os/cosmic-text, which uses https://github.com/harfbuzz/ttf-parser.

Do you use bitmap atlas font to actually draw glyphs on the screen and if yes how do you even make it not blurry when letters are scaled too large or too small?

Yes, glyphs are rasterized into an atlas. The resolution of the rasters is based on the font_size you specify. It's sort of up to you to use an appropriate value for font_size based on your projection / scale.

If font smoothing is disabled, the glyph atlases will use nearest neighbor sampling. (This also applies a 50% opacity threshold to…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dmitrykolesnikovich
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