MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ImTextInitClassifiers

Function ImTextInitClassifiers

3rdparty/imgui/src/imgui_draw.cpp:5506–5521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5504static ImU32 g_CharClassifierIsSeparator_3000_300f[ 16 / 16] = {};
5505
5506void ImTextInitClassifiers()
5507{
5508 if (ImTextClassifierGet(g_CharClassifierIsSeparator_0000_007f, ',') != 0)
5509 return;
5510
5511 // List of hardcoded separators: .,;!?'"
5512 // Making this dynamic given known ranges is trivial BUT requires us to standardize where you pass them as parameters. (#3002, #8503)
5513 ImTextClassifierClear(g_CharClassifierIsSeparator_0000_007f, 0, 128, ImWcharClass_Other);
5514 ImTextClassifierSetCharClassFromStr(g_CharClassifierIsSeparator_0000_007f, 0, 128, ImWcharClass_Blank, " \t");
5515 ImTextClassifierSetCharClassFromStr(g_CharClassifierIsSeparator_0000_007f, 0, 128, ImWcharClass_Punct, ".,;!?\"");
5516
5517 ImTextClassifierClear(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Other);
5518 ImTextClassifierSetCharClass(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Blank, 0x3000);
5519 ImTextClassifierSetCharClass(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Punct, 0x3001);
5520 ImTextClassifierSetCharClass(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Punct, 0x3002);
5521}
5522
5523// Simple word-wrapping for English, not full-featured. Please submit failing cases!
5524// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.

Callers 1

ImFontAtlasBuildInitFunction · 0.85

Tested by

no test coverage detected