mooman219 / fontdue

The fastest font renderer in the world, written in pure rust.
Apache License 2.0
1.44k stars 72 forks source link

segoe ui font displays linefeed character while calibri does not #156

Closed ericlangedijk closed 3 months ago

ericlangedijk commented 4 months ago

Drawing text with Layout I noticed that the linebreak is displayed in Segoe UI and not with (for example) Calibri. I can skip the display using CharacterInfo::is_control(). But I was wondering what is going on deep down and if there is a setting for this.

segoeui: image

calibri: image

mooman219 commented 3 months ago

What probably is happening is the font is providing a glyph for the control character and it just happens to be that box. Not all fonts provide one. Some people want control characters rendered, replaced, or skipped entirely, so fontdue provides CharacterInfo::is_control, as you saw, to let you decide and filter as needed. The intended use here is to skip control characters in your case.