Bachir Soussi Chiadmi f2b8ace9b7 FINAL suepr merge step : added all modules to this super repos | 9 years ago | |
---|---|---|
.. | ||
classes | 9 years ago | |
examples | 9 years ago | |
font | 9 years ago | |
graph_cache | 9 years ago | |
iccprofiles | 9 years ago | |
includes | 9 years ago | |
mpdfi | 9 years ago | |
patterns | 9 years ago | |
tmp | 9 years ago | |
ttfontdata | 9 years ago | |
ttfonts | 9 years ago | |
utils | 9 years ago | |
CHANGELOG.txt | 9 years ago | |
CREDITS.txt | 9 years ago | |
FONT INFO.txt | 9 years ago | |
LICENSE.txt | 9 years ago | |
README.txt | 9 years ago | |
compress.php | 9 years ago | |
config.php | 9 years ago | |
config_cp.php | 9 years ago | |
config_fonts.php | 9 years ago | |
graph.php | 9 years ago | |
mpdf.css | 9 years ago | |
mpdf.php | 9 years ago | |
progbar.css | 9 years ago |
"mPDF font-family name" - the name used internally to process fonts. This could be anything you like,
but by default mPDF will convert CSS font-family names by removing any spaces and changing
to lowercase. Reading the name above, mPDF will look for a "mPDF font-family name" of
'trebuchetms'.
The configurable values referred to below are set in the config_fonts.php file
When parsing HTML/CSS, mPDF will read the CSS font-family name (e.g. 'Trebuchet MS') and convert
by removing any spaces and changing to lowercase, to look for a mPDF font-family name (trebuchetms).
Next it will look for a translation (if set) e.g.:
$this->fonttrans = array(
'trebuchetms' => 'trebuchet'
)
Now the mPDF font-family name to be used is 'trebuchet'
If you wish to make this font available, you need to specify the Truetype .ttf font files for each variant.
These should be defined in the array:
$this->fontdata = array(
"trebuchet" => array(
'R' => "trebuc.ttf",
'B' => "trebucbd.ttf",
'I' => "trebucit.ttf",
'BI' => "trebucbi.ttf",
)
)
This is the array which determines whether a font is available to mPDF. Each font-family must have a
Regular ['R'] file defined - the others (bold, italic, bold-italic) are optional.
mPDF will try to load the font-file. If you have defined _MPDF_SYSTEM_TTFONTS at the top of the
config_fonts.php file, it will first look for the font-file there. This is useful if you are running
mPDF on a computer which already has a folder with TTF fonts in (e.g. on Windows)
If the font-file is not there, or _MPDF_SYSTEM_TTFONTS is not defined, mPDF will look in the folder
/[your_path_to_mpdf]/ttfonts/
Note that the font-file names are case-sensitive and can contain capitals.
If the folder /ttfontdata/ is writeable (CHMOD 644 or 755), mPDF will save files there which it can
re-use next time it accesses a particular font. This will significantly improve processing time
and is strongly recommended.
mPDF should be able to read most TrueType Unicode font files with a .ttf extension
Truetype fonts with .ttf extension that are OpenType also work OK.
TrueType collections (.ttc) will also work if they contain TrueType Unicode fonts.
Character substitution
----------------------
Most people will have access to a Pan-Unicode font with most Unicode characters in it such as
Arial Unicode MS. Set $this->backupSubsFont = array('arialunicodems'); at the top of the config_fonts.php file
to use this font when substituting any characters not found in the specific font being used.
Example:
You can set $mpdf->useSubstitutions = true; at runtime
or $this->useSubstitutions = true; in the config.php file
This text contains a Thai character ม which does not exist
in the Comic Sans MS font file