HaruPage::getTextWidth

(PECL haru >= 0.0.1)

HaruPage::getTextWidthGet the width of the text using current fontsize, character spacing and word spacing

说明

HaruPage::getTextWidth ( string $text ) : float

Get the width of the text using current fontsize, character spacing and word spacing

参数

text

The text to measure.

返回值

Returns the width of the text using current fontsize, character spacing and word spacing.

错误/异常

发生错误时抛出 HaruException 异常。

参见

  • HaruPage::measureText() - Calculate the byte length of characters which can be included on one line of the specified width