Custom Fonts for DOMPDF

  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;

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


you can add css font :

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

and than

div.ClJ{
    font-family: new_font; 
}