![]()
| | "); //remove all unsupported tags
//replace carriage returns, newlines and tabs
$repTable = array("\t" => " ", "\n" => "
", "\r" => " ", "\0" => " ", "\x0B" => " ");
$html = strtr($html, $repTable);
@@ -2247,6 +2257,45 @@ function _out($s)
$this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
break;
}
+ case 'span': {
+ if (isset($attr['style']) && $attr['style']!='') {
+ if (eregi("color",$attr['style'])){
+ $coul = substr($attr['style'],11,-2);
+ list($R, $G, $B) = split(', ', $coul);
+ $this->SetTextColor($R,$G,$B);
+ $this->issetcolor=true;
+ }
+ if (eregi("font-family",$attr['style'])){
+ $fontName = substr($attr['style'],13,-1);
+ $fontName = $this->convertNameFont($fontName);
+ if (isset($fontName) && in_array(strtolower($fontName), $this->fontlist)) {
+ $this->SetFont(strtolower($fontName));
+ $this->issetfont=true;
+ //print 'fontfamily: '.$this->FontFamily.'
';
+ }
+ }
+ if (eregi("font-size",$attr['style'])){
+ $headsize = substr($attr['style'],11,-1);
+ $headsize = eregi_replace('-','',$headsize);
+ //print 'headsize1: '.$headsize.'
';
+ //print 'recupheadsize: '.$this->$headsize.'
';
+ $headsize = intval($this->$headsize)/3;
+ //print 'headsize2: '.$headsize.'
';
+ }
+ } else {
+ $headsize = 1;
+ }
+ $currentFontSize = $this->FontSize;
+ $this->tempfontsize = $this->FontSizePt;
+ //$this->SetFontSize($this->FontSizePt + $headsize);
+ //print 'fontsizept: '.$this->FontSizePt.'
';
+ $this->SetFontSize($this->FontSizePt + $headsize - 3); // Todo: correction pour xx-small
+ $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
+ //print 'fontsizeptafter: '.$this->FontSizePt.'
';
+ //print 'fontsize:'.$this->FontSize.'
';
+ //$this->closedHTMLTagHandler('span');
+ break;
+ }
case 'h1':
case 'h2':
case 'h3':
@@ -2329,6 +2378,7 @@ function _out($s)
$this->SetXY($this->GetX(), $this->GetY() - (($this->FontSize - $currentFontSize)/3));
break;
}
+ case 'span':
case 'font': {
if ($this->issetcolor == true) {
$this->SetTextColor($this->prevTextColor[0], $this->prevTextColor[1], $this->prevTextColor[2]);
|