ambrosiogabe / MathAnimation

A simple C++/OpenGL application to create quick and dirty mathematically accurate animations
982 stars 49 forks source link

Add unicode support #100

Open ambrosiogabe opened 1 year ago

ambrosiogabe commented 1 year ago

There should be unicode support for text objects. You should be able to add unicode characters by either doing something like:

Here is some text with a checkmark \U2713
Here is some text with a checkmark \u2713
Here is some text with a checkmark ✓

So the unicode support should support escaped characters and inline characters typed into the textbox.

For ImGui support for unicode typed directly into the textbox, consider having it be locale based. So only unicode specific to a certain locale can be typed in directly, and all other unicode characters must be properly escaped. Maybe this is too restrictive, but at the start we can do this, and later we can add some sort of ImGui font cache that will automatically cache locale-specific characters in an LRU fashion.