Measure text with the current font, optional wrapping, and optional hidden ID suffixes.
textUTF-8 text. With omitted/null text_end, strings are encoded; NUL-terminated nonempty byte views are used directly, other views are copied and NUL-terminated. With an explicit end, pass a Uint8Array: its bytes are read directly and need no NUL terminator.
text_endOptionalExclusive endpoint view, not a length or another string. Explicit begin/end must share one backing buffer and satisfy begin.byteOffset <= end.byteOffset <= begin.byteOffset + begin.byteLength. An empty end view is valid; neither view needs NUL termination. Omitted/null end uses ordinary NUL-terminated UTF-8 conversion.
hide_text_after_double_hashOptionalWhether text after ## is excluded from size measurement.
wrap_widthOptionalMaximum text width in pixels before wrapping; nonpositive values disable wrapping.
Measured text extent: copied pixel dimensions {x: width, y: height}.
Measure text with the current font, optional wrapping, and optional hidden ID suffixes.
textUTF-8 text. With omitted/null text_end, strings are encoded; NUL-terminated nonempty byte views are used directly, other views are copied and NUL-terminated. With an explicit end, pass a Uint8Array: its bytes are read directly and need no NUL terminator.
text_endExclusive endpoint view, not a length or another string. Explicit begin/end must share one backing buffer and satisfy begin.byteOffset <= end.byteOffset <= begin.byteOffset + begin.byteLength. An empty end view is valid; neither view needs NUL termination. Omitted/null end uses ordinary NUL-terminated UTF-8 conversion.
hide_text_after_double_hashOptionalWhether text after ## is excluded from size measurement.
wrap_widthOptionalMaximum text width in pixels before wrapping; nonpositive values disable wrapping.
Measured text extent: copied pixel dimensions {x: width, y: height}.
Measure text with the current font, optional wrapping, and optional hidden ID suffixes.
Param: text
UTF-8 text. With omitted/null text_end, strings are encoded; NUL-terminated nonempty byte views are used directly, other views are copied and NUL-terminated. With an explicit end, pass a Uint8Array: its bytes are read directly and need no NUL terminator.
Param: text_end
Exclusive endpoint view, not a length or another string. Explicit begin/end must share one backing buffer and satisfy begin.byteOffset <= end.byteOffset <= begin.byteOffset + begin.byteLength. An empty end view is valid; neither view needs NUL termination. Omitted/null end uses ordinary NUL-terminated UTF-8 conversion.
Param: hide_text_after_double_hash
Whether text after ## is excluded from size measurement.
Param: wrap_width
Maximum text width in pixels before wrapping; nonpositive values disable wrapping.
Returns
Measured text extent: copied pixel dimensions {x: width, y: height}.