本文整理汇总了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';
}
}