本文整理匯總了PHP中Image_Canvas::setFont方法的典型用法代碼示例。如果您正苦於以下問題:PHP Image_Canvas::setFont方法的具體用法?PHP Image_Canvas::setFont怎麽用?PHP Image_Canvas::setFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Image_Canvas
的用法示例。
在下文中一共展示了Image_Canvas::setFont方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setFont
/**
* Sets the font options.
*
* The $font array may have the following entries:
* 'type' = 'ttf' (TrueType) or omitted for default<br>
* If 'type' = 'ttf' then the following can be specified<br>
* 'size' = size in pixels<br>
* 'angle' = the angle with which to write the text
* 'file' = the .ttf file (either the basename, filename or full path)
*
* @param array $font The font options.
*/
function setFont($fontOptions)
{
parent::setFont($fontOptions);
if (!isset($this->_font['size'])) {
$this->_font['size'] = 10;
}
}
示例2: setFont
/**
* Sets the font options.
*
* The $font array may have the following entries:
*
* 'ttf' = the .ttf file (either the basename, filename or full path)
* If 'ttf' is specified, then the following can be specified
*
* 'size' = size in pixels
*
* 'angle' = the angle with which to write the text
*
* @param array $font The font options.
*/
function setFont($fontOptions)
{
parent::setFont($fontOptions);
if (!isset($this->_font['size'])) {
$this->_font['size'] = 12;
}
if (!isset($this->_font['encoding'])) {
$this->_font['encoding'] = 'winansi';
}
if (!isset($this->_font['color'])) {
$this->_font['color'] = 'black';
}
}
示例3: setFont
/**
* Sets the font options.
*
* The $font array may have the following entries:
*
* 'ttf' = the .ttf file (either the basename, filename or full path)
* If 'ttf' is specified, then the following can be specified
*
* 'size' = size in pixels
*
* 'angle' = the angle with which to write the text
*
* @param array $font The font options.
*/
function setFont($fontOptions)
{
parent::setFont($fontOptions);
if (!isset($this->_font['size'])) {
$this->_font['size'] = 12;
}
if (!isset($this->_font['encoding'])) {
$this->_font['encoding'] = null;
}
if ($this->_font['name'] == 'Helvetica') {
$this->_font['embed'] = 0;
}
if (!isset($this->_font['color'])) {
$this->_font['color'] = 'black';
}
}