d-gamedev-team/dimgui — pull request #2 by kiith-sa (2014-07-05 16:37:41+00:00)
Title: Unicode support

I added (limited) Unicode support (need to support diacritics in my project).

Changes:
- API:
* `string` passed instead of `const(char)[]` for strings that will be rendered in the GUI
* `imguiInit()` has an optional `fontTextureSize` parameter. Users of less common Unicode characters,
especially CJK, may need to tweak these. (that said, imgui doesn't really support CJK anyway)
- Internals:
* Font texture is 1024*1024 (1MiB) by default instead of 512*512 (256kiB)
* The g_cdata array in gl3_renderer.d (always) takes up 1.25 MiB.
* Dimgui draws all glyphs (present in the font) it can fit until it runs out of glyphs or font texture space.
This is somewhat hacky as the user may need to increase texture size to draw some Unicode characters,
but... no less hacky than the rest of imgui and specifying character count in the API would require less
trivial error handling or slower/more complicated init (it can be done if needed, though; it just doesn't
seem to be in the spirit of the library)

The default font texture size is overkill to ensure there are no problems for ASCII, various latin
characters with diacritics and Cyrillic, but e.g. CJK users would need to increase it.
* For glyphs that are not present in the font, only one null glyph is drawn on the texture instead of
drawing it all over the place separately for each glyph.