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

相关文章
php ncurses 函数 draw a vertical line at current position using an attributed character and max. n characters longphp ncurses 函数 draws a horizontal line in a window at current position using an attributed character and max. n characters longphp ncurses 函数 draws a vertical line in a window at current position using an attributed character and max. n characters longphp harupage begin a text object and set the current text position to 0 0 php harupage fill current path using even odd rule then paint the pathphp harupage fill current path using nonzero winding number rulephp harupage fill current path using nonzero winding number rule then paint the pathphp harupage get the current value of character spacingphp harupage get the current position for text printingphp harupage get the current line widthphp harupage get the current value of line spacingphp harupage get the current text transformation matrix of the pagephp harupage get the width of the text using current fontsize character spacing and word spacingphp harupage get the current value of word spacingphp harupage set character spacing for the pagephp harupage set text leading line spacing for the pagephp harupage print text at the current position of the pagephp harupage move the current position to the start of the next line and print the textphp swftext writes the given text into this swftext object at the current pen position using the current font height spacing and colorphp swftext calculates the width of the given string in this text objects current font and size
关注编程学问公众号