MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ImTextInitClassifiers

Function ImTextInitClassifiers

imgui_tiny_app/imgui/imgui_draw.cpp:5475–5490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5473static ImU32 g_CharClassifierIsSeparator_3000_300f[ 16 / 16] = {};
5474
5475void ImTextInitClassifiers()
5476{
5477 if (ImTextClassifierGet(g_CharClassifierIsSeparator_0000_007f, ',') != 0)
5478 return;
5479
5480 // List of hardcoded separators: .,;!?'"
5481 // Making this dynamic given known ranges is trivial BUT requires us to standardize where you pass them as parameters. (#3002, #8503)
5482 ImTextClassifierClear(g_CharClassifierIsSeparator_0000_007f, 0, 128, ImWcharClass_Other);
5483 ImTextClassifierSetCharClassFromStr(g_CharClassifierIsSeparator_0000_007f, 0, 128, ImWcharClass_Blank, " \t");
5484 ImTextClassifierSetCharClassFromStr(g_CharClassifierIsSeparator_0000_007f, 0, 128, ImWcharClass_Punct, ".,;!?\"");
5485
5486 ImTextClassifierClear(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Other);
5487 ImTextClassifierSetCharClass(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Blank, 0x3000);
5488 ImTextClassifierSetCharClass(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Punct, 0x3001);
5489 ImTextClassifierSetCharClass(g_CharClassifierIsSeparator_3000_300f, 0x3000, 0x300F, ImWcharClass_Punct, 0x3002);
5490}
5491
5492// Simple word-wrapping for English, not full-featured. Please submit failing cases!
5493// 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