textSize

textSize (text -- size)

Inputs

Outputs

textSize counts UTF-8 bytes, not Unicode code points or displayed characters. Decoded-character splitting is provided by textSplit.

For known non-NIL Text, the result is a known Natx. For unknown Text, the result is still Natx, but its exact numeric value is unknown at compile time. Known NIL Text is invalid.

Example

{} () {} [
  "你好" textSize printStack _:;
  text: 0 ("") dynamic @;
  @text textSize printStack _:;
] "main" exportFunction

Expected Output During Compilation

6nx
Natx

See also