Custom Fonts for DOMPDF
- go to your DOMPDF folder
- copy your font's as .ttf (TrueType Font) or .otf (OpenType Font) into the DOMPDF's root
- open your command line and run
php load_font.php your_fonts_name ./your-normal.ttf ./your-bold.ttf ./your-bold-italic.ttf
- 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
- Download ejaz.php from here
- 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;
}