View Single Post
Old February 1, 2019, 20:24   #68
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Originally Posted by Bandobras View Post
I've looked closer and it seems, compared to bitmap font, for WOFF you are adding 2 pixels extra between glyphs adjacent horizontally and 3 between lines.
Ah, right! Forgot about it. You have sharp eye, Bandobras

Edit: Wow, you are actually doing that with bitmap fonts as well, which means even with a square font distances are not true on the map. I'm surprised, because bitmap fonts (or only the old-school ones?) are designed pixel-perfect, for display without any extra borders. You probably do that due to the cursor
It's actually because of vector fonts (.ttf, .otf and stuff). Those are not pixel perfect (even if monospace) - the sizes of glyphs can differ by a pixel (e.g, "t" is 8 pixels wide, while "m" is 9 pixels). So I just add a one pixel border to what freetype reports is the font size. Otherwise, erasing glyphs can leave some stray pixels.
Bitmap fonts are indeed pixel perfect... they're also not really resizable, which is why Angband ships with tons of them. I don't like Angband's default fonts, so I didn't even consider adjusting their size back... I guess I should do that.
t4nk is offline   Reply With Quote