MCPcopy Create free account
hub / github.com/comaps/comaps / GetScriptExtensions

Function GetScriptExtensions

libs/drape/harfbuzz_shaping.cpp:25–38  ·  view source on GitHub ↗

Writes the script and the script extensions of the Unicode codepoint. Returns the number of written scripts.

Source from the content-addressed store, hash-verified

23// Writes the script and the script extensions of the Unicode codepoint.
24// Returns the number of written scripts.
25size_t GetScriptExtensions(char32_t codepoint, TScriptsArray & scripts)
26{
27 // Fill scripts with the script extensions.
28 UErrorCode icu_error = U_ZERO_ERROR;
29 size_t const count = uscript_getScriptExtensions(static_cast<UChar32>(codepoint), scripts.data(),
30 static_cast<int32_t>(scripts.max_size()), &icu_error);
31 if (U_FAILURE(icu_error))
32 {
33 LOG(LWARNING, ("uscript_getScriptExtensions failed with error", icu_error));
34 return 0;
35 }
36
37 return count;
38}
39
40// Intersects the script extensions set of codepoint with scripts and returns the updated size of the scripts.
41// The output result will be a subset of the input result (thus resultSize can only be smaller).

Callers 2

ScriptSetIntersectFunction · 0.85
ScriptIntervalFunction · 0.85

Calls 2

dataMethod · 0.45
max_sizeMethod · 0.45

Tested by

no test coverage detected