Bachir Soussi Chiadmi f2b8ace9b7 FINAL suepr merge step : added all modules to this super repos | пре 9 година | |
---|---|---|
.. | ||
classes | пре 9 година | |
examples | пре 9 година | |
font | пре 9 година | |
graph_cache | пре 9 година | |
iccprofiles | пре 9 година | |
includes | пре 9 година | |
mpdfi | пре 9 година | |
patterns | пре 9 година | |
tmp | пре 9 година | |
ttfontdata | пре 9 година | |
ttfonts | пре 9 година | |
utils | пре 9 година | |
CHANGELOG.txt | пре 9 година | |
CREDITS.txt | пре 9 година | |
FONT INFO.txt | пре 9 година | |
LICENSE.txt | пре 9 година | |
README.txt | пре 9 година | |
compress.php | пре 9 година | |
config.php | пре 9 година | |
config_cp.php | пре 9 година | |
config_fonts.php | пре 9 година | |
graph.php | пре 9 година | |
mpdf.css | пре 9 година | |
mpdf.php | пре 9 година | |
progbar.css | пре 9 година |
"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