custom glyph codepoint (remap) #5748

Closed
opened 2022-10-03 08:54:31 +00:00 by MungoBerry · 2 comments
MungoBerry commented 2022-10-03 08:54:31 +00:00 (Migrated from github.com)

Hi,

it is possible to set custom glyph codepoint for fonts ?
Suppose I've a symbol font and I want to remap e.g. codepoint U+4DC0 to 'a'.
Can be achieved ?
I know I can create my custom font atlas using ImFontGlyphRangesBuilder but I would to change codepoints too.

Thank you.

Hi, it is possible to set custom glyph codepoint for fonts ? Suppose I've a symbol font and I want to remap e.g. codepoint U+4DC0 to 'a'. Can be achieved ? I know I can create my custom font atlas using ImFontGlyphRangesBuilder but I would to change codepoints too. Thank you.
ocornut commented 2022-10-03 12:04:56 +00:00 (Migrated from github.com)

If you search for the word "remap" in imgui.h you'll find:

// Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true);
If you search for the word "remap" in imgui.h you'll find: ```cpp // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built. ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); ```
MungoBerry commented 2022-10-03 12:33:34 +00:00 (Migrated from github.com)

If you search for the word "remap" in imgui.h you'll find:

// Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true);

Thank you, I think should be added to FONTS.md doc

> If you search for the word "remap" in imgui.h you'll find: > > ```c++ > // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built. > ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); > ``` Thank you, I think should be added to FONTS.md doc
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#5748
No description provided.