function _showTextNormal(&$driver) { // draw generic box parent::show($driver); $font_size = $this->getCSSProperty(CSS_FONT_SIZE); if (!$font_size) { $font_size = CSSFontSize::default_value(); } $decoration = $this->getCSSProperty(CSS_TEXT_DECORATION); // draw text decoration $driver->decoration($decoration['U'], $decoration['O'], $decoration['T']); $letter_spacing = $this->getCSSProperty(CSS_LETTER_SPACING); if (!$letter_spacing || $letter_spacing->getPoints() == 0) { // Output text with the selected font // note that we're using $default_baseline; // the alignment offset - the difference between baseline and default_baseline values // is taken into account inside the get_top/get_bottom functions // $size = count($this->words); $left = $this->get_left(); for ($i = 0; $i < $size; $i++) { // Activate font $status = $driver->setfont($this->_get_font_name($driver, $i), $this->encodings[$i], $font_size->getPoints()); if (is_null($status)) { error_log("TextBox::show: setfont call failed"); return null; } $driver->show_xy($this->words[$i], $left, $this->get_top() - $this->default_baseline); $left += $this->_word_widths[$i]; } } else { $current_char = 0; $left = $this->get_left(); $top = $this->get_top() - $this->default_baseline; $num_words = count($this->words); for ($i = 0; $i < $num_words; $i++) { $num_chars = strlen($this->words[$i]); for ($j = 0; $j < $num_chars; $j++) { $status = $driver->setfont($this->_get_font_name($driver, $i), $this->encodings[$i], $font_size->getPoints()); $driver->show_xy($this->words[$i][$j], $left, $top); $left += $this->_widths[$current_char] + $letter_spacing->getPoints(); $current_char++; } } } return true; }