HaruFont::measureText
(PECL haru >= 0.0.1)
HaruFont::measureText — Calculate the number of characters which can be included within the specified width
Description
$text
, float $width
, float $font_size
, float $char_space
, float $word_space
[, bool $word_wrap
= false
] )Calculate the number of characters which can be included within the specified width.
Parameters
-
text
-
The text to fit the width.
-
width
-
The width of the area to put the text to.
-
font_size
-
The size of the font.
-
char_space
-
The character spacing.
-
word_space
-
The word spacing.
-
word_wrap
-
When this parameter is set to
TRUE
the function "emulates" word wrapping and doesn't include the part of the current word if reached the end of the area.
Return Values
Returns the number of characters which can be included within the specified width.
Errors/Exceptions
Throws a HaruException on error.
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Генерация нетекстовых MIME форматов
- Haru PDF
- Функция HaruFont::getAscent() - Get the vertical ascent of the font
- Функция HaruFont::getCapHeight() - Get the distance from the baseline of uppercase letters
- Функция HaruFont::getDescent() - Get the vertical descent of the font
- Функция HaruFont::getEncodingName() - Get the name of the encoding
- Функция HaruFont::getFontName() - Get the name of the font
- Функция HaruFont::getTextWidth() - Get the total width of the text, number of characters, number of words and number of spaces
- Функция HaruFont::getUnicodeWidth() - Get the width of the character in the font
- Функция HaruFont::getXHeight() - Get the distance from the baseline of lowercase letters
- Функция HaruFont::measureText() - Calculate the number of characters which can be included within the specified width
Коментарии
404 Not Found