PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.19k forks source link

ErrorException in Font.php line 111: A non well formed numeric value encountered #1201

Closed VegaTom closed 7 years ago

VegaTom commented 7 years ago
$data = pack("vvvvvCCCC",
    $this->_font->getSize() * 20,               //  Fontsize (in twips)
    $grbit,
    $icv,                           //  Colour
    self::_mapBold($this->_font->getBold()),        //  Font weight
    $sss,                           //  Superscript/Subscript
    self::_mapUnderline($this->_font->getUnderline()),
    $bFamily,
    $bCharSet,
    $reserved
);

$this->_font->getSize() should be floatval($this->_font->getSize()) as size may come along with unit of measure (i.e: 20px as is my case)

PowerKiKi commented 7 years ago

I don't think font size is meant to include a unit. I'd need an explanation of why it has a unit in your case, where it comes from, and a reference to the specification that says so.