/** * Gets the font of the element. * * If not font has been set, the parent font is propagated through it's * children. * * @param array $options Font options * * @return array An associated array used for canvas * @access private */ function _getFont($options = false) { if ($options === false && $this->_defaultFontOptions !== false) { return $this->_defaultFontOptions; } if ($options === false) { $saveDefault = true; } else { $saveDefault = false; } if ($options === false) { $options = $this->_fontOptions; } else { $options = array_merge($this->_fontOptions, $options); } if ($this->_font == null) { $result = $this->_parent->_getFont($options); } else { $result = $this->_font->_getFont($options); } if (isset($result['size']) && isset($result['size_rel'])) { $result['size'] += $result['size_rel']; unset($result['size_rel']); } if ($saveDefault) { $this->_defaultFontOptions = $result; } return $result; }