Function Font.measureText
Measure text string, return accumulated widths[] (distance to end of n-th character), returns number of measured chars.
int measureText(
const(dchar[]) text,
ref int[] widths,
int maxWidth = 2147483647,
int tabSize = 4,
int tabOffset = 0,
uint textFlags = 0u
);
Supports Tab character processing and processing of menu item labels like '&File'.
Parameters
| Name | Description |
|---|---|
| text | text string to measure |
| widths | output buffer to put measured widths (widths[i] will be set to cumulative widths text[0..i], see also textSizeBuffer description) |
| maxWidth | maximum width to measure - measure is stopping if max width is reached (pass MAX_WIDTH_UNSPECIFIED to measure all characters) |
| tabSize | tabulation size, in number of spaces |
| tabOffset | when string is drawn not from left position, use to move tab stops left/right |
| textFlags | TextFlag bit set - to control underline, hotkey label processing, etc... |
Returns
number of characters measured (may be less than text.length if maxWidth is reached)