Menu

#787 addTTFfont with OTF font returns actual font data

v1.0_(example)
closed
nobody
None
1
2014-08-12
2013-03-21
Liam Vans
No

addTTFfont with the attached .otf font returns not the font name, but the actual binary font data. Also the font is not converted. A .z file does appear, but not the .php and .ctg.z files.

At the end of the addTTFfont function, return $font_name returns the actual font data, not the font name.

Discussion

  • Liam Vans

    Liam Vans - 2013-03-21

    Here's the font, goes for all otf fonts by the way.

     
  • Liam Vans

    Liam Vans - 2013-03-21

    Below is the code to reproduce the issue of the font not being converted, it just generates a .z file in the default fonts directory:

    require_once('../config/lang/eng.php');
    require_once('../tcpdf.php');

    // create new PDF document

    $fontconvert = new TCPDF();
    $ConvertFont = $fontconvert->addTTFfont('birchstd.otf', '', '', 32);

    echo $ConvertFont; // should be the font name that's returned

     
  • Nicola Asuni

    Nicola Asuni - 2013-03-21

    The addTTFfont() method erroneusly returns the font data in case of some errors. I'll fix that soon to return a boolean false.
    In any case seems that the font file you are trying to use is not supported.

     
    • Liam Vans

      Liam Vans - 2013-03-21

      Can you give me an overview of what font types are supported? Meaning, the type of OTF fonts that TCPDF DOES support? It seems from my experience that only TTF fonts and Type-1 PS fonts work. All OTF fonts I have (CFF OTF fonts excluded, they don't work as they are not supported). For arguments sake, should we conclude OTF fonts are not supported at all?

       

      Last edit: Liam Vans 2013-03-21
  • Nicola Asuni

    Nicola Asuni - 2013-03-21

    Only the OTF in binary format (TTF) are now parsed. CFF fonts are not supported.

     
  • Nicola Asuni

    Nicola Asuni - 2013-03-21

    OK. Fixed on TCPDF 6.0.004

     
  • Nicola Asuni

    Nicola Asuni - 2013-03-21
    • status: open --> closed
     

Log in to post a comment.