|
eZ Publish
[4.2]
|
Specifies a font used for drawing text. More...
Public Member Functions | |
| eZImageFont ($family, $size, $path, $xAdjustment=0, $yAdjustment=0) | |
| family () | |
| file () | |
| path () | |
| pointSize () | |
| realFile () | |
| setAdjustment ($xAdjustment, $yAdjustment) | |
| setFamily ($family) | |
| setPath ($path) | |
| setPointSize ($size) | |
| setXAdjustment ($adjustment) | |
| setYAdjustment ($adjustment) | |
| xAdjustment () | |
| yAdjustment () | |
Static Public Member Functions | |
| static | exists ($fontFamily, $fontPath) |
| static | fontFile ($fontFamily, $fontPath) |
Public Attributes | |
| $FontFamily | |
| The current font family. | |
| $FontFile | |
| The path to the font file one was found. | |
| $FontPath | |
| The path or path array to the fonts. | |
| $PointSize | |
| The size of the font in points. | |
| $XAdjustment | |
| Adjustment in the x direction. | |
| $YAdjustment | |
| Adjustment in the y direction. | |
Private Member Functions | |
| initialize () | |
Specifies a font used for drawing text.
Font attributes are encapsulated for use with the eZImageInterface::drawText function. The class stores the family, pointsize and path. Alternatively an x and y adjustment may be specified incase the font rendering is wrong.
Typical usage:
if ( eZImageFont::exists( 'arial', 'design/standard/fonts' ) ) $font = new eZImageFont( 'arial', 30, 'design/standard/fonts' );
All attributes can be modified later on with setFamily, setPath, setPointSize, setXAdjustment and setYAdjustment.
Definition at line 52 of file ezimagefont.php.
| static eZImageFont::exists | ( | $ | fontFamily, |
| $ | fontPath | ||
| ) | [static] |
Definition at line 193 of file ezimagefont.php.
Referenced by eZTemplateImageOperator\modify().
| eZImageFont::eZImageFont | ( | $ | family, |
| $ | size, | ||
| $ | path, | ||
| $ | xAdjustment = 0, |
||
| $ | yAdjustment = 0 |
||
| ) |
Initializes the object with a family, point size and path. X and y adjustment may also be specified.
Definition at line 58 of file ezimagefont.php.
| eZImageFont::family | ( | ) |
Definition at line 74 of file ezimagefont.php.
| eZImageFont::file | ( | ) |
Definition at line 91 of file ezimagefont.php.
| static eZImageFont::fontFile | ( | $ | fontFamily, |
| $ | fontPath | ||
| ) | [static] |
false if no font could be used. The font must be named equal to the $fontFamily parameter with the .ttf suffix, eg. arial.ttf. | fontPath | The path to the fonts or an array of paths. |
Definition at line 214 of file ezimagefont.php.
Referenced by exists(), and initialize().
| eZImageFont::initialize | ( | ) | [private] |
Initializes the font file attribute by searching for the font.
Definition at line 202 of file ezimagefont.php.
Referenced by eZImageFont(), setFamily(), and setPath().
| eZImageFont::path | ( | ) |
Definition at line 82 of file ezimagefont.php.
| eZImageFont::pointSize | ( | ) |
Definition at line 108 of file ezimagefont.php.
| eZImageFont::realFile | ( | ) |
Similar to file but returns the absolute path to the font file. This is required for GD font handling.
Definition at line 100 of file ezimagefont.php.
| eZImageFont::setAdjustment | ( | $ | xAdjustment, |
| $ | yAdjustment | ||
| ) |
Sets the number of pixels to adjust the font output to $xAdjustment and $yAdjustment.
Definition at line 182 of file ezimagefont.php.
| eZImageFont::setFamily | ( | $ | family | ) |
Sets the font family to $family.
Definition at line 135 of file ezimagefont.php.
| eZImageFont::setPath | ( | $ | path | ) |
Sets the font path which is used when searching for fonts, the path can either be a string or an array of strings.
Definition at line 146 of file ezimagefont.php.
| eZImageFont::setPointSize | ( | $ | size | ) |
Sets the point size of the font to $size.
Definition at line 155 of file ezimagefont.php.
| eZImageFont::setXAdjustment | ( | $ | adjustment | ) |
Sets the number of pixels in the x direction to adjust the font output to $adjustment.
Definition at line 164 of file ezimagefont.php.
| eZImageFont::setYAdjustment | ( | $ | adjustment | ) |
Sets the number of pixels in the y direction to adjust the font output to $adjustment.
Definition at line 173 of file ezimagefont.php.
| eZImageFont::xAdjustment | ( | ) |
Definition at line 117 of file ezimagefont.php.
| eZImageFont::yAdjustment | ( | ) |
Definition at line 126 of file ezimagefont.php.
| eZImageFont::$FontFamily |
The current font family.
Definition at line 240 of file ezimagefont.php.
| eZImageFont::$FontFile |
The path to the font file one was found.
Definition at line 244 of file ezimagefont.php.
| eZImageFont::$FontPath |
The path or path array to the fonts.
Definition at line 242 of file ezimagefont.php.
| eZImageFont::$PointSize |
The size of the font in points.
Definition at line 246 of file ezimagefont.php.
| eZImageFont::$XAdjustment |
Adjustment in the x direction.
Definition at line 248 of file ezimagefont.php.
| eZImageFont::$YAdjustment |
Adjustment in the y direction.
Definition at line 250 of file ezimagefont.php.