imgui-js
imgui-js copied to clipboard
use AddFontFromFileTTF with io.Fonts.GetGlyphRangesChineseFull will crash
console Uncaught (in promise) abort(OOM). Build with -s ASSERTIONS=1 for more info.
I used a cropped droidsansfallback.ttf This file contains 2500 commonly used Chinese characters but
I cropped the font file again, and this time it worked when the file contained only 500 commonly used Chinese characters I think it was a memory burst while creating font data. What is the solution? You can clone my git repository :https://gitee.com/AIGAMESTUDIO.AILHC/imgui-js change example/main.js to check
TTF can be loaded, but you cannot use imgui.inputtext() for Chinese input and imgui.text () for Chinese display
try enabling ALLOW_MEMORY_GROWTH in the Makefile
https://github.com/flyover/imgui-js/blob/e7b86a2e57f1b8f48f9b4d66940be64f8b9f9fa1/Makefile#L53
you will need to rebuild the imgui binding
$ make clean-bind-imgui; make build-bind-imgui
thanks
I did as you suggested, and can load and display large Chinese TTF.But you still can't type Chinese into the imgui
Hmm, it doesn't look like there's any way to forward the characters selected from an IME into ImGui without using a text input or text area element. I suppose you could have one display atop the canvas when io.WantTextInput is true then forward the changes to io.AddInputCharactersUTF8.
Thank you, I know, this is webgame common problem, I can refer to other game engine or the realization of the third party libraries to do, such as canvasinput:https://github.com/goldfire/CanvasInput, but the demand is not very worried.Thank you very much for your help