Changed renderer to make tab and newline glyphs invisible

Fixes #16
This commit is contained in:
rxi 2020-02-05 20:16:09 +00:00
parent 33ad329f24
commit 613f9c2ba6
1 changed files with 5 additions and 0 deletions

View File

@ -173,6 +173,11 @@ RenFont* ren_load_font(const char *filename, float size) {
float scale = stbtt_ScaleForMappingEmToPixels(&font->stbfont, size);
font->height = (ascent - descent + linegap) * scale + 0.5;
/* make tab and newline glyphs invisible */
stbtt_bakedchar *g = get_glyphset(font, '\n')->glyphs;
g['\t'].x1 = g['\t'].x0;
g['\n'].x1 = g['\n'].x0;
return font;
fail: