X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Image%2FText.php;h=0598020b08c3e80f828a3d815b0896f8ac9a6fe1;hb=HEAD;hp=223775ddd3cb86919f430cea40dca86c8e8146da;hpb=8f42f25944499df10fd7362ac78772d75155c1cb;p=pear diff --git a/Image/Text.php b/Image/Text.php index 223775dd..0598020b 100644 --- a/Image/Text.php +++ b/Image/Text.php @@ -369,12 +369,14 @@ class Image_Text { * @see Image_Text::set(), Image_Text::construct(), Image_Text::init() */ - function Image_Text($text, $options = null) + function __construct($text, $options = null) { - $this->set('text', $text); + $this->set('text', $text); + if (!empty($options)) { - $this->options = array_merge($this->options, $options); - } + $this->options = array_merge($this->options, $options); + } + } /** @@ -564,12 +566,13 @@ class Image_Text { // todo: with some versions of the GD-library it's also possible to leave font_path empty, add strip ".ttf" from // the fontname; the fontfile will then be automatically searched for in library-defined directories // however this does not yet work if at this point we check for the existance of the fontfile + $font_file = rtrim($this->options['font_path'], '/\\'); $font_file.= (OS_WINDOWS) ? '\\' : '/'; $font_file.= $this->options['font_file']; $font_file = realpath($font_file); if (empty($font_file) || !is_file($font_file) || !is_readable($font_file)) { - return PEAR::staticRaiseError('Fontfile not found or not readable.'); + return PEAR::staticRaiseError('Fontfile not found or not readable: ' . $font_file); } else { $this->_font = $font_file; }