jtsiomb / libdrawtext

Simple library for fast anti-aliased text rendering in OpenGL
GNU Lesser General Public License v3.0
86 stars 13 forks source link

multiple dtx_prepare_range calls is failing for me. #14

Closed veksha closed 3 years ago

veksha commented 3 years ago

Hello. When I compile unicode example (commented out cjk stuff) I get the following result: 1 Russian characters are drawing corrupted except for the last word.

But when make only one call to dtx_prepare_range like so: dtx_prepare_range(fntmain, FONT_SZ, 0, 0x500); /* cyrilic */ (from zero to 0x500) then russian characters are drawing as expected: 2

jtsiomb commented 3 years ago

Thanks for letting me know. This is clearly a regression. I'll look into it.

jtsiomb commented 3 years ago

Issue should be fixed by the latest commit (ae67ad9). It was a regression during a code re-organization between 0.4 and 0.5, a check in the function which changes glyphmaps was omitted, which previously was forcing a flush of any buffered text drawing if the new glyphmap is different. The omission resulted in any leftover buffered text being rendered using the incorrect new glyphmap.