b2dGetStringWidth

Returns the exact width of rendered text string in pixels. Takes text (string to measure, any UTF-8 text), font (font handle from b2dLoadFont, positive integer). Returns the exact width of rendered text string in pixels.

2D Overlay

Parameters & Returns

Parameters

text String
font Int

Returns

Int

Quick Summary

Returns the exact width of rendered text string in pixels. Takes text (string to measure, any UTF-8 text), font (font handle from b2dLoadFont, positive integer). Returns the exact width of rendered text string in pixels.

Technical Exegesis...

Returns the exact width of rendered text string in pixels. Takes text (string to measure, any UTF-8 text), font (font handle from b2dLoadFont, positive integer). Returns integer width (horizontal space required for text in pixels, 0 if invalid font). Calculates precise rendering width by summing individual character advances and kerning adjustments.

Example

Example.bam
; No example implemented yet