| @@ -7,9 +7,9 @@ | ||
| 7 | 7 | /ttfontdata/ - used to cache font data; improves performance a lot |
| 8 | 8 | /tmp/ - used for some images and ProgressBar |
| 9 | 9 | /graph_cache/ - if you are using JpGraph in conjunction with mPDF |
| 10 | 10 | |
| 11 | -To test the installation, point your browser to the basic example file : [path_to_mpdf_folder]/mpdf/examples/example01_basic.php | |
| 11 | +To test the installation, point your browser to the basic example file : [path_to_mpdf_folder]/mpdf/examples/example_basic.php | |
| 12 | 12 | |
| 13 | 13 | If you wish to define a different folder for temporary files rather than /tmp/ see the note on 'Folder for temporary files' in |
| 14 | 14 | the section on Installation & Setup in the manual (http://mpdf1.com/manual/). |
| 15 | 15 | |
| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | Fonts |
| 20 | 20 | ===== |
| 21 | -Let us refer to font names in 2 ways: | |
| 21 | +I will refer to font names in 2 ways: | |
| 22 | 22 | "CSS font-family name" - mPDF is designed primarily to read HTML and CSS. This is the name used in CSS e.g. |
| 23 | 23 | <p style="font-family: 'Trebuchet MS';"> |
| 24 | 24 | |
| 25 | 25 | "mPDF font-family name" - the name used internally to process fonts. This could be anything you like, |
| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | |
| 32 | 32 | When parsing HTML/CSS, mPDF will read the CSS font-family name (e.g. 'Trebuchet MS') and convert |
| 33 | 33 | by removing any spaces and changing to lowercase, to look for a mPDF font-family name (trebuchetms). |
| 34 | 34 | |
| 35 | -Next it will look for a translation (if set) in config_font.php e.g.: | |
| 35 | +Next it will look for a translation (if set) e.g.: | |
| 36 | 36 | $this->fonttrans = array( |
| 37 | 37 | 'trebuchetms' => 'trebuchet' |
| 38 | 38 | ) |
| 39 | 39 | |
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | |
| 40 | 40 | Now the mPDF font-family name to be used is 'trebuchet' |
| 41 | 41 | |
| 42 | 42 | If you wish to make this font available, you need to specify the Truetype .ttf font files for each variant. |
| 43 | -These should be defined in config_font.php in the array: | |
| 43 | +These should be defined in the array: | |
| 44 | 44 | $this->fontdata = array( |
| 45 | 45 | "trebuchet" => array( |
| 46 | 46 | 'R' => "trebuc.ttf", |
| 47 | 47 | 'B' => "trebucbd.ttf", |
| @@ -66,9 +66,9 @@ | ||
| 66 | 66 | re-use next time it accesses a particular font. This will significantly improve processing time |
| 67 | 67 | and is strongly recommended. |
| 68 | 68 | |
| 69 | 69 | mPDF should be able to read most TrueType Unicode font files with a .ttf extension |
| 70 | -Truetype fonts with .otf extension that are OpenType also work OK. | |
| 70 | +Truetype fonts with .ttf extension that are OpenType also work OK. | |
| 71 | 71 | TrueType collections (.ttc) will also work if they contain TrueType Unicode fonts. |
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | Character substitution |
| @@ -100,8 +100,15 @@ | ||
| 100 | 100 | $this->maxTTFFilesize and $this->percentSubset (see below) |
| 101 | 101 | Default values are set so that: 1) very large font files are always subset |
| 102 | 102 | 2) Fonts are embedded as subsets if < 30% of the characters are used |
| 103 | 103 | |
| 104 | +new mPDF('..-x') - used together with a language or language/country code, this will cause | |
| 105 | + mPDF to use only in-built core fonts (Helvetica, Times) if the language specified is appropiate; | |
| 106 | + otherwise it will force subsetting (equivalent to using "") | |
| 107 | + e.g. new mPDF('de-x') or new mPDF('pt-BR-x') will use in-built core fonts | |
| 108 | + and new mPDF('ru-x') will use subsets of any available TrueType fonts | |
| 109 | + The languages that use core fonts are defined in config_cp.php (using the value $coreSuitable). | |
| 110 | + | |
| 104 | 111 | new mPDF('..+aCJK') new mPDF('+aCJK') |
| 105 | 112 | new mPDF('..-aCJK') new mPDF('-aCJK') |
| 106 | 113 | - used optionally together with a language or language/country code, +aCJK will force mPDF |
| 107 | 114 | to use the Adobe non-embedded CJK fonts when a passage is marked with e.g. "lang: ja" |
| @@ -108,11 +115,22 @@ | ||
| 108 | 115 | This can be used at runtime to override the value set for $mpdf->useAdobeCJK in config.php |
| 109 | 116 | Use in conjunction with settings in config_cp.php |
| 110 | 117 | |
| 111 | 118 | For backwards compatibility, new mPDF('-s') and new mPDF('s') will force subsetting by |
| 112 | - setting $this->percentSubset=100 | |
| 119 | + setting $this->percentSubset=100 (see below) | |
| 113 | 120 | new mPDF('utf-8-s') and new mPDF('ar-s') are also recognised |
| 114 | 121 | |
| 122 | +Language/Country (ll-cc) | |
| 123 | +------------------------ | |
| 124 | +You can use a language code ('en') or language/country code ('en-GB') to control which | |
| 125 | +mode/fonts are used. The behaviour is set up in config_cp.php file. | |
| 126 | +The default settings show some of the things you can do: | |
| 127 | +new mPDF('de') - as German is a Western European langauge, it is suitable to use the Adobe core fonts. | |
| 128 | + Using 'de' alone will do nothing, but if you use ('de-x'), this will use core fonts. | |
| 129 | +new mPDF('th') - many fonts do not contain the characters necessary for Thai script. The value $unifonts | |
| 130 | + defines a restricted list of fonts available for mPDF to use. | |
| 131 | + | |
| 132 | +NB <html dir="rtl"> or <body dir="rtl"> are supported. | |
| 115 | 133 | |
| 116 | 134 | |
| 117 | 135 | |
| 118 | 136 | Configuration variables changed |