MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / nk_utf_len

Function nk_utf_len

extern/glfw/deps/nuklear.h:7850–7872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7848 return len;
7849}
7850NK_API int
7851nk_utf_len(const char *str, int len)
7852{
7853 const char *text;
7854 int glyphs = 0;
7855 int text_len;
7856 int glyph_len;
7857 int src_len = 0;
7858 nk_rune unicode;
7859
7860 NK_ASSERT(str);
7861 if (!str || !len) return 0;
7862
7863 text = str;
7864 text_len = len;
7865 glyph_len = nk_utf_decode(text, &unicode, text_len);
7866 while (glyph_len && src_len < len) {
7867 glyphs++;
7868 src_len = src_len + glyph_len;
7869 glyph_len = nk_utf_decode(text + src_len, &unicode, text_len - src_len);
7870 }
7871 return glyphs;
7872}
7873NK_API const char*
7874nk_utf_at(const char *buffer, int length, int index,
7875 nk_rune *unicode, int *len)

Callers 7

nk_str_append_text_charFunction · 0.85
nk_str_insert_at_charFunction · 0.85
nk_str_remove_charsFunction · 0.85
nk_str_delete_charsFunction · 0.85
nk_textedit_pasteFunction · 0.85
nk_edit_stringFunction · 0.85
nk_do_propertyFunction · 0.85

Calls 1

nk_utf_decodeFunction · 0.85

Tested by

no test coverage detected