aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-12-08 13:12:29 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-12-08 13:12:29 +0000
commitf8bb5c742744db447ca062de6ffadb579920ab90 (patch)
tree6be9b7b15f950e89d92f01ac789d7b8d4ca5e6c1
parentccbe5845601a5a4d7c14f5744e9ea42a2e50be90 (diff)
Wrap `EncodeUtf8`
-rw-r--r--vendor/kb_text_shape/kb_text_shape_procs.odin11
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/kb_text_shape/kb_text_shape_procs.odin b/vendor/kb_text_shape/kb_text_shape_procs.odin
index a9cee184c..08dd4c300 100644
--- a/vendor/kb_text_shape/kb_text_shape_procs.odin
+++ b/vendor/kb_text_shape/kb_text_shape_procs.odin
@@ -312,13 +312,22 @@ foreign lib {
FontCoverageTestCodepoint :: proc(Test: ^font_coverage_test, Codepoint: rune) ---
FontCoverageTestEnd :: proc(Test: ^font_coverage_test) -> b32 ---
- EncodeUtf8 :: proc(Codepoint: rune) -> encode_utf8 ---
ScriptDirection :: proc(Script: script) -> direction ---
ScriptIsComplex :: proc(Script: script) -> b32 ---
ScriptTagToScript :: proc(Tag: script_tag) -> script ---
}
@(require_results)
+EncodeUtf8 :: proc "c" (Codepoint: rune) -> (Encoded: [4]u8, EncodedLength: c.int, Valid: b32) {
+ return expand_values(kbts_EncodeUtf8(Codepoint))
+}
+
+@(default_calling_convention="c", require_results)
+foreign lib {
+ kbts_EncodeUtf8 :: proc(Codepoint: rune) -> encode_utf8 ---
+}
+
+@(require_results)
DecodeUtf8 :: proc "c" (Utf8: string) -> decode {
@(default_calling_convention="c", require_results)
foreign lib {