How to implement custom fonts in TCPDF

后端 未结 13 708
鱼传尺愫
鱼传尺愫 2020-11-28 10:07

In TCPDF, there are only a few fonts to choose from, to create pdf files. I want to set Tahoma as my pdf font. How can I include Tahoma in TCPDF??<

相关标签:
13条回答
  • 2020-11-28 11:06

    I don't know anything about tcpdf or php, but I found this:

    http://www.tcpdf.org/examples/example_033.phps

    Apparently you just use the font's name, not the file name.


    Strike one!

    Okay, how about this page. To prep a font to be used by TCPDF, you have to run the file through a command line utility and a PHP script.

    $ ttf2ufm -a -F myfont.ttf

    And then:
    $ php -q makefont.php myfont.ttf myfont.ufm
    or
    MakeFont(string $fontfile, string $fmfile [, boolean $embedded [, $enc="cp1252" [, $patch=array()]]])

    ttf2ufm is distributed with TCPDF in the TCPDF/fonts directory.

    0 讨论(0)
提交回复
热议问题