Custom Fonts for DOMPDF

前端 未结 3 1325
囚心锁ツ
囚心锁ツ 2020-12-23 17:22

I\'m Using DOM PDF 0.6.0 Beta 2. I want to use custom fonts (Fonts: \'Segeo Print\', \'Lucida Handwriting\',\'Airplanes in the Night Sky\') in PDF file.

I followed t

相关标签:
3条回答
  • 2020-12-23 18:13
    1. go to your DOMPDF folder
    2. copy your font's as .ttf (TrueType Font) or .otf (OpenType Font) into the DOMPDF's root
    3. open your command line and run
      php load_font.php your_fonts_name ./your-normal.ttf ./your-bold.ttf ./your-bold-italic.ttf
    4. DOMPDF now created Adobe Font Metrics and copied it to lib/fonts/* - you can now use it with
      font-family: your_fonts_name;
    0 讨论(0)
  • 2020-12-23 18:14

    If you want to install custom fonts to the server without a command-based interface then you can do the following web-based model to install the custom fonts

    1. Download ejaz.php from here
    2. Put this file to the root of dompdf and follow the instruction written in it

    no need for root or command/terminal access

    0 讨论(0)
  • 2020-12-23 18:17

    you can add css font :

    @font-face {
        font-family: new_font;
        src: url('my_font.ttf');
    }
    

    and than

    div.ClJ{
        font-family: new_font; 
    }
    
    0 讨论(0)
提交回复
热议问题