vurtun / nuklear

A single-header ANSI C gui library
13.69k stars 1.11k forks source link

OpenGL big font rendering cuts the edge #333

Open DeXP opened 7 years ago

DeXP commented 7 years ago

wordgame-big-font nk_font_atlas_add_from_file(atlas, "DejaVuSans.ttf", 60, 0); "P" letter is trimmed on the right; "o" from right and bottom etc. It's for all fonts, not just DejaVuSans. Extremely seen on Sans, not Serif fonts. Maybe antialiasing problem and/or texture size mismatch? Front end: X11, SDL, GLFW. OpenGL both 2 and 3.

vurtun commented 7 years ago

Interesting problem. This could have a number of different causes going from easy to absolutely god aweful. Possible sources could be drawing inside nk_draw_list_add_text and nk_draw_list_push_rect_uv. Then font baking and glyph packing inside nk_font_atlas in function nk_font_atlas_bake. The absolute worst case would be inside the font rasterizer.