Gravity PDF - Version 3.5.0

Version Description

  • Feature - No longer need to reinitialise every time the software is updated.
  • Feature - Add auto-initialiser on initial installation for sites that have direct write access to their server files
  • Feature - Add auto-initialiser on initial installation across entire multisite network for sites who have direct write access to their server files.
  • Feature - Add auto-PDF_EXTENDED_TEMPLATE theme syncer for sites that have direct write access to their server files
  • Feature - Correctly added language support. The .PO file is located in the /language/ folder if anyone would like to do a translation.

  • Housekeeping - Restrict initialisation process to 64MB or greater to counter problems with users reporting a 'white screen' when running in a low-RAM environment.

  • Housekeeping - Refractor the admin notices code

  • Housekeeping - Create responsive PDF settings page

  • Housekeeping - Minify CSS and Javascript files

  • Housekeeping - Remove FontAwesome fonts from package and use Wordpress' build-in 'dashicons'

  • Housekeeping - Refine action and error messages

  • Housekeeping - Update initialisation tab copy for both pre- and post- initialisation

  • Housekeeping - Use Gravity Forms get_ip() function instead of custom function

  • Housekeeping - The in-built support form uses SSL once again (disabled in the past due to some servers being unable to verify the certificate).

  • Bug - When testing write permissions, file_exist() is throwing false positives for some users which would generate a warning when unlink() is called. Hide warning using '@'.

Download this release

Release Info

Developer Blue Liquid Designs
Plugin Icon 128x128 Gravity PDF
Version 3.5.0
Comparing to
See all releases

Code changes from version 3.4.0.3 to 3.5.0

Files changed (56) hide show
  1. README.md +0 -29
  2. README.txt +25 -1
  3. helper/api.php +25 -2
  4. helper/data.php +7 -0
  5. helper/installation-update-manager.php +222 -387
  6. helper/notices.php +346 -0
  7. helper/pdf-common.php +38 -78
  8. initialisation/.htaccess +1 -0
  9. initialisation/templates/example-template.php +1 -1
  10. languages/language.po +921 -0
  11. mPDF.zip +0 -0
  12. mPDF/CHANGELOG.txt +25 -0
  13. mPDF/CREDITS.txt +92 -0
  14. mPDF/FONT INFO.txt +164 -0
  15. LICENSE → mPDF/LICENSE.txt +24 -23
  16. mPDF/README.txt +5 -0
  17. mPDF/classes/barcode.php +1966 -0
  18. mPDF/classes/bmp.php +248 -0
  19. mPDF/classes/cssmgr.php +1566 -0
  20. mPDF/classes/directw.php +408 -0
  21. mPDF/classes/form.php +1498 -0
  22. mPDF/classes/gif.php +700 -0
  23. mPDF/classes/grad.php +723 -0
  24. mPDF/classes/indic.php +433 -0
  25. mPDF/classes/meter.php +224 -0
  26. mPDF/classes/svg.php +2600 -0
  27. mPDF/classes/tocontents.php +468 -0
  28. mPDF/classes/ttfontsuni.php +2066 -0
  29. mPDF/classes/ttfontsuni_analysis.php +463 -0
  30. mPDF/classes/wmf.php +236 -0
  31. mPDF/compress.php +172 -0
  32. mPDF/config.php +592 -0
  33. mPDF/config_cp.php +153 -0
  34. mPDF/config_fonts.php +313 -0
  35. mPDF/font/ccourier.php +9 -0
  36. mPDF/font/ccourierb.php +9 -0
  37. mPDF/font/ccourierbi.php +9 -0
  38. mPDF/font/ccourieri.php +9 -0
  39. mPDF/font/chelvetica.php +20 -0
  40. mPDF/font/chelveticab.php +21 -0
  41. mPDF/font/chelveticabi.php +21 -0
  42. mPDF/font/chelveticai.php +21 -0
  43. mPDF/font/csymbol.php +21 -0
  44. mPDF/font/ctimes.php +21 -0
  45. mPDF/font/ctimesb.php +21 -0
  46. mPDF/font/ctimesbi.php +21 -0
  47. mPDF/font/ctimesi.php +21 -0
  48. mPDF/font/czapfdingbats.php +21 -0
  49. mPDF/graph.php +721 -0
  50. mPDF/iccprofiles/SWOP2006_Coated5v2.icc +0 -0
  51. mPDF/iccprofiles/sRGB_IEC61966-2-1.icc +0 -0
  52. mPDF/includes/CJKdata.php +101 -0
  53. mPDF/includes/functions.php +157 -0
  54. mPDF/includes/ind_bn_1_001.volt.php +3164 -0
  55. mPDF/includes/ind_gu_1_001.volt.php +3314 -0
  56. mPDF/includes/ind_hi_1_001.volt.php +374 -0
README.md DELETED
@@ -1,29 +0,0 @@
1
- Gravity Forms PDF Extended
2
- ==========================
3
-
4
- Gravity Forms PDF Extended is a Wordpress plugin that allows you to save/view/download a PDF from the front- and back-end, and automate PDF creation on form submission.
5
-
6
- Find out more at [http://gravityformspdfextended.com](http://gravityformspdfextended.com/).
7
-
8
-
9
- # Documentation
10
-
11
- All documentation can be found at [http://gravityformspdfextended.com](http://gravityformspdfextended.com/documentation/).
12
-
13
- # Branches
14
-
15
- ## master
16
-
17
- The master branch contains the latest stable release of the software. It's the same version [avaliable in the Wordpress repository](http://wordpress.org/plugins/gravity-forms-pdf-extended/).
18
-
19
- ## beta
20
-
21
- If we are currently running a beta edition of the software, this version will be avalible in the beta branch. This is a stable development version *but should not be used in a production environment*.
22
-
23
- ## development
24
-
25
- This is our work in progress, bleeding edge edition of the software. Consider this an alpha edition.
26
-
27
- # Pull Requests
28
-
29
- Pull requests are always welcome.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.gravityformspdfextended.com
4
  Tags: gravity, forms, pdf, automation, attachment
5
  Requires at least: 3.5
6
  Tested up to: 3.9
7
- Stable tag: 3.4.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -48,6 +48,8 @@ Along with the above, the PDF software includes powerful feature such as:
48
  3. GD Library
49
  4. RAM: Recommended: 128MB. Minimum: 64MB.
50
 
 
 
51
  **Software Requirements**
52
 
53
  1. [Purchase and install Gravity Forms](https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154)
@@ -78,6 +80,28 @@ All FAQs can be [viewed on the Gravity Forms PDF Extended website](http://gravit
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  = 3.4.0.3 =
82
  * Bug - Define array_replace_recursive() if it doesn't exist, as it is PHP 5.3 only.
83
 
4
  Tags: gravity, forms, pdf, automation, attachment
5
  Requires at least: 3.5
6
  Tested up to: 3.9
7
+ Stable tag: 3.5.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
48
  3. GD Library
49
  4. RAM: Recommended: 128MB. Minimum: 64MB.
50
 
51
+ *Note:* We've had clients report slow PDF generation times and problems meeting the RAM requirements on cheap shared web hosting. If you experience these problems [we recommend you look into WP Engine's managed hosting platform](http://www.shareasale.com/r.cfm?u=955815&m=41388&b=394686) as our software works correctly out of the box.
52
+
53
  **Software Requirements**
54
 
55
  1. [Purchase and install Gravity Forms](https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154)
80
 
81
  == Changelog ==
82
 
83
+ = 3.5.0 =
84
+ * Feature - No longer need to reinitialise every time the software is updated.
85
+ * Feature - Add auto-initialiser on initial installation for sites that have direct write access to their server files
86
+ * Feature - Add auto-initialiser on initial installation across entire multisite network for sites who have direct write access to their server files.
87
+ * Feature - Add auto-PDF_EXTENDED_TEMPLATE theme syncer for sites that have direct write access to their server files
88
+ * Feature - Correctly added language support. The .PO file is located in the /language/ folder if anyone would like to do a translation.
89
+
90
+ * Housekeeping - Restrict initialisation process to 64MB or greater to counter problems with users reporting a 'white screen' when running in a low-RAM environment.
91
+ * Housekeeping - Refractor the admin notices code
92
+ * Housekeeping - Create responsive PDF settings page
93
+ * Housekeeping - Minify CSS and Javascript files
94
+ * Housekeeping - Remove FontAwesome fonts from package and use Wordpress' build-in 'dashicons'
95
+ * Housekeeping - Refine action and error messages
96
+ * Housekeeping - Update initialisation tab copy for both pre- and post- initialisation
97
+ * Housekeeping - Use Gravity Forms get_ip() function instead of custom function
98
+ * Housekeeping - The in-built support form uses SSL once again (disabled in the past due to some servers being unable to verify the certificate).
99
+
100
+ * Bug - When testing write permissions, file_exist() is throwing false positives for some users which would generate a warning when unlink() is called. Hide warning using '@'.
101
+
102
+ = 3.4.1 =
103
+ * Bug - Fix typo that effected sites running PHP5.2 or below.
104
+
105
  = 3.4.0.3 =
106
  * Bug - Define array_replace_recursive() if it doesn't exist, as it is PHP 5.3 only.
107
 
helper/api.php CHANGED
@@ -4,7 +4,7 @@ define('PDF_DEBUG', false);
4
 
5
  class gfpdfe_API
6
  {
7
- private $api_url = 'http://gravityformspdfextended.com/api/';
8
  private $api_version = '1.0';
9
 
10
  private $username;
@@ -28,6 +28,10 @@ class gfpdfe_API
28
 
29
  }
30
 
 
 
 
 
31
  private function get_api_access_details()
32
  {
33
  /*
@@ -65,6 +69,9 @@ class gfpdfe_API
65
  */
66
  $r_data = json_decode($response['body']);
67
 
 
 
 
68
  update_option('gfpdfe_api_username', $r_data->username);
69
  update_option('gfpdfe_api_secret', $r_data->secretkey);
70
 
@@ -81,13 +88,22 @@ class gfpdfe_API
81
  }
82
 
83
  }
84
-
 
 
 
 
85
  private function add_headers($request)
86
  {
87
 
88
  /* change the timeout from 5 seconds to 20 */
89
  $request['timeout'] = 20;
90
 
 
 
 
 
 
91
  $request['headers'] = array(
92
  'API' => (string) $this->api_version,
93
  'API_STAMP' => (string) time(),
@@ -104,6 +120,9 @@ class gfpdfe_API
104
  return $this->create_hash($request);
105
  }
106
 
 
 
 
107
  private function check_response_code($response)
108
  {
109
 
@@ -197,9 +216,13 @@ class gfpdfe_API
197
 
198
  $hashed = hash ('sha256', serialize($hash_request) . $secret_key );
199
  $request['headers']['hash'] = $hashed;
 
200
  return $request;
201
  }
202
 
 
 
 
203
  public function support_request($body)
204
  {
205
  static $retry = false;
4
 
5
  class gfpdfe_API
6
  {
7
+ private $api_url = 'https://gravityformspdfextended.com/api/';
8
  private $api_version = '1.0';
9
 
10
  private $username;
28
 
29
  }
30
 
31
+ /*
32
+ * This is a public API so users need to request credentials initially
33
+ * so our server knowns who is talking to it (and authenticate the message).
34
+ */
35
  private function get_api_access_details()
36
  {
37
  /*
69
  */
70
  $r_data = json_decode($response['body']);
71
 
72
+ /*
73
+ * We will use this username and secret for future communication
74
+ */
75
  update_option('gfpdfe_api_username', $r_data->username);
76
  update_option('gfpdfe_api_secret', $r_data->secretkey);
77
 
88
  }
89
 
90
  }
91
+
92
+
93
+ /*
94
+ * Add headers to all API calls
95
+ */
96
  private function add_headers($request)
97
  {
98
 
99
  /* change the timeout from 5 seconds to 20 */
100
  $request['timeout'] = 20;
101
 
102
+ /*
103
+ * Disable SSL verify as some hosts are having trouble verifying our SSL certificate (even though it isn't self signed).
104
+ */
105
+ $request['sslverify'] = false;
106
+
107
  $request['headers'] = array(
108
  'API' => (string) $this->api_version,
109
  'API_STAMP' => (string) time(),
120
  return $this->create_hash($request);
121
  }
122
 
123
+ /*
124
+ * Check the response code sent by our API server
125
+ */
126
  private function check_response_code($response)
127
  {
128
 
216
 
217
  $hashed = hash ('sha256', serialize($hash_request) . $secret_key );
218
  $request['headers']['hash'] = $hashed;
219
+
220
  return $request;
221
  }
222
 
223
+ /*
224
+ * Make our actual support request call to the API
225
+ */
226
  public function support_request($body)
227
  {
228
  static $retry = false;
helper/data.php CHANGED
@@ -1,5 +1,12 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  class GFPDFE_DATA
4
  {
5
  /** Location for overloaded data. */
1
  <?php
2
 
3
+ /**
4
+ * Plugin: Gravity Forms PDF Extended
5
+ * File: data.php
6
+ *
7
+ * This is a data overloading class which holds important variables shared throughout the plugin
8
+ */
9
+
10
  class GFPDFE_DATA
11
  {
12
  /** Location for overloaded data. */
helper/installation-update-manager.php CHANGED
@@ -13,7 +13,143 @@
13
 
14
  class GFPDF_InstallUpdater
15
  {
 
 
 
 
 
 
 
 
 
 
 
 
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Install everything required
19
  */
@@ -22,9 +158,9 @@ class GFPDF_InstallUpdater
22
  /*
23
  * Initialise the Wordpress Filesystem API
24
  */
25
- if(PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy'), 'pdf-extended-filesystem') === false)
26
  {
27
- return false;
28
  }
29
 
30
  /*
@@ -33,39 +169,19 @@ class GFPDF_InstallUpdater
33
  global $wp_filesystem, $gfpdfe_data;
34
 
35
  /*
36
- * We need to set up some filesystem compatibility checkes to work with the different server file management types
37
- * Most notably is the FTP options, but SSH may be effected too
 
38
  */
39
- $directory = PDF_PLUGIN_DIR;
40
- $template_directory = PDF_TEMPLATE_LOCATION;
41
- $template_save_directory = PDF_SAVE_LOCATION;
42
- $template_font_directory = PDF_FONT_LOCATION;
43
-
44
-
45
- /*
46
- * If using FTP we need to make modifications to the file paths
47
- * Unlike the direct method, the root of the FTP directory isn't the ABSPATH
48
- * Usually FTP is restricted to the public_html directory, or just above it.
49
- */
50
- if($wp_filesystem->method === 'ftpext' || $wp_filesystem->method === 'ftpsockets' || $wp_filesystem->method === 'ssh2')
51
- {
52
- /*
53
- * Get the base directory
54
- */
55
- $base_directory = self::get_base_directory();
56
-
57
- $directory = str_replace(ABSPATH, $base_directory, $directory);
58
- $template_directory = str_replace(ABSPATH, $base_directory, $template_directory);
59
- $template_save_directory = str_replace(ABSPATH, $base_directory, $template_save_directory);
60
- $template_font_directory = str_replace(ABSPATH, $base_directory, $template_font_directory);
61
-
62
- }
63
 
64
  /**
65
  * If PDF_TEMPLATE_LOCATION already exists then we will remove the old template files so we can redeploy the new ones
66
  */
67
-
68
- if($wp_filesystem->exists($template_directory) && PDF_DEPLOY === true)
69
  {
70
  /*
71
  * Create a backup folder and move all the files there
@@ -91,36 +207,15 @@ class GFPDF_InstallUpdater
91
  $wp_filesystem->move($template_directory.$path_parts['basename'], $template_directory . $backup_folder . $path_parts['basename']);
92
  }
93
  }
94
- }
95
-
96
-
97
- /* unzip the mPDF file */
98
- if($wp_filesystem->exists($directory . 'mPDF.zip'))
99
- {
100
- /*
101
- * The only function that requires the input to be the full path and the export to be the directory used in $wp_filesystem
102
- */
103
- $results = unzip_file( PDF_PLUGIN_DIR . 'mPDF.zip', $directory );
104
-
105
- if($results !== true)
106
- {
107
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_unzip_mpdf_err'));
108
- return 'fail';
109
- }
110
-
111
- /*
112
- * Remove the original archive
113
- */
114
- $wp_filesystem->delete($directory . 'mPDF.zip');
115
- }
116
 
117
  /* create new directory in active themes folder*/
118
  if(!$wp_filesystem->is_dir($template_directory))
119
  {
120
  if($wp_filesystem->mkdir($template_directory) === false)
121
  {
122
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
123
- return 'fail';
124
  }
125
  }
126
 
@@ -129,8 +224,8 @@ class GFPDF_InstallUpdater
129
  /* create new directory in active themes folder*/
130
  if($wp_filesystem->mkdir($template_save_directory) === false)
131
  {
132
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
133
- return 'fail';
134
  }
135
  }
136
 
@@ -139,8 +234,8 @@ class GFPDF_InstallUpdater
139
  /* create new directory in active themes folder*/
140
  if($wp_filesystem->mkdir($template_font_directory) === false)
141
  {
142
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
143
- return 'fail';
144
  }
145
  }
146
 
@@ -154,8 +249,8 @@ class GFPDF_InstallUpdater
154
  /* copy template files to new directory */
155
  if(!$wp_filesystem->copy($directory .'initialisation/configuration.php.example', $template_directory.'configuration.php'))
156
  {
157
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
158
- return 'fail';
159
  }
160
  }
161
 
@@ -163,26 +258,35 @@ class GFPDF_InstallUpdater
163
  {
164
  if(!$wp_filesystem->put_contents($template_save_directory.'.htaccess', 'deny from all'))
165
  {
166
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
167
- return 'fail';
168
  }
169
  }
170
 
171
  if(self::install_fonts($directory, $template_directory, $template_font_directory) !== true)
172
  {
173
- return 'fail';
174
  }
175
 
176
  /*
177
  * Update system to ensure everything is installed correctly.
178
  */
 
 
 
 
 
 
 
 
 
 
 
179
 
180
  update_option('gf_pdf_extended_installed', 'installed');
181
- update_option('gf_pdf_extended_deploy', 'yes');
182
- update_option('gf_pdf_extended_version', PDF_EXTENDED_VERSION);
183
  delete_option('gfpdfe_switch_theme');
184
-
185
- return true;
186
  }
187
 
188
  public static function initialise_fonts()
@@ -198,33 +302,19 @@ class GFPDF_InstallUpdater
198
  /*
199
  * If we got here we should have $wp_filesystem available
200
  */
201
- global $wp_filesystem;
202
 
203
  /*
204
  * We need to set up some filesystem compatibility checkes to work with the different server file management types
205
  * Most notably is the FTP options, but SSH may be effected too
206
  */
207
- $directory = PDF_PLUGIN_DIR;
208
- $template_directory = PDF_TEMPLATE_LOCATION;
209
- $template_font_directory = PDF_FONT_LOCATION;
210
-
211
-
212
- if($wp_filesystem->method === 'ftpext' || $wp_filesystem->method === 'ftpsockets' || $wp_filesystem->method === 'ssh2')
213
- {
214
- /*
215
- * Assume FTP is rooted to the Wordpress install
216
- */
217
- $base_directory = self::get_base_directory();
218
-
219
- $directory = str_replace(ABSPATH, $base_directory, $directory);
220
- $template_directory = str_replace(ABSPATH, $base_directory, $template_directory);
221
- $template_font_directory = str_replace(ABSPATH, $base_directory, $template_font_directory);
222
-
223
- }
224
 
225
  if(self::install_fonts($directory, $template_directory, $template_font_directory) === true)
226
  {
227
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_font_install_success'));
228
  }
229
  return true;
230
  }
@@ -232,7 +322,7 @@ class GFPDF_InstallUpdater
232
  private static function install_fonts($directory, $template_directory, $fonts_location)
233
  {
234
 
235
- global $wp_filesystem;
236
  $write_to_file = '<?php
237
 
238
  if(!defined("PDF_EXTENDED_VERSION"))
@@ -262,7 +352,7 @@ class GFPDF_InstallUpdater
262
  */
263
  if($wp_filesystem->copy($file, $directory . 'mPDF/ttfonts/' . $path_parts['basename']) === false)
264
  {
265
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_font_err'));
266
  return false;
267
  }
268
  }
@@ -283,166 +373,13 @@ class GFPDF_InstallUpdater
283
  $wp_filesystem->delete($template_directory.'fonts/config.php');
284
  if($wp_filesystem->put_contents($template_directory.'fonts/config.php', $write_to_file) === false)
285
  {
286
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_font_config_err'));
287
  return false;
288
  }
289
 
290
  return true;
291
  }
292
 
293
- public static function gf_pdf_font_install_success()
294
- {
295
- echo '<div id="message" class="updated"><p>';
296
- echo __('The font files have been successfully installed. A font can be used by adding its file name (without .ttf and in lower case) in a CSS font-family declaration.', 'pdfextended');
297
- echo '</p></div>';
298
- }
299
-
300
- public static function gf_pdf_font_err()
301
- {
302
- echo '<div id="message" class="error"><p>';
303
- echo __('There was a problem installing the font files. Manually copy your fonts to the plugin\'s mPDF/ttfonts/ folder.', 'pdfextended');
304
- echo '</p></div>';
305
- }
306
-
307
- public static function gf_pdf_font_config_err()
308
- {
309
- echo '<div id="message" class="error"><p>';
310
- echo __('Could not create font configuration file. Try initialise again.', 'pdfextended');
311
- echo '</p></div>';
312
- }
313
-
314
- /**
315
- * Gravity Forms hasn't been installed so throw error.
316
- * We make sure the user hasn't already dismissed the error
317
- */
318
- public static function gf_pdf_not_installed()
319
- {
320
- echo '<div id="message" class="error"><p>';
321
- echo sprintf(__('You need to install/update %sGravity Forms%s to use the Gravity Forms PDF Extended Plugin.', 'pdfextended'), '<a href="https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154" target="ejejcsingle">', '</a>');
322
- echo '</p></div>';
323
- }
324
-
325
- /**
326
- * PDF Extended has been updated but the new template files haven't been deployed yet
327
- */
328
- public static function gf_pdf_not_deployed()
329
- {
330
- if( !rgpost('update') )
331
- {
332
- if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
333
- {
334
- echo '<div id="message" class="error"><p>';
335
- echo __('You\'ve updated Gravity Forms PDF Extended but are yet to re-initialise the plugin. Please use the "Initialise Plugin" button below to complete the upgrade.', 'pdfextended');
336
- echo '</p></div>';
337
-
338
- }
339
- else
340
- {
341
- echo '<div id="message" class="error"><p>';
342
- echo sprintf(__('You\'ve updated Gravity Forms PDF Extended but are yet to re-initialise the plugin. Please go to the %splugin\'s settings page%s to initialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
343
- echo '</p></div>';
344
- }
345
- }
346
- }
347
-
348
- /**
349
- * The software has detected a problem (no configuration.php file or no PDF_EXTENDED_TEMPLATE folder
350
- * The user will need to reinitialise
351
- */
352
- public static function gf_pdf_problem_detected()
353
- {
354
- if( !rgpost('update') )
355
- {
356
- if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
357
- {
358
- echo '<div id="message" class="error"><p>';
359
- echo __('Gravity Forms PDF Extended detected a configuration problem. Please re-initialise the plugin.', 'pdfextended');
360
- echo '</p></div>';
361
-
362
- }
363
- else
364
- {
365
- echo '<div id="message" class="error"><p>';
366
- echo sprintf(__('Gravity Forms PDF Extended detected a configuration problem. Please go to the %splugin\'s settings page%s to re-initialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
367
- echo '</p></div>';
368
- }
369
- }
370
- }
371
-
372
- /**
373
- * PDF Extended has been freshly installed
374
- */
375
- public static function gf_pdf_not_deployed_fresh()
376
- {
377
- if( !rgpost('update') )
378
- {
379
- if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
380
- {
381
- echo '<div id="message" class="updated"><p>';
382
- echo __('Welcome to Gravity Forms PDF Extended. Before you can use the plugin correctly you need to initilise it.', 'pdfextended');
383
- echo '</p></div>';
384
-
385
- }
386
- else
387
- {
388
- echo '<div id="message" class="updated"><p>';
389
- echo sprintf(__('Welcome to Gravity Forms PDF Extended. Before you can use the plugin correctly you need to initilise it. Please go to the %splugin\'s settings page%s to initialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
390
- echo '</p></div>';
391
- }
392
- }
393
- }
394
-
395
- /**
396
- * The Gravity Forms version isn't compatible. Prompt user to upgrade
397
- */
398
- public static function gf_pdf_not_supported()
399
- {
400
- echo '<div id="message" class="error"><p>';
401
- echo sprintf(__('Gravity Forms PDF Extended only works with Gravity Forms version '.GF_PDF_EXTENDED_SUPPORTED_VERSION.' and higher. Please %supgrade your copy of Gravity Forms%s to use this plugin.', 'pdfextended'), '<a href="https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154" target="ejejcsingle">', '</a>');
402
- echo '</p></div>';
403
- }
404
-
405
-
406
- /**
407
- * Cannot create new template folder in active theme directory
408
- */
409
- public static function gf_pdf_template_dir_err()
410
- {
411
- echo '<div id="message" class="error"><p>';
412
- echo __('We could not create a template folder in your active theme\'s directory. Please ensure your active theme directory is writable by your web server and try again.', 'pdfextended');
413
- echo '</p></div>';
414
-
415
- }
416
-
417
- public static function gf_pdf_unzip_mpdf_err()
418
- {
419
- echo '<div id="message" class="error"><p>';
420
- echo __('Could not unzip mPDF.zip (located in the plugin folder). Unzip the file manually, place the extracted mPDF folder in the plugin folder and run the initialisation again.', 'pdfextended');
421
- echo '</p></div>';
422
- }
423
-
424
- /**
425
- * Cannot remove old default template files
426
- */
427
- public static function gf_pdf_deployment_unlink_error()
428
- {
429
- echo '<div id="message" class="error"><p>';
430
- echo __('We could not remove the default template files from the Gravity Forms PDF Extended folder in your active theme\'s directory. Please ensure '. PDF_SAVE_LOCATION.' is wriable by your web server and try again.', 'pdfextended');
431
- echo '</p></div>';
432
-
433
- }
434
-
435
- /**
436
- * Cannot create new template folder in active theme directory
437
- */
438
- public static function gf_pdf_template_move_err()
439
- {
440
- echo '<div id="message" class="error"><p>';
441
- echo __('We could not move the template files to the PDF_EXTENDED_TEMPLATES folder. Please ensure '. PDF_SAVE_LOCATION.' is wriable by your web server and try again.', 'pdfextended');
442
- echo '</p></div>';
443
-
444
- }
445
-
446
  /*
447
  * When switching themes copy over current active theme's PDF_EXTENDED_TEMPLATES (if it exists) to new theme folder
448
  */
@@ -460,9 +397,25 @@ class GFPDF_InstallUpdater
460
  * Add the save folder name to the end of the paths
461
  */
462
  $old_pdf_path = $previous_theme_directory . '/' . PDF_SAVE_FOLDER;
463
- $new_pdf_path = $current_theme_directory . '/' . PDF_SAVE_FOLDER;
464
 
465
  update_option('gfpdfe_switch_theme', array('old' => $old_pdf_path, 'new' => $new_pdf_path));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
466
  }
467
 
468
  /*
@@ -471,44 +424,21 @@ class GFPDF_InstallUpdater
471
  */
472
  public static function check_theme_switch()
473
  {
 
 
474
  $theme_switch = get_option('gfpdfe_switch_theme');
475
-
476
  if(isset($theme_switch['old']) && isset($theme_switch['new']))
477
  {
478
  /*
479
  * Add admin notification hook to move the files
480
  */
481
- add_action('admin_notices', array("GFPDF_InstallUpdater", "do_theme_switch_notice"));
482
  return true;
483
  }
484
  return false;
485
  }
486
 
487
- /*
488
- * Prompt user to keep the plugin working
489
- */
490
- public static function do_theme_switch_notice()
491
- {
492
- /*
493
- * Check we aren't in the middle of doing the sync
494
- */
495
- if(isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'gfpdfe_sync_now'))
496
- {
497
- return;
498
- }
499
-
500
- echo '<div id="message" class="error"><p>';
501
- echo sprintf(__('Gravity Forms PDF Extended needs to keep your configuration and template folder in sync with your current active theme. %sSync Now%s', 'pdfextended'), '<a href="'. wp_nonce_url(PDF_SETTINGS_URL, 'gfpdfe_sync_now') . '" class="button">', '</a>');
502
- echo '</p></div>';
503
-
504
- }
505
-
506
- public static function gf_pdf_theme_sync_success()
507
- {
508
- echo '<div id="message" class="updated"><p>';
509
- echo __('Your configuration and template folder was successfully synced.', 'pdfextended');
510
- echo '</p></div>';
511
- }
512
 
513
  /*
514
  * The after_switch_theme hook is too early in the initialisation to use request_filesystem_credentials()
@@ -521,59 +451,48 @@ class GFPDF_InstallUpdater
521
  * It only allows post data to be added so we have to manually assign them
522
  */
523
  $_POST['previous_pdf_path'] = $previous_pdf_path;
524
- $_POST['current_pdf_path'] = $current_pdf_path;
525
 
526
  /*
527
  * Initialise the Wordpress Filesystem API
528
  */
529
  if(PDF_Common::initialise_WP_filesystem_API(array('previous_pdf_path', 'current_pdf_path'), 'gfpdfe_sync_now') === false)
530
  {
531
- return false;
532
  }
533
 
534
  /*
535
  * If we got here we should have $wp_filesystem available
536
  */
537
- global $wp_filesystem;
538
-
539
  /*
540
- * We need to set up some filesystem compatibility checkes to work with the different server file management types
541
- * Most notably is the FTP options, but SSH may be effected too
542
- */
543
-
544
- if($wp_filesystem->method === 'ftpext' || $wp_filesystem->method === 'ftpsockets' || $wp_filesystem->method === 'ssh2')
 
545
  {
 
 
546
  /*
547
- * Assume FTP is rooted to the Wordpress install
548
- */
549
- $base_directory = self::get_base_directory();
 
550
 
551
- $previous_pdf_path = str_replace(ABSPATH, $base_directory, $previous_pdf_path);
552
- $current_pdf_path = str_replace(ABSPATH, $base_directory, $current_pdf_path);
553
-
554
- }
555
-
556
- if($wp_filesystem->is_dir($previous_pdf_path))
557
- {
558
- self::pdf_extended_copy_directory( $previous_pdf_path, $current_pdf_path, true, true );
559
- }
560
-
561
- /*
562
- * Remove the options key that triggers the switch theme function
563
- */
564
- delete_option('gfpdfe_switch_theme');
565
- add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_theme_sync_success'));
566
-
567
- /*
568
- * Show success message to user
569
- */
570
- return true;
571
  }
572
 
573
  /*
574
  * Allows you to copy entire folder structures to new location
575
  */
576
-
577
  public static function pdf_extended_copy_directory( $source, $destination, $copy_base = true, $delete_destination = false )
578
  {
579
  global $wp_filesystem;
@@ -613,88 +532,4 @@ class GFPDF_InstallUpdater
613
  $wp_filesystem->copy( $source, $destination );
614
  }
615
  }
616
-
617
- private static function check_access_path($directory, $file_path, $directory_list)
618
- {
619
- global $wp_filesystem;
620
-
621
- foreach($directory_list as $name => $data)
622
- {
623
- /*
624
- * Check if one of the file/folder names matches what is in $file_path, make sure it is a directory and
625
- * the name has a value
626
- */
627
-
628
- $match = array_search($name, $file_path);
629
-
630
- if((strlen($name) > 0) && ($match !== false) && ((int) $data['isdir'] === 1 || $data['type'] === 'd') )
631
- {
632
-
633
- /*
634
- * We have a match but it could be fake
635
- * Look inside the target folder and see if the next folder in $file_path can be found
636
- * If it can we will assume it is the correct path
637
- */
638
- if(isset($file_path[$match+1]))
639
- {
640
-
641
- $next_match = $file_path[$match+1];
642
- $directory_list2 = $wp_filesystem->dirlist('/'.$name.'/');
643
-
644
- if(isset($directory_list2[$next_match]) && ((int) $directory_list2[$next_match]['isdir'] === 1 || $directory_list2[$next_match]['type'] === 'd'))
645
- {
646
- return self::merge_path($file_path, $match);
647
- }
648
-
649
- }
650
- else
651
- {
652
- return self::merge_path($file_path, $match);
653
- }
654
- }
655
- }
656
-
657
- return $directory;
658
- }
659
-
660
- /*
661
- * Merge the path array back together from the matched key
662
- */
663
- private static function merge_path($file_path, $key)
664
- {
665
- return '/' . implode('/', array_slice($file_path, $key)) . '/';
666
- }
667
-
668
- /*
669
- * Get the base directory for the current filemanagement type
670
- * In this case it is FTP but may be SSH
671
- */
672
- private static function get_base_directory()
673
- {
674
- global $wp_filesystem;
675
-
676
- /*
677
- * Assume FTP is rooted to the Wordpress install
678
- */
679
- $directory = '/';
680
-
681
- /*
682
- * Test if the FTP is below the Wordpress base by sniffing the base directory
683
- */
684
- $directory_list = $wp_filesystem->dirlist('/');
685
-
686
- /*
687
- * Use the ABSPATH to compare the directory structure
688
- */
689
- $file_path = array_filter(explode('/', ABSPATH ));
690
-
691
- /*
692
- * Rekey the array
693
- */
694
- $file_path = array_values($file_path);
695
-
696
- return self::check_access_path($directory, $file_path, $directory_list);
697
-
698
- }
699
-
700
  }
13
 
14
  class GFPDF_InstallUpdater
15
  {
16
+
17
+ public static function check_filesystem_api()
18
+ {
19
+ global $gfpdfe_data;
20
+ $access_type = get_filesystem_method();
21
+
22
+ $gfpdfe_data->automated = false;
23
+ if($access_type === 'direct')
24
+ {
25
+ $gfpdfe_data->automated = true;
26
+ }
27
+ }
28
 
29
+ /*
30
+ * Check if we can automatically deploy the software
31
+ * We use WP Filesystem API to initialise.
32
+ * Check if we have direct write control to the filesystem. If so, automatically deploy
33
+ * without asking the user. This will make upgrades much simplier.
34
+ */
35
+ public static function maybe_deploy()
36
+ {
37
+ global $gfpdfe_data;
38
+ /*
39
+ * Check if we have a 'direct' method, that the software isn't fully installed and we aren't trying to manually initialise
40
+ */
41
+
42
+ if($gfpdfe_data->automated === true && $gfpdfe_data->is_initialised === false && !rgpost('upgrade') && get_option('gfpdfe_automated_install') != 'installing')
43
+ {
44
+
45
+ /*
46
+ * Initialise all multisites if a super admin is logged in
47
+ */
48
+ if(is_multisite() && is_super_admin())
49
+ {
50
+ self::run_multisite_deployment();
51
+ }
52
+ else
53
+ {
54
+ if(self::do_deploy())
55
+ {
56
+ /*
57
+ * Output successfull automated installation message
58
+ */
59
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_success'));
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ /*
66
+ * Initialise all multsites in one fowl swoop
67
+ */
68
+ public static function run_multisite_deployment()
69
+ {
70
+ global $gfpdfe_data;
71
+
72
+ /* add additional check incase someone doesn't call this correctly */
73
+ if(!is_multisite())
74
+ return false;
75
+
76
+ /*
77
+ * Get multisites which aren't deleted
78
+ */
79
+ $sites = wp_get_sites(array('deleted' => 0));
80
+
81
+ if(sizeof($sites) > 0)
82
+ {
83
+
84
+ $success = true;
85
+ $problem = array();
86
+ foreach($sites as $site)
87
+ {
88
+ switch_to_blog( (int) $site['blog_id'] );
89
+
90
+ /*
91
+ * Test if the blog has gravity forms and PDF Extended active
92
+ * If so, we can initialise
93
+ */
94
+ $gravityforms = 'gravityforms/gravityforms.php'; /* have to hardcode the folder name is they don't set it in a constant or variable */
95
+ $pdfextended = GF_PDF_EXTENDED_PLUGIN_BASENAME; /* no need to hardcode the basename here */
96
+
97
+ if( (is_plugin_active_for_network($gravityforms) && is_plugin_active_for_network($pdfextended)) ||
98
+ (is_plugin_active($gravityforms) && is_plugin_active($pdfextended))
99
+ )
100
+ {
101
+ /* run our deployment and output any problems */
102
+ $deploy = self::do_deploy();
103
+ if($deploy === false)
104
+ {
105
+ $success = false;
106
+ $problem[] = $site;
107
+ }
108
+ else if ($deploy === 'false')
109
+ {
110
+ /*
111
+ * Asking for the access details so we can write to the server
112
+ * Exit early
113
+ */
114
+ return $deploy;
115
+ }
116
+ }
117
+ restore_current_blog();
118
+ }
119
+
120
+ if(!$success)
121
+ {
122
+ $gfpdfe_data->network_error = $problem;
123
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_network_failure'));
124
+ }
125
+ else
126
+ {
127
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_network_deploy_success'));
128
+ }
129
+ }
130
+ }
131
+
132
+ /*
133
+ * Used to automatically deploy the software
134
+ * Regular initialisation (via the settings page) will call pdf_extended_activate() directly.
135
+ */
136
+ private static function do_deploy()
137
+ {
138
+ update_option('gfpdfe_automated_install', 'installing');
139
+ return self::pdf_extended_activate();
140
+ }
141
+
142
+ /*
143
+ * Different filesystems (FTP/SSH) might have a different ABSPATH than the 'direct' method
144
+ * due to being rooted to a specific folder.
145
+ * The $wp_filesystem->abspath() corrects this behaviour.
146
+ */
147
+ private static function get_base_dir($path)
148
+ {
149
+ global $wp_filesystem;
150
+ return str_replace(ABSPATH, $wp_filesystem->abspath(), $path);
151
+ }
152
+
153
  /**
154
  * Install everything required
155
  */
158
  /*
159
  * Initialise the Wordpress Filesystem API
160
  */
161
+ if(PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy', 'overwrite'), 'pdf-extended-filesystem') === false)
162
  {
163
+ return 'false';
164
  }
165
 
166
  /*
169
  global $wp_filesystem, $gfpdfe_data;
170
 
171
  /*
172
+ * Set the correct paths
173
+ * FTP and SSH could be rooted to the wordpress base directory
174
+ * use $wp_filesystem->abspath(); function to fix any issues
175
  */
176
+ $directory = self::get_base_dir(PDF_PLUGIN_DIR);
177
+ $template_directory = self::get_base_dir(PDF_TEMPLATE_LOCATION);
178
+ $template_save_directory = self::get_base_dir(PDF_SAVE_LOCATION);
179
+ $template_font_directory = self::get_base_dir(PDF_FONT_LOCATION);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
 
181
  /**
182
  * If PDF_TEMPLATE_LOCATION already exists then we will remove the old template files so we can redeploy the new ones
183
  */
184
+ if($wp_filesystem->exists($template_directory) && isset($_POST['overwrite']))
 
185
  {
186
  /*
187
  * Create a backup folder and move all the files there
207
  $wp_filesystem->move($template_directory.$path_parts['basename'], $template_directory . $backup_folder . $path_parts['basename']);
208
  }
209
  }
210
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
  /* create new directory in active themes folder*/
213
  if(!$wp_filesystem->is_dir($template_directory))
214
  {
215
  if($wp_filesystem->mkdir($template_directory) === false)
216
  {
217
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
218
+ return false;
219
  }
220
  }
221
 
224
  /* create new directory in active themes folder*/
225
  if($wp_filesystem->mkdir($template_save_directory) === false)
226
  {
227
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
228
+ return false;
229
  }
230
  }
231
 
234
  /* create new directory in active themes folder*/
235
  if($wp_filesystem->mkdir($template_font_directory) === false)
236
  {
237
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
238
+ return false;
239
  }
240
  }
241
 
249
  /* copy template files to new directory */
250
  if(!$wp_filesystem->copy($directory .'initialisation/configuration.php.example', $template_directory.'configuration.php'))
251
  {
252
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
253
+ return false;
254
  }
255
  }
256
 
258
  {
259
  if(!$wp_filesystem->put_contents($template_save_directory.'.htaccess', 'deny from all'))
260
  {
261
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
262
+ return false;
263
  }
264
  }
265
 
266
  if(self::install_fonts($directory, $template_directory, $template_font_directory) !== true)
267
  {
268
+ return false;
269
  }
270
 
271
  /*
272
  * Update system to ensure everything is installed correctly.
273
  */
274
+ self::db_init();
275
+
276
+ return true;
277
+ }
278
+
279
+ /*
280
+ * Normalize the database options related to initialisation
281
+ */
282
+ public static function db_init()
283
+ {
284
+ global $gfpdfe_data;
285
 
286
  update_option('gf_pdf_extended_installed', 'installed');
 
 
287
  delete_option('gfpdfe_switch_theme');
288
+ delete_option('gfpdfe_automated_install');
289
+ GFPDF_Settings::$model->check_compatibility();
290
  }
291
 
292
  public static function initialise_fonts()
302
  /*
303
  * If we got here we should have $wp_filesystem available
304
  */
305
+ global $wp_filesystem, $gfpdfe_data;
306
 
307
  /*
308
  * We need to set up some filesystem compatibility checkes to work with the different server file management types
309
  * Most notably is the FTP options, but SSH may be effected too
310
  */
311
+ $directory = self::get_base_dir(PDF_PLUGIN_DIR);
312
+ $template_directory = self::get_base_dir(PDF_TEMPLATE_LOCATION);
313
+ $template_font_directory = self::get_base_dir(PDF_FONT_LOCATION);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
 
315
  if(self::install_fonts($directory, $template_directory, $template_font_directory) === true)
316
  {
317
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_install_success'));
318
  }
319
  return true;
320
  }
322
  private static function install_fonts($directory, $template_directory, $fonts_location)
323
  {
324
 
325
+ global $wp_filesystem, $gfpdfe_data;
326
  $write_to_file = '<?php
327
 
328
  if(!defined("PDF_EXTENDED_VERSION"))
352
  */
353
  if($wp_filesystem->copy($file, $directory . 'mPDF/ttfonts/' . $path_parts['basename']) === false)
354
  {
355
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_err'));
356
  return false;
357
  }
358
  }
373
  $wp_filesystem->delete($template_directory.'fonts/config.php');
374
  if($wp_filesystem->put_contents($template_directory.'fonts/config.php', $write_to_file) === false)
375
  {
376
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_config_err'));
377
  return false;
378
  }
379
 
380
  return true;
381
  }
382
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  /*
384
  * When switching themes copy over current active theme's PDF_EXTENDED_TEMPLATES (if it exists) to new theme folder
385
  */
397
  * Add the save folder name to the end of the paths
398
  */
399
  $old_pdf_path = $previous_theme_directory . '/' . PDF_SAVE_FOLDER;
400
+ $new_pdf_path = $current_theme_directory . '/' . PDF_SAVE_FOLDER;
401
 
402
  update_option('gfpdfe_switch_theme', array('old' => $old_pdf_path, 'new' => $new_pdf_path));
403
+
404
+ /* add action to check if we can auto sync */
405
+ /* filesystem API isn't avaliable during this action (too early) */
406
+ add_action('admin_init', array('GFPDF_InstallUpdater', 'maybe_autosync'));
407
+ }
408
+
409
+ public static function maybe_autosync()
410
+ {
411
+ global $gfpdfe_data;
412
+ self::check_filesystem_api();
413
+
414
+ if($gfpdfe_data->automated === true)
415
+ {
416
+ $theme_switch = get_option('gfpdfe_switch_theme');
417
+ self::do_theme_switch($theme_switch['old'], $theme_switch['new']);
418
+ }
419
  }
420
 
421
  /*
424
  */
425
  public static function check_theme_switch()
426
  {
427
+ global $gfpdfe_data;
428
+
429
  $theme_switch = get_option('gfpdfe_switch_theme');
430
+
431
  if(isset($theme_switch['old']) && isset($theme_switch['new']))
432
  {
433
  /*
434
  * Add admin notification hook to move the files
435
  */
436
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'do_theme_switch_notice'));
437
  return true;
438
  }
439
  return false;
440
  }
441
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
 
443
  /*
444
  * The after_switch_theme hook is too early in the initialisation to use request_filesystem_credentials()
451
  * It only allows post data to be added so we have to manually assign them
452
  */
453
  $_POST['previous_pdf_path'] = $previous_pdf_path;
454
+ $_POST['current_pdf_path'] = $current_pdf_path;
455
 
456
  /*
457
  * Initialise the Wordpress Filesystem API
458
  */
459
  if(PDF_Common::initialise_WP_filesystem_API(array('previous_pdf_path', 'current_pdf_path'), 'gfpdfe_sync_now') === false)
460
  {
461
+ return 'false';
462
  }
463
 
464
  /*
465
  * If we got here we should have $wp_filesystem available
466
  */
467
+ global $wp_filesystem, $gfpdfe_data;
468
+
469
  /*
470
+ * Convert paths for SSH/FTP users who are rooted to a directory along the server absolute path
471
+ */
472
+ $previous_pdf_path = self::get_base_dir($previous_pdf_path);
473
+ $current_pdf_path = self::get_base_dir($current_pdf_path);
474
+
475
+ if($wp_filesystem->is_dir($previous_pdf_path))
476
  {
477
+ self::pdf_extended_copy_directory( $previous_pdf_path, $current_pdf_path, true, true );
478
+
479
  /*
480
+ * Remove the options key that triggers the switch theme function
481
+ */
482
+ delete_option('gfpdfe_switch_theme');
483
+ add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_theme_sync_success'));
484
 
485
+ /*
486
+ * Show success message to user
487
+ */
488
+ return true;
489
+ }
490
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  }
492
 
493
  /*
494
  * Allows you to copy entire folder structures to new location
495
  */
 
496
  public static function pdf_extended_copy_directory( $source, $destination, $copy_base = true, $delete_destination = false )
497
  {
498
  global $wp_filesystem;
532
  $wp_filesystem->copy( $source, $destination );
533
  }
534
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  }
helper/notices.php ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Plugin: Gravity Forms PDF Extended
5
+ * File: notices.php
6
+ *
7
+ * This file handles the output of all notices to the admin area
8
+ */
9
+
10
+ class GFPDF_Notices
11
+ {
12
+ /*
13
+ * Admin notice template
14
+ */
15
+ private static function message($text, $type = 'updated')
16
+ {
17
+ ?>
18
+ <div id="message" class="<?php echo $type; ?>">
19
+ <p>
20
+ <?php echo $text; ?>
21
+ </p>
22
+ </div>
23
+ <?php
24
+ }
25
+
26
+ /*
27
+ * Output the update notice
28
+ */
29
+ private static function notice($text)
30
+ {
31
+ self::message($text);
32
+ }
33
+
34
+ /*
35
+ * Output the error notice
36
+ */
37
+ private static function error($text)
38
+ {
39
+ self::message($text, 'error');
40
+ }
41
+
42
+ private static function display_plugin_message($message, $is_error = false){
43
+
44
+ $style = $is_error ? 'style="background-color: #ffebe8;"' : "";
45
+
46
+ echo '</tr><tr class="plugin-update-tr"><td colspan="5" class="plugin-update"><div class="update-message" ' . $style . '>' . $message . '</div></td>';
47
+ }
48
+
49
+ private static function autoprefix()
50
+ {
51
+ global $gfpdfe_data;
52
+ if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
53
+ {
54
+ return sprintf(__('%sGravity Forms PDF Extended Automated Installer%s: ', 'pdfextended'), '<strong>', '</strong>');
55
+ }
56
+ return '';
57
+ }
58
+
59
+ private static function autosuffix()
60
+ {
61
+ global $gfpdfe_data;
62
+ if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
63
+ {
64
+ return sprintf(__(' %sGo to installer%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
65
+ }
66
+ return '';
67
+ }
68
+
69
+ public static function gf_pdf_font_install_success()
70
+ {
71
+ $prefix = self::autoprefix();
72
+ $suffix = self::autosuffix();
73
+
74
+ $msg = $prefix . __('The font files have been successfully installed. A font can be used by adding its file name (without .ttf and in lower case) in a CSS font-family declaration.', 'pdfextended') . $suffix;
75
+
76
+ self::notice($msg);
77
+
78
+ }
79
+
80
+ public static function gf_pdf_font_err()
81
+ {
82
+ $prefix = self::autoprefix();
83
+ $suffix = self::autosuffix();
84
+
85
+ $msg = $prefix . __('There was a problem installing the font files. Check the file permissions in the plugin folder and try again.', 'pdfextended') . $suffix;
86
+
87
+ self::error($msg);
88
+
89
+ }
90
+
91
+ public static function gf_pdf_font_config_err()
92
+ {
93
+ $prefix = self::autoprefix();
94
+ $suffix = self::autosuffix();
95
+
96
+ $msg = $prefix . __('Could not create font configuration file. Try initialise again.', 'pdfextended') . $suffix;
97
+
98
+ self::error($msg);
99
+
100
+ }
101
+
102
+ /**
103
+ * The software has detected a problem (no configuration.php file or no PDF_EXTENDED_TEMPLATE folder
104
+ * The user will need to reinitialise
105
+ */
106
+ public static function gf_pdf_problem_detected()
107
+ {
108
+ if( !rgpost('update') )
109
+ {
110
+ if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
111
+ {
112
+ $msg = __('Gravity Forms PDF Extended detected a configuration problem. Please reinitialise the plugin.', 'pdfextended');
113
+ }
114
+ else
115
+ {
116
+ $msg = sprintf(__('Gravity Forms PDF Extended detected a configuration problem. Please go to the %splugin\'s settings page%s to reinitialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
117
+ }
118
+
119
+ self::error($msg);
120
+ }
121
+ }
122
+
123
+ /*
124
+ * The $gfpdfe_data->allow_initilisation function is false
125
+ * meaning there is a server configuration problem detected
126
+ */
127
+ public static function gf_pdf_server_problem_detected()
128
+ {
129
+ if( !rgpost('update') )
130
+ {
131
+ if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
132
+ {
133
+ $msg = __('Gravity Forms PDF Extended detected a server compatibility problem which prevented the software from running. See the System Status section below for details.', 'pdfextended');
134
+ }
135
+ else
136
+ {
137
+ $msg = sprintf(__('Gravity Forms PDF Extended detected a server compatibility problem which prevented the software from running. Please go to the %splugin\'s settings page%s to view the issue.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
138
+ }
139
+
140
+ self::error($msg);
141
+ }
142
+ }
143
+
144
+ /**
145
+ * PDF Extended has been freshly installed
146
+ */
147
+ public static function gf_pdf_not_deployed_fresh()
148
+ {
149
+ if( !rgpost('update') )
150
+ {
151
+ if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
152
+ {
153
+ $msg = __('Welcome to Gravity Forms PDF Extended. Before you can use the plugin correctly you need to initilise it.', 'pdfextended');
154
+ }
155
+ else
156
+ {
157
+ $msg = sprintf(__('Welcome to Gravity Forms PDF Extended. Before you can use the plugin correctly you need to initilise it. Please go to the %splugin\'s settings page%s to initialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
158
+ }
159
+
160
+ self::notice($msg);
161
+ }
162
+ }
163
+
164
+ /**
165
+ * The Gravity Forms version isn't compatible. Prompt user to upgrade
166
+ */
167
+ public static function gf_pdf_not_supported()
168
+ {
169
+ $msg = sprintf(__('Gravity Forms PDF Extended only works with Gravity Forms version %s and higher. Please %supgrade your copy of Gravity Forms%s to use this plugin.', 'pdfextended'), GF_PDF_EXTENDED_SUPPORTED_VERSION, '<a href="https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154" target="ejejcsingle">', '</a>');
170
+
171
+ self::error($msg);
172
+ }
173
+
174
+
175
+ /**
176
+ * Cannot create new template folder in active theme directory
177
+ */
178
+ public static function gf_pdf_template_dir_err()
179
+ {
180
+ $prefix = self::autoprefix();
181
+ $suffix = self::autosuffix();
182
+
183
+ $msg = $prefix . __('We could not create a template folder in your active theme\'s directory. Please ensure your active theme directory is writable by your web server and try again.', 'pdfextended') . $suffix;
184
+
185
+ self::error($msg);
186
+
187
+
188
+ }
189
+
190
+ /**
191
+ * Cannot remove old default template files
192
+ */
193
+ public static function gf_pdf_deployment_unlink_error()
194
+ {
195
+ $prefix = self::autoprefix();
196
+ $suffix = self::autosuffix();
197
+
198
+ $msg = $prefix . sprintf(__('We could not remove the default template files from the Gravity Forms PDF Extended folder in your active theme\'s directory. Please ensure %s is wriable by your web server and try again.', 'pdfextended'), PDF_SAVE_LOCATION) . $suffix;
199
+
200
+ self::error($msg);
201
+ }
202
+
203
+ /**
204
+ * Cannot create new template folder in active theme directory
205
+ */
206
+ public static function gf_pdf_template_move_err()
207
+ {
208
+ $prefix = self::autoprefix();
209
+ $suffix = self::autosuffix();
210
+
211
+ $msg = $prefix . sprintf(__('We could not move the template files to the PDF_EXTENDED_TEMPLATES folder. Please ensure %s is wriable by your web server and try again.', 'pdfextended'), PDF_SAVE_LOCATION) . $suffix;
212
+
213
+ self::error($msg);
214
+ }
215
+
216
+ /*
217
+ * Prompt user to keep the plugin working
218
+ */
219
+ public static function do_theme_switch_notice()
220
+ {
221
+ /*
222
+ * Check we aren't in the middle of doing the sync
223
+ */
224
+ if(isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'gfpdfe_sync_now'))
225
+ {
226
+ return;
227
+ }
228
+
229
+ $msg = sprintf(__('Gravity Forms PDF Extended needs to keep your configuration and templates folder in sync with your current active theme. %sSync Now%s', 'pdfextended'), '<a href="'. wp_nonce_url(PDF_SETTINGS_URL, 'gfpdfe_sync_now') . '" class="button">', '</a>');
230
+
231
+ self::notice($msg);
232
+
233
+ }
234
+
235
+ public static function gf_pdf_theme_sync_success()
236
+ {
237
+ global $gfpdfe_data;
238
+ $prefix = ($gfpdfe_data->automated === true && !rgpost('upgrade')) ? sprintf(__('%sGravity Forms PDF Extended Automated Theme Sync%s: ', 'pdfextended'), '<strong>', '</strong>') : '';
239
+
240
+ $msg = $prefix . __('Your PDF configuration and template folder was successfully synced to your new theme.', 'pdfextended');
241
+
242
+ self::notice($msg);
243
+
244
+ }
245
+
246
+ public static function gf_pdf_network_deploy_success()
247
+ {
248
+ global $gfpdfe_data;
249
+
250
+ if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
251
+ {
252
+ $msg = __('Gravity Forms PDF Extended Auto Initialisation Complete across the entire network.', 'pdfextended');
253
+ }
254
+ else
255
+ {
256
+ $msg = __('Gravity Forms PDF Extended Initialisation Complete across the entire network.', 'pdfextended');
257
+ }
258
+
259
+ if($gfpdfe_data->fresh_install === true)
260
+ {
261
+ $msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
262
+ }
263
+ self::notice($msg);
264
+ }
265
+
266
+ public static function gf_pdf_auto_deploy_success()
267
+ {
268
+ global $gfpdfe_data;
269
+ $msg = __('Gravity Forms PDF Extended Auto Initialisation Complete.', 'pdfextended');
270
+
271
+ if($gfpdfe_data->fresh_install === true)
272
+ {
273
+ $msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
274
+ }
275
+ self::notice($msg);
276
+ }
277
+
278
+ public static function gf_pdf_auto_deploy_network_failure()
279
+ {
280
+ global $gfpdfe_data;
281
+
282
+ $prefix = self::autoprefix();
283
+ $errors = (array) $gfpdfe_data->network_error;
284
+
285
+ if(sizeof($errors) > 0)
286
+ {
287
+ $msg = $prefix . __('There was a network initialisation issue on the following sites;', 'pdfextended');
288
+ $msg .= '<ul>';
289
+
290
+ $base_site_url = site_url();
291
+ foreach($errors as $site)
292
+ {
293
+ switch_to_blog( (int) $site['blog_id'] );
294
+ $url = str_replace($base_site_url, site_url(), PDF_SETTINGS_URL );
295
+ $msg .= "<li><a href='$url'>{$site['domain']}{$site['path']}</a></li>";
296
+ restore_current_blog();
297
+ }
298
+ $msg .= '</ul>';
299
+
300
+ $msg .= __('Please try manually initialise the software', 'pdfextended');
301
+ }
302
+ else
303
+ {
304
+ $msg = $prefix . __('An unknown network initialisation error occured. Please try initialise again.', 'pdfextended');
305
+ }
306
+
307
+ self::error($msg);
308
+ }
309
+
310
+ public static function gf_pdf_deploy_success() {
311
+ $msg = __('You\'ve successfully initialised Gravity Forms PDF Extended.', 'pdfextended');
312
+
313
+ self::notice($msg);
314
+ }
315
+
316
+ public static function display_compatibility_error()
317
+ {
318
+ $message = sprintf(__("Gravity Forms " . GF_PDF_EXTENDED_SUPPORTED_VERSION . " is required to use this plugin. Activate it now or %spurchase it today!%s", 'pdfextended'), "<a href='https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154'>", "</a>");
319
+ self::display_plugin_message($message, true);
320
+ }
321
+
322
+ public static function display_wp_compatibility_error()
323
+ {
324
+ $message = __("Wordpress " . GF_PDF_EXTENDED_WP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
325
+ self::display_plugin_message($message, true);
326
+ }
327
+
328
+ /*public static function display_documentation_details()
329
+ {
330
+ $message = sprintf(__("Please review the %sGravity Forms PDF Extended documentation%s for comprehensive installation instructions.%s", 'pdfextended'), "<a href='http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/'>", "</a>", '</span>');
331
+ PDF_Common::display_plugin_message($message);
332
+ }*/
333
+
334
+ public static function display_pdf_compatibility_error()
335
+ {
336
+ $message = __("PHP " . GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
337
+ self::display_plugin_message($message, true);
338
+ }
339
+
340
+ public static function add_tooltips($tooltips)
341
+ {
342
+ $tooltips['pdf_overwrite'] = sprintf(__('If you reinitialise and enable this option %syou will overwrite%s the default and example template files in your active theme directory.', 'pdfextended'), '<strong>', '</strong>');
343
+
344
+ return $tooltips;
345
+ }
346
+ }
helper/pdf-common.php CHANGED
@@ -1,7 +1,16 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  class PDF_Common
4
  {
 
 
5
  public static function setup_ids()
6
  {
7
  global $form_id, $lead_id, $lead_ids;
@@ -18,28 +27,6 @@ class PDF_Common
18
  }
19
  }
20
 
21
- /*
22
- * Sniff the $_SERVER array for the real user IP address
23
- * Sometimes users are behind proxies, or different servers will set different keys
24
- * so we will look at the most common keys
25
- */
26
- public static function getRealIpAddr()
27
- {
28
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
29
- {
30
- $ip = $_SERVER['HTTP_CLIENT_IP'];
31
- }
32
- else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
33
- {
34
- $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
35
- }
36
- else
37
- {
38
- $ip = $_SERVER['REMOTE_ADDR'];
39
- }
40
- return $ip;
41
- }
42
-
43
  /*
44
  * We will use the output buffer to get the HTML template
45
  */
@@ -62,30 +49,6 @@ class PDF_Common
62
  public static function get_pdf_filename($form_id, $lead_id)
63
  {
64
  return "form-$form_id-entry-$lead_id.pdf";
65
- }
66
-
67
- /*
68
- * Check if mPDF folder exists.
69
- * If so, unzip and delete
70
- * Helps reduce the package file size
71
- */
72
- public static function unpack_mPDF()
73
- {
74
- $file = PDF_PLUGIN_DIR .'mPDF.zip';
75
- $path = pathinfo(realpath($file), PATHINFO_DIRNAME);
76
-
77
- if(file_exists($file))
78
- {
79
- /* unzip folder and delete */
80
- $zip = new ZipArchive;
81
- $res = $zip->open($file);
82
-
83
- if ($res === TRUE) {
84
- $zip->extractTo($path);
85
- $zip->close();
86
- unlink($file);
87
- }
88
- }
89
  }
90
 
91
  /*
@@ -167,37 +130,6 @@ class PDF_Common
167
  }
168
  }
169
 
170
- public static function display_compatibility_error()
171
- {
172
- $message = sprintf(__("Gravity Forms " . GF_PDF_EXTENDED_SUPPORTED_VERSION . " is required to use this plugin. Activate it now or %spurchase it today!%s", 'pdfextended'), "<a href='https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154'>", "</a>");
173
- PDF_Common::display_plugin_message($message, true);
174
- }
175
-
176
- public static function display_wp_compatibility_error()
177
- {
178
- $message = __("Wordpress " . GF_PDF_EXTENDED_WP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
179
- PDF_Common::display_plugin_message($message, true);
180
- }
181
-
182
- public static function display_documentation_details()
183
- {
184
- $message = sprintf(__("Please review the %sGravity Forms PDF Extended documentation%s for comprehensive installation instructions. %sUpgraded from v2.x.x? Review our migration guide%s.%s", 'pdfextended'), "<a href='http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/'>", "</a>", '<a style="color: red;" href="http://gravityformspdfextended.com/documentation-v3-x-x/v3-0-0-migration-guide/">', '</a>', '</span>');
185
- PDF_Common::display_plugin_message($message);
186
- }
187
-
188
- public static function display_pdf_compatibility_error()
189
- {
190
- $message = __("PHP " . GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
191
- PDF_Common::display_plugin_message($message, true);
192
- }
193
-
194
- public static function display_plugin_message($message, $is_error = false){
195
-
196
- $style = $is_error ? 'style="background-color: #ffebe8;"' : "";
197
-
198
- echo '</tr><tr class="plugin-update-tr"><td colspan="5" class="plugin-update"><div class="update-message" ' . $style . '>' . $message . '</div></td>';
199
- }
200
-
201
  /*
202
  * New to 3.0.2 we will use WP_Filesystem API to manipulate files instead of using in-built PHP functions
203
  * $post Array the post data to include in the request_filesystem_credntials API
@@ -219,13 +151,41 @@ class PDF_Common
219
  * Check if the credentials are no good and display an error
220
  */
221
  if ( ! WP_Filesystem($creds) ) {
222
- request_filesystem_credentials($url, '', true, false, $post_credentials);
223
  return false;
224
  }
225
 
226
  return true;
227
 
228
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
 
 
 
 
 
 
 
 
 
230
  }
231
 
1
  <?php
2
 
3
+ /**
4
+ * Plugin: Gravity Forms PDF Extended
5
+ * File: pdf-common.php
6
+ *
7
+ * This file holds a number of common functions used throughout the plugin
8
+ */
9
+
10
  class PDF_Common
11
  {
12
+
13
+
14
  public static function setup_ids()
15
  {
16
  global $form_id, $lead_id, $lead_ids;
27
  }
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  /*
31
  * We will use the output buffer to get the HTML template
32
  */
49
  public static function get_pdf_filename($form_id, $lead_id)
50
  {
51
  return "form-$form_id-entry-$lead_id.pdf";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  /*
130
  }
131
  }
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  /*
134
  * New to 3.0.2 we will use WP_Filesystem API to manipulate files instead of using in-built PHP functions
135
  * $post Array the post data to include in the request_filesystem_credntials API
151
  * Check if the credentials are no good and display an error
152
  */
153
  if ( ! WP_Filesystem($creds) ) {
154
+ request_filesystem_credentials($url, '', true, false, $post);
155
  return false;
156
  }
157
 
158
  return true;
159
 
160
  }
161
+
162
+ /*
163
+ * Check if we are on the PDF settings page
164
+ */
165
+ public static function is_settings()
166
+ {
167
+ if(isset($_GET['page']) && isset($_GET['subview']) && $_GET['page'] === 'gf_settings' && strtolower($_GET['subview']) === 'pdf')
168
+ {
169
+ return true;
170
+ }
171
+ return false;
172
+ }
173
+
174
+ public static function post($name)
175
+ {
176
+ if(isset($_POST[$name]))
177
+ return $_POST[$name];
178
+
179
+ return '';
180
+ }
181
 
182
+
183
+ public static function get($name)
184
+ {
185
+ if(isset($_GET[$name]))
186
+ return $_GET[$name];
187
+
188
+ return '';
189
+ }
190
  }
191
 
initialisation/.htaccess ADDED
@@ -0,0 +1 @@
 
1
+ deny from all
initialisation/templates/example-template.php CHANGED
@@ -78,7 +78,7 @@ $form = RGFormsModel::get_form_meta($form_id);
78
  </p>
79
 
80
  <p class="body_text">Now you've got an understanding on configuring the software, let's take a look at custom templates.
81
- To start with, you'll want to copy and rename one of the <em>example-</em> template files in your active theme's PDF_EXTENDED_TEMPLATES directory. <strong>Note: Some releases will push template updates for the default-, example- template files and template.css and these files are replaced (but backed up as of 3.4.0) when the software is reinitalised. Don’t modify them directly.</strong> </p>
82
 
83
  <p class="body_text">Once copied, go to your Wordpress Dashboard and navigate to Forms -> Entries and click the View PDF button on one of your entries. If you haven't assigned a custom template to the form, the default-template.php should open.
84
  If you change <em>default-template.php</em> in the URL to the new template you just made it will generate a PDF based off that file.</p>
78
  </p>
79
 
80
  <p class="body_text">Now you've got an understanding on configuring the software, let's take a look at custom templates.
81
+ To start with, you'll want to copy and rename one of the <em>example-</em> template files in your active theme's PDF_EXTENDED_TEMPLATES directory. </p>
82
 
83
  <p class="body_text">Once copied, go to your Wordpress Dashboard and navigate to Forms -> Entries and click the View PDF button on one of your entries. If you haven't assigned a custom template to the form, the default-template.php should open.
84
  If you change <em>default-template.php</em> in the URL to the new template you just made it will generate a PDF based off that file.</p>
languages/language.po ADDED
@@ -0,0 +1,921 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Gravity Forms PDF Extended\n"
4
+ "POT-Creation-Date: 2014-06-05 13:39+1000\n"
5
+ "PO-Revision-Date: 2014-06-05 13:39+1000\n"
6
+ "Last-Translator: Blue Liquid Designs <enquire@blueliquiddesigns.com.au>\n"
7
+ "Language-Team: <enquire@blueliquiddesigns.com.au>\n"
8
+ "Language: en\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.5\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: /\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: G:\\Blue Liquid Designs\\4) BLUE LIQUID DESIGNS\\19) "
17
+ "GRAVITY FORMS PDF EXTENDED\\2) WP SVN repository\\tags\\3.5.0\n"
18
+
19
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
20
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/api.php:142
21
+ msgid "Bad Request."
22
+ msgstr ""
23
+
24
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
25
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/api.php:150
26
+ #: repository\tags\3.5.0/helper/api.php:261
27
+ msgid "Unauthorized Access."
28
+ msgstr ""
29
+
30
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
31
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/api.php:172
32
+ msgid "Method not allowed."
33
+ msgstr ""
34
+
35
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
36
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/api.php:180
37
+ msgid "Internal API Error."
38
+ msgstr ""
39
+
40
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
41
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/api.php:188
42
+ msgid "API Unavailable."
43
+ msgstr ""
44
+
45
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
46
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:54
47
+ #, php-format
48
+ msgid "%sGravity Forms PDF Extended Automated Installer%s: "
49
+ msgstr ""
50
+
51
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
52
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:64
53
+ #, php-format
54
+ msgid " %sGo to installer%s."
55
+ msgstr ""
56
+
57
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
58
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:74
59
+ msgid ""
60
+ "The font files have been successfully installed. A font can be used by "
61
+ "adding its file name (without .ttf and in lower case) in a CSS font-family "
62
+ "declaration."
63
+ msgstr ""
64
+
65
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
66
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:85
67
+ msgid ""
68
+ "There was a problem installing the font files. Check the file permissions in "
69
+ "the plugin folder and try again."
70
+ msgstr ""
71
+
72
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
73
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:96
74
+ msgid "Could not create font configuration file. Try initialise again."
75
+ msgstr ""
76
+
77
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
78
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:112
79
+ msgid ""
80
+ "Gravity Forms PDF Extended detected a configuration problem. Please "
81
+ "reinitialise the plugin."
82
+ msgstr ""
83
+
84
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
85
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:116
86
+ #, php-format
87
+ msgid ""
88
+ "Gravity Forms PDF Extended detected a configuration problem. Please go to "
89
+ "the %splugin's settings page%s to reinitialise."
90
+ msgstr ""
91
+
92
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
93
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:133
94
+ msgid ""
95
+ "Gravity Forms PDF Extended detected a server compatibility problem which "
96
+ "prevented the software from running. See the System Status section below for "
97
+ "details."
98
+ msgstr ""
99
+
100
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
101
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:137
102
+ #, php-format
103
+ msgid ""
104
+ "Gravity Forms PDF Extended detected a server compatibility problem which "
105
+ "prevented the software from running. Please go to the %splugin's settings "
106
+ "page%s to view the issue."
107
+ msgstr ""
108
+
109
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
110
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:153
111
+ msgid ""
112
+ "Welcome to Gravity Forms PDF Extended. Before you can use the plugin "
113
+ "correctly you need to initilise it."
114
+ msgstr ""
115
+
116
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
117
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:157
118
+ #, php-format
119
+ msgid ""
120
+ "Welcome to Gravity Forms PDF Extended. Before you can use the plugin "
121
+ "correctly you need to initilise it. Please go to the %splugin's settings page"
122
+ "%s to initialise."
123
+ msgstr ""
124
+
125
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
126
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:169
127
+ #, php-format
128
+ msgid ""
129
+ "Gravity Forms PDF Extended only works with Gravity Forms version %s and "
130
+ "higher. Please %supgrade your copy of Gravity Forms%s to use this plugin."
131
+ msgstr ""
132
+
133
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
134
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:183
135
+ msgid ""
136
+ "We could not create a template folder in your active theme's directory. "
137
+ "Please ensure your active theme directory is writable by your web server and "
138
+ "try again."
139
+ msgstr ""
140
+
141
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
142
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:198
143
+ #, php-format
144
+ msgid ""
145
+ "We could not remove the default template files from the Gravity Forms PDF "
146
+ "Extended folder in your active theme's directory. Please ensure %s is "
147
+ "wriable by your web server and try again."
148
+ msgstr ""
149
+
150
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
151
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:211
152
+ #, php-format
153
+ msgid ""
154
+ "We could not move the template files to the PDF_EXTENDED_TEMPLATES folder. "
155
+ "Please ensure %s is wriable by your web server and try again."
156
+ msgstr ""
157
+
158
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
159
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:229
160
+ #, php-format
161
+ msgid ""
162
+ "Gravity Forms PDF Extended needs to keep your configuration and templates "
163
+ "folder in sync with your current active theme. %sSync Now%s"
164
+ msgstr ""
165
+
166
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
167
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:238
168
+ #, php-format
169
+ msgid "%sGravity Forms PDF Extended Automated Theme Sync%s: "
170
+ msgstr ""
171
+
172
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
173
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:240
174
+ msgid ""
175
+ "Your PDF configuration and template folder was successfully synced to your "
176
+ "new theme."
177
+ msgstr ""
178
+
179
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
180
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:252
181
+ msgid ""
182
+ "Gravity Forms PDF Extended Auto Initialisation Complete across the entire "
183
+ "network."
184
+ msgstr ""
185
+
186
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
187
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:256
188
+ msgid ""
189
+ "Gravity Forms PDF Extended Initialisation Complete across the entire network."
190
+ msgstr ""
191
+
192
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
193
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:261
194
+ #: repository\tags\3.5.0/helper/notices.php:273
195
+ #, php-format
196
+ msgid "%sLearn how to configuring the plugin%s."
197
+ msgstr ""
198
+
199
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
200
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:269
201
+ msgid "Gravity Forms PDF Extended Auto Initialisation Complete."
202
+ msgstr ""
203
+
204
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
205
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:287
206
+ msgid "There was a network initialisation issue on the following sites;"
207
+ msgstr ""
208
+
209
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
210
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:300
211
+ msgid "Please try manually initialise the software"
212
+ msgstr ""
213
+
214
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
215
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:304
216
+ msgid ""
217
+ "An unknown network initialisation error occured. Please try initialise again."
218
+ msgstr ""
219
+
220
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
221
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:311
222
+ msgid "You've successfully initialised Gravity Forms PDF Extended."
223
+ msgstr ""
224
+
225
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
226
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:318
227
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:34
228
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:41
229
+ msgid "Gravity Forms "
230
+ msgstr ""
231
+
232
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
233
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:324
234
+ msgid "Wordpress "
235
+ msgstr ""
236
+
237
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
238
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:336
239
+ msgid "PHP "
240
+ msgstr ""
241
+
242
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
243
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/notices.php:342
244
+ #, php-format
245
+ msgid ""
246
+ "If you reinitialise and enable this option %syou will overwrite%s the "
247
+ "default and example template files in your active theme directory."
248
+ msgstr ""
249
+
250
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
251
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:240
252
+ msgid "Order"
253
+ msgstr ""
254
+
255
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
256
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:251
257
+ msgid "Product"
258
+ msgstr ""
259
+
260
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
261
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:252
262
+ msgid "Qty"
263
+ msgstr ""
264
+
265
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
266
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:253
267
+ msgid "Unit Price"
268
+ msgstr ""
269
+
270
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
271
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:254
272
+ msgid "Price"
273
+ msgstr ""
274
+
275
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
276
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:317
277
+ msgid "Total"
278
+ msgstr ""
279
+
280
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
281
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:927
282
+ msgid ""
283
+ "Activate Gravity Forms Quiz Add On to see global quiz statistics for this "
284
+ "form"
285
+ msgstr ""
286
+
287
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
288
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:1340
289
+ #: repository\tags\3.5.0/helper/pdf-entry-detail.php:1705
290
+ msgid "Qty: "
291
+ msgstr ""
292
+
293
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
294
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:1340
295
+ #: repository\tags\3.5.0/helper/pdf-entry-detail.php:1705
296
+ msgid "Price: "
297
+ msgstr ""
298
+
299
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
300
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:1639
301
+ msgid "Title"
302
+ msgstr ""
303
+
304
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
305
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:1640
306
+ msgid "Caption"
307
+ msgstr ""
308
+
309
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
310
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:1641
311
+ msgid "Description"
312
+ msgstr ""
313
+
314
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
315
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/helper/pdf-entry-detail.php:1646
316
+ #: repository\tags\3.5.0/helper/pdf-entry-detail.php:1665
317
+ msgid "Click to view"
318
+ msgstr ""
319
+
320
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
321
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/pdf.php:127
322
+ #: repository\tags\3.5.0/model/pdf.php:142
323
+ msgid "View"
324
+ msgstr ""
325
+
326
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
327
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/pdf.php:128
328
+ #: repository\tags\3.5.0/model/pdf.php:143
329
+ msgid "Download"
330
+ msgstr ""
331
+
332
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
333
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/pdf.php:142
334
+ msgid "PDF"
335
+ msgstr ""
336
+
337
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
338
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/pdf.php:182
339
+ msgid "View PDFs"
340
+ msgstr ""
341
+
342
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
343
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/pdf.php:213
344
+ msgid "View PDF"
345
+ msgstr ""
346
+
347
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
348
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:355
349
+ msgid "Plugin not yet initialised"
350
+ msgstr ""
351
+
352
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
353
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:410
354
+ msgid ""
355
+ "There was a problem with your submission. Please reload the page and try "
356
+ "again"
357
+ msgstr ""
358
+
359
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
360
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:427
361
+ msgid "Please enter a valid email address"
362
+ msgstr ""
363
+
364
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
365
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:430
366
+ msgid "Problem"
367
+ msgstr ""
368
+
369
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
370
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:430
371
+ msgid "Question"
372
+ msgstr ""
373
+
374
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
375
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:430
376
+ msgid "Suggestion"
377
+ msgstr ""
378
+
379
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
380
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:434
381
+ msgid "Please select a valid support type."
382
+ msgstr ""
383
+
384
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
385
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:439
386
+ msgid ""
387
+ "Please enter information about your support query so we can aid you more "
388
+ "easily."
389
+ msgstr ""
390
+
391
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
392
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:444
393
+ msgid ""
394
+ "There is a problem with your support request. Please correct the marked "
395
+ "issues above."
396
+ msgstr ""
397
+
398
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
399
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:454
400
+ msgid ""
401
+ "Thank you for your support request. We'll respond to your request in the "
402
+ "next 24-48 hours."
403
+ msgstr ""
404
+
405
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
406
+ #: EXTENDED\2) WP SVN repository\tags\3.5.0/model/settings.php:512
407
+ msgid "Support request received. We will responed in 24 to 48 hours."
408
+ msgstr ""
409
+
410
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
411
+ #: EXTENDED\2) WP SVN
412
+ #: repository\tags\3.5.0/view/templates/settings/changelog.php:19
413
+ msgid "Changelog"
414
+ msgstr ""
415
+
416
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
417
+ #: EXTENDED\2) WP SVN
418
+ #: repository\tags\3.5.0/view/templates/settings/initialisation-tab.php:41
419
+ msgid "Gravity Forms PDF Extended"
420
+ msgstr ""
421
+
422
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
423
+ #: EXTENDED\2) WP SVN
424
+ #: repository\tags\3.5.0/view/templates/settings/initialisation-tab.php:42
425
+ msgid ""
426
+ "Your web server isn't compatible with Gravity Forms PDF Extended. Please see "
427
+ "the problem areas below."
428
+ msgstr ""
429
+
430
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
431
+ #: EXTENDED\2) WP SVN
432
+ #: repository\tags\3.5.0/view/templates/settings/initialisation-tab.php:52
433
+ msgid "Can't Resolve the Issue?"
434
+ msgstr ""
435
+
436
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
437
+ #: EXTENDED\2) WP SVN
438
+ #: repository\tags\3.5.0/view/templates/settings/initialisation-tab.php:53
439
+ #, php-format
440
+ msgid ""
441
+ "Does Gravity Forms PDF Extended detect a problem that your web host won't "
442
+ "fix? %sWe recommend you move to a quality web hosting service like WP Engine"
443
+ "%s which runs our software straight out of the box."
444
+ msgstr ""
445
+
446
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
447
+ #: EXTENDED\2) WP SVN
448
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:19
449
+ msgid "Welcome to Gravity Forms PDF Extended"
450
+ msgstr ""
451
+
452
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
453
+ #: EXTENDED\2) WP SVN
454
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:19
455
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:66
456
+ msgid "Initialise Plugin"
457
+ msgstr ""
458
+
459
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
460
+ #: EXTENDED\2) WP SVN
461
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:23
462
+ msgid ""
463
+ "The plugin has successfully installed and is ready to start automating your "
464
+ "documents."
465
+ msgstr ""
466
+
467
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
468
+ #: EXTENDED\2) WP SVN
469
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:25
470
+ msgid "What's next?"
471
+ msgstr ""
472
+
473
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
474
+ #: EXTENDED\2) WP SVN
475
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:26
476
+ msgid ""
477
+ "The next step is to correctly configured the plugin so that you can generate "
478
+ "PDF documents."
479
+ msgstr ""
480
+
481
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
482
+ #: EXTENDED\2) WP SVN
483
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:27
484
+ msgid ""
485
+ "To help you get started, we've put together a five-part video series with "
486
+ "the most common plugin configurations."
487
+ msgstr ""
488
+
489
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
490
+ #: EXTENDED\2) WP SVN
491
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:29
492
+ msgid "The Basics: Only Download PDF through the Admin Area"
493
+ msgstr ""
494
+
495
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
496
+ #: EXTENDED\2) WP SVN
497
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:30
498
+ msgid "The Email: Send Completed PDF via Email"
499
+ msgstr ""
500
+
501
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
502
+ #: EXTENDED\2) WP SVN
503
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:31
504
+ msgid ""
505
+ "The Download: User Downloads PDF after Submitting Form (using a link or auto "
506
+ "redirecting)"
507
+ msgstr ""
508
+
509
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
510
+ #: EXTENDED\2) WP SVN
511
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:32
512
+ msgid "The Email Advanced: Manually Review User Submission before Emailing PDF"
513
+ msgstr ""
514
+
515
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
516
+ #: EXTENDED\2) WP SVN
517
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:33
518
+ msgid "The Payment: Send PDF after Capturing Payment using Paypal Standard"
519
+ msgstr ""
520
+
521
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
522
+ #: EXTENDED\2) WP SVN
523
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:36
524
+ #, php-format
525
+ msgid ""
526
+ "If you know little about PHP we recommend starting with %sPart 1:The Basics"
527
+ "%s and then watching the tutorial you’re interested in. It will give you the "
528
+ "foundational skills you need to configure the software."
529
+ msgstr ""
530
+
531
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
532
+ #: EXTENDED\2) WP SVN
533
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:38
534
+ msgid "Custom Templates"
535
+ msgstr ""
536
+
537
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
538
+ #: EXTENDED\2) WP SVN
539
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:39
540
+ #, php-format
541
+ msgid ""
542
+ "Creating a custom template gives you ultimate control of the look and feel "
543
+ "of your documents using only HTML and CSS. %sWe recommend you review our "
544
+ "online documentation%s to create and customise your template files."
545
+ msgstr ""
546
+
547
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
548
+ #: EXTENDED\2) WP SVN
549
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:45
550
+ msgid ""
551
+ "To complete the installation, Gravity Forms PDF Extended needs to be "
552
+ "initialised."
553
+ msgstr ""
554
+
555
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
556
+ #: EXTENDED\2) WP SVN
557
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:47
558
+ msgid "Does does initialisation do?"
559
+ msgstr ""
560
+
561
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
562
+ #: EXTENDED\2) WP SVN
563
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:50
564
+ msgid "Install the template files"
565
+ msgstr ""
566
+
567
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
568
+ #: EXTENDED\2) WP SVN
569
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:50
570
+ msgid ""
571
+ "We create a folder called PDF_EXTENDED_TEMPLATE in your active theme "
572
+ "directory and move over all the templates and configuration files. This "
573
+ "folder is where you'll look to configure the software and create your PDF "
574
+ "templates."
575
+ msgstr ""
576
+
577
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
578
+ #: EXTENDED\2) WP SVN
579
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:62
580
+ msgid "Have a problem with the software?"
581
+ msgstr ""
582
+
583
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
584
+ #: EXTENDED\2) WP SVN
585
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:63
586
+ msgid ""
587
+ "Did you switch themes and something went wrong syncing the template folder? "
588
+ "Try reinitialise the software."
589
+ msgstr ""
590
+
591
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
592
+ #: EXTENDED\2) WP SVN
593
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:66
594
+ msgid "Reinitialise Plugin"
595
+ msgstr ""
596
+
597
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
598
+ #: EXTENDED\2) WP SVN
599
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:68
600
+ msgid "Reinstall Default and Example Templates"
601
+ msgstr ""
602
+
603
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
604
+ #: EXTENDED\2) WP SVN
605
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:74
606
+ msgid "Install a new font?"
607
+ msgstr ""
608
+
609
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
610
+ #: EXTENDED\2) WP SVN
611
+ #: repository\tags\3.5.0/view/templates/settings/initialisation.php:75
612
+ #, php-format
613
+ msgid ""
614
+ "Do you want to use a custom font in your template? %sSee our documentation "
615
+ "on how to correctly install and use a custom font%s before initialising "
616
+ "below."
617
+ msgstr ""
618
+
619
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
620
+ #: EXTENDED\2) WP SVN
621
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:26
622
+ msgid ""
623
+ "Gravity Forms PDF Extended's support hours are from 9:00am-5:00pm Monday to "
624
+ "Friday, Sydney Australia time."
625
+ msgstr ""
626
+
627
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
628
+ #: EXTENDED\2) WP SVN
629
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:29
630
+ #, php-format
631
+ msgid "The current time in Sydney Australia is %s."
632
+ msgstr ""
633
+
634
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
635
+ #: EXTENDED\2) WP SVN
636
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:55
637
+ msgid "Enter the email address you want us to contact you on."
638
+ msgstr ""
639
+
640
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
641
+ #: EXTENDED\2) WP SVN
642
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:56
643
+ msgid ""
644
+ "Note: To ensure the best support possible, please use the above email to "
645
+ "respond to all support communications."
646
+ msgstr ""
647
+
648
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
649
+ #: EXTENDED\2) WP SVN
650
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:92
651
+ msgid "Enter as much detail about the problem as you can."
652
+ msgstr ""
653
+
654
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
655
+ #: EXTENDED\2) WP SVN
656
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:93
657
+ msgid "Please enter as much detail about the problem as you can."
658
+ msgstr ""
659
+
660
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
661
+ #: EXTENDED\2) WP SVN
662
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:94
663
+ msgid "Note: Our support representatives can only communicate in English."
664
+ msgstr ""
665
+
666
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
667
+ #: EXTENDED\2) WP SVN
668
+ #: repository\tags\3.5.0/view/templates/settings/support-form.php:97
669
+ msgid "Request Support"
670
+ msgstr ""
671
+
672
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
673
+ #: EXTENDED\2) WP SVN
674
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:20
675
+ msgid "Frequently Asked Questions"
676
+ msgstr ""
677
+
678
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
679
+ #: EXTENDED\2) WP SVN
680
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:22
681
+ msgid "Can I exclude a field from showing up in the PDF?"
682
+ msgstr ""
683
+
684
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
685
+ #: EXTENDED\2) WP SVN
686
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:23
687
+ msgid ""
688
+ "I want to have multiple PDF template files generated on one form. How do I "
689
+ "do it?"
690
+ msgstr ""
691
+
692
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
693
+ #: EXTENDED\2) WP SVN
694
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:24
695
+ msgid "I want users to be able to download the PDF from the server."
696
+ msgstr ""
697
+
698
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
699
+ #: EXTENDED\2) WP SVN
700
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:25
701
+ msgid "How do I change the PDF size or create a landscape PDF?"
702
+ msgstr ""
703
+
704
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
705
+ #: EXTENDED\2) WP SVN
706
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:26
707
+ msgid ""
708
+ "I am created a custom template. How do I know the names of my fields in the "
709
+ "$form_data array?"
710
+ msgstr ""
711
+
712
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
713
+ #: EXTENDED\2) WP SVN
714
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:27
715
+ msgid "How large a PDF are you able to create/process?"
716
+ msgstr ""
717
+
718
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
719
+ #: EXTENDED\2) WP SVN
720
+ #: repository\tags\3.5.0/view/templates/settings/support-sidebar.php:30
721
+ #, php-format
722
+ msgid ""
723
+ "Got a question that isn't answered above? %sHead to our support forum%s and "
724
+ "let us know."
725
+ msgstr ""
726
+
727
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
728
+ #: EXTENDED\2) WP SVN
729
+ #: repository\tags\3.5.0/view/templates/settings/support.php:20
730
+ msgid "Support"
731
+ msgstr ""
732
+
733
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
734
+ #: EXTENDED\2) WP SVN
735
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:19
736
+ msgid "System Status"
737
+ msgstr ""
738
+
739
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
740
+ #: EXTENDED\2) WP SVN
741
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:22
742
+ msgid "Wordpress Version"
743
+ msgstr ""
744
+
745
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
746
+ #: EXTENDED\2) WP SVN
747
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:25
748
+ msgid "Wordpress Version "
749
+ msgstr ""
750
+
751
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
752
+ #: EXTENDED\2) WP SVN
753
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:30
754
+ msgid "Gravity Forms"
755
+ msgstr ""
756
+
757
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
758
+ #: EXTENDED\2) WP SVN
759
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:32
760
+ msgid "Not Installed"
761
+ msgstr ""
762
+
763
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
764
+ #: EXTENDED\2) WP SVN
765
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:47
766
+ msgid "PHP Version"
767
+ msgstr ""
768
+
769
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
770
+ #: EXTENDED\2) WP SVN
771
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:50
772
+ msgid "PHP Version "
773
+ msgstr ""
774
+
775
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
776
+ #: EXTENDED\2) WP SVN
777
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:54
778
+ msgid "MB String"
779
+ msgstr ""
780
+
781
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
782
+ #: EXTENDED\2) WP SVN
783
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:54
784
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:62
785
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:94
786
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:101
787
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:110
788
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:117
789
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:124
790
+ msgid "Yes"
791
+ msgstr ""
792
+
793
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
794
+ #: EXTENDED\2) WP SVN
795
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:54
796
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:62
797
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:94
798
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:101
799
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:110
800
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:117
801
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:124
802
+ msgid "No"
803
+ msgstr ""
804
+
805
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
806
+ #: EXTENDED\2) WP SVN
807
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:58
808
+ msgid ""
809
+ "The PHP extension MB String and MB String Regex functions are required to "
810
+ "use this plugin. Contact your web host to have it enabled."
811
+ msgstr ""
812
+
813
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
814
+ #: EXTENDED\2) WP SVN
815
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:62
816
+ msgid "GD Library"
817
+ msgstr ""
818
+
819
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
820
+ #: EXTENDED\2) WP SVN
821
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:66
822
+ msgid ""
823
+ "The PHP extension GD Library is required to use this plugin. Contact your "
824
+ "web host to have it enabled."
825
+ msgstr ""
826
+
827
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
828
+ #: EXTENDED\2) WP SVN
829
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:84
830
+ msgid "Available RAM"
831
+ msgstr ""
832
+
833
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
834
+ #: EXTENDED\2) WP SVN
835
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:87
836
+ #, php-format
837
+ msgid ""
838
+ "We recommend you have 128MB of available RAM to run this plugin. The minimum "
839
+ "system requirement is 64MB. %sNot sure what this means? Contact your web "
840
+ "host and ask them to fix the issue. %sNote: If you run less than 128MB, you "
841
+ "risk PHP suffering a fatal error which will stop your website from running "
842
+ "on Gravity Form pages."
843
+ msgstr ""
844
+
845
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
846
+ #: EXTENDED\2) WP SVN
847
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:94
848
+ msgid "Plugin Directory Writable?"
849
+ msgstr ""
850
+
851
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
852
+ #: EXTENDED\2) WP SVN
853
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:97
854
+ #, php-format
855
+ msgid ""
856
+ "The plugin folder is not writable by your web server. Check the directory "
857
+ "\"%s\" is writable by your web server otherwise we will attempt to use the "
858
+ "FTP installer to initialise."
859
+ msgstr ""
860
+
861
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
862
+ #: EXTENDED\2) WP SVN
863
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:101
864
+ msgid "Theme Directory Writable?"
865
+ msgstr ""
866
+
867
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
868
+ #: EXTENDED\2) WP SVN
869
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:104
870
+ #, php-format
871
+ msgid ""
872
+ "Your active theme folder is not writable by your web server. Check that \"%s"
873
+ "\" is writable by your web server otherwise we will attempt to use the FTP "
874
+ "installer to initialise."
875
+ msgstr ""
876
+
877
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
878
+ #: EXTENDED\2) WP SVN
879
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:110
880
+ msgid "PDF Output Directory Writable?"
881
+ msgstr ""
882
+
883
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
884
+ #: EXTENDED\2) WP SVN
885
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:113
886
+ #, php-format
887
+ msgid ""
888
+ "The plugin's output folder is not writable by your web server. PDFs will not "
889
+ "be attached to notifications until this problem is fixed. Check that \"%s\" "
890
+ "is writable by your web server."
891
+ msgstr ""
892
+
893
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
894
+ #: EXTENDED\2) WP SVN
895
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:117
896
+ msgid "PDF Font Directory Writable?"
897
+ msgstr ""
898
+
899
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
900
+ #: EXTENDED\2) WP SVN
901
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:120
902
+ #, php-format
903
+ msgid ""
904
+ "The plugin's font folder is not writable by your web server. Check that \"%s"
905
+ "\" is writable by your web server otherwise we will attempt to use the FTP "
906
+ "installer to initialise."
907
+ msgstr ""
908
+
909
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
910
+ #: EXTENDED\2) WP SVN
911
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:124
912
+ msgid "mPDF Temporary Directory Writable?"
913
+ msgstr ""
914
+
915
+ #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
916
+ #: EXTENDED\2) WP SVN
917
+ #: repository\tags\3.5.0/view/templates/settings/system-status.php:127
918
+ msgid ""
919
+ "mPDF temporary directory not writable (mPDF/tmp/). Memory and image "
920
+ "processing time will increase."
921
+ msgstr ""
mPDF.zip DELETED
Binary file
mPDF/CHANGELOG.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ================
2
+ mPDF 5.7.1
3
+ 1/09/2013
4
+ ================
5
+ 1) FILES: mpdf.php
6
+ Bug fix; Dollar sign enclosed by <pre> tag causing error.
7
+ Test e.g.: <pre>Test $1.00 Test</pre> <pre>Test $2.00 Test</pre> <pre>Test $3.00 Test</pre> <pre>Test $4.00 Test</pre>
8
+ -----------------------------
9
+ 2) FILES: includes/functions.php AND mpdf.php
10
+ Changes to preg_replace with /e modifier to use preg_replace_callback
11
+ (/e depracated from PHP 5.5)
12
+ -----------------------------
13
+ 3) FILES: classes/barcode.php
14
+ Small change to function barcode_c128() which allows ASCII 0 - 31 to be used in C128A e.g. chr(13) in:
15
+ <barcode code="5432&#013;1068" type="C128A" />
16
+ -----------------------------
17
+ 4) FILES: mpdf.php
18
+ Using $use_kwt ("keep-[heading]-with-table") if <h4></h4> before table is on 2 lines and pagebreak occurs after first line
19
+ the first line is displayed at the bottom of the 2nd page.
20
+ Edited so that $use_kwt only works if the HEADING is only one line. Else ignores (but prints correctly)
21
+ -----------------------------
22
+ 5) FILES: mpdf.php
23
+ Clearing old temporary files from _MPDF_TEMP_PATH will now ignore "hidden" files e.g. starting with a "." .htaccess, .gitignore etc.
24
+ and also leave dummy.txt alone
25
+ -----------------------------
mPDF/CREDITS.txt ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ /*******************************************************************************
4
+ * Software: FPDF *
5
+ * Version: 1.53 *
6
+ * Date: 2004-12-31 *
7
+ * Author: Olivier PLATHEY *
8
+ * License: Freeware *
9
+ * *
10
+ * You may use and modify this software as you wish. *
11
+ *******************************************************************************/
12
+
13
+ /*******************************************************************************
14
+ * HTML2FPDF is a php script to read a HTML text and generate a PDF file. *
15
+ * Copyright (C) 2004-2005 Renato Coelho *
16
+ * *
17
+ * html2fpdf.php, htmltoolkit.php *
18
+ *******************************************************************************/
19
+
20
+ CREDITS From HTML2FPDF:
21
+
22
+ -Olivier Plathey for the fpdf.php class [http://www.fpdf.org]
23
+ -Damon Kohler for the Flowing Block script [mailto:damonkohler@yahoo.com]
24
+ -Cl�ment Lavoillotte for HTML-oriented FPDF idea
25
+ -Yamasoft for the gif.php class [http://www.yamasoft.com/]
26
+ -J�r�me Fenal for the _parsegif() function
27
+ -"VIETCOM" for the PDFTable code [http://www.freepgs.com/vietcom/tool/pdftable/] [mailto:vncommando@yahoo.com]
28
+ -Yukihiro O. for the SetDash() function [mailto:yukihiro_o@infoseek.jp]
29
+ -Ron Korving for the WordWrap() function
30
+ -Michel Poulain for the DisplayPreferences() function
31
+ -Patrick Benny for the MultiCellBlt() function idea [no longer in use]
32
+ -Seb for the _SetTextRendering() and SetTextOutline() functions [mailto:captainseb@wanadoo.fr]
33
+ -MorphSoft for the colornames list idea
34
+ -W3SCHOOLS for HTML-related reference info [http://www.w3schools.com/]
35
+
36
+
37
+
38
+ /****************************************************************************
39
+ * Software: FPDF_Protection *
40
+ * Version: 1.02 *
41
+ * Date: 2005/05/08 *
42
+ * Author: Klemen VODOPIVEC *
43
+ * License: Freeware *
44
+ * *
45
+ * You may use and modify this software as you wish as stated in original *
46
+ * FPDF package. *
47
+ ****************************************************************************/
48
+
49
+ /****************************************************************************
50
+ // FPDI - Version 1.2
51
+ //
52
+ // Copyright 2004-2007 Setasign - Jan Slabon
53
+ //
54
+ // Licensed under the Apache License, Version 2.0 (the "License");
55
+ // you may not use this file except in compliance with the License.
56
+ // You may obtain a copy of the License at
57
+ //
58
+ // http://www.apache.org/licenses/LICENSE-2.0
59
+ //
60
+ // Unless required by applicable law or agreed to in writing, software
61
+ // distributed under the License is distributed on an "AS IS" BASIS,
62
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
63
+ // See the License for the specific language governing permissions and
64
+ // limitations under the License.
65
+ ****************************************************************************/
66
+
67
+ /****************************************************************************
68
+ * @copyright Khaled Al-Shamaa 2008
69
+ * @link http://www.ar-php.org
70
+ * @author Khaled Al-Shamaa <khaled@ar-php.org>
71
+ * @desc Set of PHP5 / UTF-8 Classes developed to enhance Arabic web
72
+ * applications by providing set of tools includes stem-based searching,
73
+ * translitiration, soundex, Hijri calendar, charset detection and
74
+ * converter, spell numbers, keyboard language, Muslim prayer time,
75
+ * auto-summarization, and more...
76
+ * @package Arabic
77
+ *
78
+ * @version 1.8 released in Feb 15, 2009
79
+ *
80
+ * @license LGPL
81
+ ****************************************************************************/
82
+
83
+
84
+ This library is free software; you can redistribute it and/or
85
+ modify it under the terms of the GNU Lesser General Public
86
+ License as published by the Free Software Foundation;
87
+ This library is distributed in the hope that it will be useful,
88
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
89
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
90
+ Lesser General Public License for more details.
91
+ [http://www.opensource.org/licenses/lgpl-license.php]
92
+
mPDF/FONT INFO.txt ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ =================
3
+ Open Source Fonts
4
+ =================
5
+ mPDF should be able to read most TrueType Unicode font files with a .ttf extension
6
+ Truetype fonts with .ttf or .otf extension and .ttc TrueType collections should also work OK.
7
+
8
+ You will probably therefore have access to any number of fonts, but here are some useful sources for
9
+ open-source or free-use fonts. Many of these were included with earlier versions of mPDF:
10
+
11
+ General collections
12
+ -------------------
13
+ - DejaVu font collection from: http://dejavu-fonts.org/wiki/Main_Page (included in the release)
14
+ - GNU FreeFont from: http://www.gnu.org/software/freefont/
15
+ - Linux Libertine from: http://www.linuxlibertine.org (use the .ttf files - not the .otf)
16
+ - Liberation Fonts from: https://fedorahosted.org/liberation-fonts/ or directly https://fedorahosted.org/releases/l/i/liberation-fonts/
17
+
18
+ Thai fonts
19
+ ----------
20
+ - Collection of Thai fonts from: ftp://linux.thai.net/pub/thailinux/software/thai-ttf/
21
+
22
+
23
+ OCR-B
24
+ -----
25
+ OCRB (ocrb10) font: http://ansuz.sooke.bc.ca/software/ocrb.php
26
+ Useful for barcodes (included in the release)
27
+
28
+ Pan-Unicode fonts (fonts containing most characters defined in Unicode)
29
+ -----------------------------------------------------------------------
30
+ - BitStream Cyberbit from: http://aol-4.vo.llnwd.net/pub/communicator/extras/fonts/windows/
31
+ Cyberbit.ZIP (or just Google it)
32
+ (NB if run with $debug_fonts gives warning of invalid table checksum - just turn it off!)
33
+ - Code2000 (NB shareware) from: http://www.code2000.net/code2000_page.htm
34
+ - Quivira from: http://www.quivira-font.com/ (combining diacritics are not placed correctly, but has a very full set of glyphs)
35
+
36
+
37
+ CJK (Chinese-Japanese-Korean)
38
+ -----------------------------
39
+ HanNomA and B from: http://vietunicode.sourceforge.net/fonts/fonts_hannom.html
40
+ unBatang_0613 from: http://people.ktug.or.kr/~nomos/mine/UnBatang_0613.ttf
41
+ Sun-ExtA and Sun-ExtB from: http://www.alanwood.net/unicode/fonts-east-asian.html
42
+ (http://www.alanwood.net/downloads/index.html)
43
+ Fonts which contain both Unicode BMP and SIP (Supplementary Ideographic Plane)
44
+ characters in one file e.g. "AR PL UMing" and "AR PL UKai"
45
+ from: http://www.freedesktop.org
46
+ http://www.freedesktop.org/wiki/Software/CJKUnifonts/Download
47
+ [MS Windows fonts such as MS Mincho and MingLiU also work]
48
+ Japanese IPA fonts: http://ossipedia.ipa.go.jp/ipafont/index.html
49
+
50
+ Arabic/Eastern fonts
51
+ --------------------
52
+ - XW Zar fonts can be downloaded from: http://www.redlers.com/downloadfont.html
53
+ (2 of these fonts are included in the release)
54
+ (original site in Farsi: http://wiki.irmug.org/index.php/XWZar)
55
+ - See below for more details and font names of the fonts used in mPDF 4.x
56
+
57
+
58
+ Other sources
59
+ -------------
60
+ http://www.unifont.org/fontguide/
61
+ http://www.alanwood.net/unicode/fonts.html
62
+ http://cooltext.com (e.g. http://cooltext.com/Fonts-Unicode+Arabic)
63
+ ApparatusSIL, DoulosSIL, Padauk from SIL: http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&cat_id=FontDownloads
64
+ DaiBanna (Tai Le)
65
+
66
+ Mediaeval & Ancient Scripts
67
+ ---------------------------
68
+ Junicode: http://junicode.sourceforge.net/
69
+ Cardo: http://scholarsfonts.net/cardofnt.html
70
+
71
+ Syriac fonts
72
+ ------------
73
+ http://www.bethmardutho.org/meltho/
74
+
75
+
76
+
77
+
78
+ ============
79
+ ARABIC FONTS
80
+ ============
81
+ You can use any appropriate Unicode-encoded .ttf or .ttc font file for arabic text, but
82
+ the font file must include the Arabic Presentation Forms-B (U+FE70�U+FEFF).
83
+ 2 of the XW Zar fonts are included in the release.
84
+
85
+
86
+
87
+ ===========
88
+ INDIC FONTS
89
+ ===========
90
+ Indic scripts e.g. Hindi, Bengali etc. use conjuct forms which have no Unicode assignment. You
91
+ cannot therefore use any standard .ttf font files with mPDF.
92
+
93
+ A set of fonts has been adapted to use specifically with mPDF. They are based on a set of fonts from:
94
+
95
+ http://www.cdacmumbai.in/projects/indix/e_introduction.shtml
96
+
97
+ NB These fonts are released under GNU GPL Version 2 license
98
+
99
+ You need these adapted fonts (ind_bn_1_001.ttf etc.) to work with mPDF, as the glyphs have been
100
+ assigned to Unicode values in the Private Use area (U+E000 ->). These are included in the
101
+ mPDF download.
102
+
103
+
104
+
105
+ Users of mPDF v4.x
106
+ ------------------
107
+ The original indic font files do not contain a full set of even basic ASCII
108
+ characters. The fonts supplied have been "fixed" to include those extra
109
+ characters. This now works whether the font is subset or not.
110
+
111
+
112
+
113
+ =========
114
+ CJK Fonts
115
+ =========
116
+
117
+
118
+ Supplemental Ideographic Plane
119
+ ==============================
120
+ SIP = Supplemental Ideographic Plane ( = Plane 2) = U+20000 - U+2FFFF (131072 - 196607)
121
+ These characters are required for the HKSCS Hong Kong Supplementary Character Set. Fonts with
122
+ SIP characters are commonly divided into a second file e.g. MingLiU and MingLiU-ExtB
123
+
124
+ mPDF requires 2 fonts and they should be cross-referenced in config_fonts.php e.g.
125
+ "sun-exta" => array(
126
+ 'R' => "Sun-ExtA.ttf",
127
+ 'sip-ext' => 'sun-extb',
128
+ ),
129
+ "sun-extb" => array(
130
+ 'R' => "Sun-ExtB.ttf",
131
+ ),
132
+
133
+ --OR--
134
+ (NB these ones also define the font number within the TTC Collection as TTCfontID)
135
+ 'mingliu' => array (
136
+ 'R' => 'mingliu.ttc',
137
+ 'TTCfontID' => array (
138
+ 'R' => 1,
139
+ ),
140
+ 'sip-ext' => 'mingliu-extb',
141
+ ),
142
+ 'mingliu-extb' => array (
143
+ 'R' => 'mingliub.ttc',
144
+ 'TTCfontID' => array (
145
+ 'R' => 1,
146
+ ),
147
+ ),
148
+ 'mingliu_hkscs' => array (
149
+ 'R' => 'mingliu.ttc',
150
+ 'TTCfontID' => array (
151
+ 'R' => 3,
152
+ ),
153
+ 'sip-ext' => 'mingliu_hkscs-extb',
154
+ ),
155
+ 'mingliu_hkscs-extb' => array (
156
+ 'R' => 'mingliub.ttc',
157
+ 'TTCfontID' => array (
158
+ 'R' => 3,
159
+ ),
160
+ ),
161
+
162
+
163
+
164
+
LICENSE → mPDF/LICENSE.txt RENAMED
@@ -1,12 +1,12 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
 
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
  Everyone is permitted to copy and distribute verbatim copies
7
  of this license document, but changing it is not allowed.
8
 
9
- Preamble
10
 
11
  The licenses for most software are designed to take away your
12
  freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
15
  General Public License applies to most of the Free Software
16
  Foundation's software and to any other program whose authors commit to
17
  using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
  your programs, too.
20
 
21
  When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
55
 
56
  The precise terms and conditions for copying, distribution and
57
  modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
 
62
  0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
110
  License. (Exception: if the Program itself is interactive but
111
  does not normally print such an announcement, your work based on
112
  the Program is not required to print an announcement.)
113
-
114
  These requirements apply to the modified work as a whole. If
115
  identifiable sections of that work are not derived from the Program,
116
  and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
168
  access to copy the source code from the same place counts as
169
  distribution of the source code, even though third parties are not
170
  compelled to copy the source along with the object code.
171
-
172
  4. You may not copy, modify, sublicense, or distribute the Program
173
  except as expressly provided under this License. Any attempt
174
  otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
225
 
226
  This section is intended to make thoroughly clear what is believed to
227
  be a consequence of the rest of this License.
228
-
229
  8. If the distribution and/or use of the Program is restricted in
230
  certain countries either by patents or by copyrighted interfaces, the
231
  original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
255
  of preserving the free status of all derivatives of our free software and
256
  of promoting the sharing and reuse of software generally.
257
 
258
- NO WARRANTY
259
 
260
  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
  FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
  PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
  POSSIBILITY OF SUCH DAMAGES.
279
 
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
 
284
  If you develop a new program, and you want it to be of the greatest
285
  possible use to the public, the best way to achieve this is to make it
@@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
290
  convey the exclusion of warranty; and each file should have at least
291
  the "copyright" line and a pointer to where the full notice is found.
292
 
293
- {description}
294
- Copyright (C) {year} {fullname}
295
 
296
  This program is free software; you can redistribute it and/or modify
297
  it under the terms of the GNU General Public License as published by
@@ -303,9 +303,10 @@ the "copyright" line and a pointer to where the full notice is found.
303
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
  GNU General Public License for more details.
305
 
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
309
 
310
  Also add information on how to contact you by electronic and paper mail.
311
 
@@ -329,11 +330,11 @@ necessary. Here is a sample; alter the names:
329
  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
 
332
- {signature of Ty Coon}, 1 April 1989
333
  Ty Coon, President of Vice
334
 
335
  This General Public License does not permit incorporating your program into
336
  proprietary programs. If your program is a subroutine library, you may
337
  consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
 
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6
  Everyone is permitted to copy and distribute verbatim copies
7
  of this license document, but changing it is not allowed.
8
 
9
+ Preamble
10
 
11
  The licenses for most software are designed to take away your
12
  freedom to share and change it. By contrast, the GNU General Public
15
  General Public License applies to most of the Free Software
16
  Foundation's software and to any other program whose authors commit to
17
  using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Library General Public License instead.) You can apply it to
19
  your programs, too.
20
 
21
  When we speak of free software, we are referring to freedom, not
55
 
56
  The precise terms and conditions for copying, distribution and
57
  modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
 
62
  0. This License applies to any program or other work which contains
110
  License. (Exception: if the Program itself is interactive but
111
  does not normally print such an announcement, your work based on
112
  the Program is not required to print an announcement.)
113
+
114
  These requirements apply to the modified work as a whole. If
115
  identifiable sections of that work are not derived from the Program,
116
  and can be reasonably considered independent and separate works in
168
  access to copy the source code from the same place counts as
169
  distribution of the source code, even though third parties are not
170
  compelled to copy the source along with the object code.
171
+
172
  4. You may not copy, modify, sublicense, or distribute the Program
173
  except as expressly provided under this License. Any attempt
174
  otherwise to copy, modify, sublicense or distribute the Program is
225
 
226
  This section is intended to make thoroughly clear what is believed to
227
  be a consequence of the rest of this License.
228
+
229
  8. If the distribution and/or use of the Program is restricted in
230
  certain countries either by patents or by copyrighted interfaces, the
231
  original copyright holder who places the Program under this License
255
  of preserving the free status of all derivatives of our free software and
256
  of promoting the sharing and reuse of software generally.
257
 
258
+ NO WARRANTY
259
 
260
  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
  FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
277
  PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
  POSSIBILITY OF SUCH DAMAGES.
279
 
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
 
284
  If you develop a new program, and you want it to be of the greatest
285
  possible use to the public, the best way to achieve this is to make it
290
  convey the exclusion of warranty; and each file should have at least
291
  the "copyright" line and a pointer to where the full notice is found.
292
 
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
 
296
  This program is free software; you can redistribute it and/or modify
297
  it under the terms of the GNU General Public License as published by
303
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
  GNU General Public License for more details.
305
 
306
+ You should have received a copy of the GNU General Public License
307
+ along with this program; if not, write to the Free Software
308
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
309
+
310
 
311
  Also add information on how to contact you by electronic and paper mail.
312
 
330
  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
  `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
 
333
+ <signature of Ty Coon>, 1 April 1989
334
  Ty Coon, President of Vice
335
 
336
  This General Public License does not permit incorporating your program into
337
  proprietary programs. If your program is a subroutine library, you may
338
  consider it more useful to permit linking proprietary applications with the
339
+ library. If this is what you want to do, use the GNU Library General
340
+ Public License instead of this License.
mPDF/README.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ Upgrading
2
+ ============
3
+
4
+ To upgrade from mPDF 5.7 to 5.7.1, simply upload the 3 files to their corresponding folders, overwriting files as required.
5
+
mPDF/classes/barcode.php ADDED
@@ -0,0 +1,1966 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Adapted for mPDF from TCPDF barcode. Original Details left below.
4
+
5
+ //============================================================+
6
+ // File name : barcodes.php
7
+ // Begin : 2008-06-09
8
+ // Last Update : 2009-04-15
9
+ // Version : 1.0.008
10
+ // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
11
+ // ----------------------------------------------------------------------------
12
+ // Copyright (C) 2008-2009 Nicola Asuni - Tecnick.com S.r.l.
13
+ //
14
+ // This program is free software: you can redistribute it and/or modify
15
+ // it under the terms of the GNU Lesser General Public License as published by
16
+ // the Free Software Foundation, either version 2.1 of the License, or
17
+ // (at your option) any later version.
18
+ //
19
+ // This program is distributed in the hope that it will be useful,
20
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ // GNU Lesser General Public License for more details.
23
+ //
24
+ // You should have received a copy of the GNU Lesser General Public License
25
+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
26
+ //
27
+ // See LICENSE.TXT file for more information.
28
+ // ----------------------------------------------------------------------------
29
+ //
30
+ // Description : PHP class to creates array representations for
31
+ // common 1D barcodes to be used with TCPDF.
32
+ //
33
+ // Author: Nicola Asuni
34
+ //
35
+ // (c) Copyright:
36
+ // Nicola Asuni
37
+ // Tecnick.com S.r.l.
38
+ // Via della Pace, 11
39
+ // 09044 Quartucciu (CA)
40
+ // ITALY
41
+ // www.tecnick.com
42
+ // info@tecnick.com
43
+ //============================================================+
44
+
45
+ class PDFBarcode {
46
+
47
+ protected $barcode_array;
48
+ protected $gapwidth;
49
+ protected $print_ratio;
50
+ protected $daft;
51
+
52
+ public function __construct() {
53
+
54
+ }
55
+
56
+ public function getBarcodeArray($code, $type, $pr='') {
57
+ $this->setBarcode($code, $type, $pr);
58
+ return $this->barcode_array;
59
+ }
60
+ public function getChecksum($code, $type) {
61
+ $this->setBarcode($code, $type);
62
+ if (!$this->barcode_array) { return ''; }
63
+ else { return $this->barcode_array['checkdigit']; }
64
+ }
65
+
66
+ public function setBarcode($code, $type, $pr='') {
67
+ $this->print_ratio = 1;
68
+ switch (strtoupper($type)) {
69
+ case 'ISBN':
70
+ case 'ISSN':
71
+ case 'EAN13': { // EAN 13
72
+ $arrcode = $this->barcode_eanupc($code, 13);
73
+ $arrcode['lightmL'] = 11; // LEFT light margin = x X-dim (http://www.gs1uk.org)
74
+ $arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
75
+ $arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
76
+ $arrcode['nom-H'] = 25.93; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
77
+ break;
78
+ }
79
+ case 'UPCA': { // UPC-A
80
+ $arrcode = $this->barcode_eanupc($code, 12);
81
+ $arrcode['lightmL'] = 9; // LEFT light margin = x X-dim (http://www.gs1uk.org)
82
+ $arrcode['lightmR'] = 9; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
83
+ $arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
84
+ $arrcode['nom-H'] = 25.91; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
85
+ break;
86
+ }
87
+ case 'UPCE': { // UPC-E
88
+ $arrcode = $this->barcode_eanupc($code, 6);
89
+ $arrcode['lightmL'] = 9; // LEFT light margin = x X-dim (http://www.gs1uk.org)
90
+ $arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
91
+ $arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
92
+ $arrcode['nom-H'] = 25.93; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
93
+ break;
94
+ }
95
+ case 'EAN8': { // EAN 8
96
+ $arrcode = $this->barcode_eanupc($code, 8);
97
+ $arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (http://www.gs1uk.org)
98
+ $arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
99
+ $arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
100
+ $arrcode['nom-H'] = 21.64; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
101
+ break;
102
+ }
103
+ case 'EAN2': { // 2-Digits UPC-Based Extention
104
+ $arrcode = $this->barcode_eanext($code, 2);
105
+ $arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (estimated)
106
+ $arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (estimated)
107
+ $arrcode['sepM'] = 9; // SEPARATION margin = x X-dim (http://web.archive.org/web/19990501035133/http://www.uc-council.org/d36-d.htm)
108
+ $arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
109
+ $arrcode['nom-H'] = 20; // Nominal bar height in mm incl. numerals (estimated) not used when combined
110
+ break;
111
+ }
112
+ case 'EAN5': { // 5-Digits UPC-Based Extention
113
+ $arrcode = $this->barcode_eanext($code, 5);
114
+ $arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (estimated)
115
+ $arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (estimated)
116
+ $arrcode['sepM'] = 9; // SEPARATION margin = x X-dim (http://web.archive.org/web/19990501035133/http://www.uc-council.org/d36-d.htm)
117
+ $arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
118
+ $arrcode['nom-H'] = 20; // Nominal bar height in mm incl. numerals (estimated) not used when combined
119
+ break;
120
+ }
121
+
122
+ case 'IMB': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
123
+ $xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
124
+ $bpi = 22; // Bars per inch
125
+ // Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
126
+ $this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
127
+ $this->daft = array('D'=>2, 'A'=>2, 'F'=>3, 'T'=>1); // Descender; Ascender; Full; Tracker bar heights
128
+ $arrcode = $this->barcode_imb($code);
129
+ $arrcode['nom-X'] = $xdim ;
130
+ $arrcode['nom-H'] = 3.68; // Nominal value for Height of Full bar in mm (spec.)
131
+ // USPS-B-3200 Revision C = 4.623
132
+ // USPS-B-3200 Revision E = 3.68
133
+ $arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (spec.)
134
+ $arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (spec.)
135
+ $arrcode['quietTB'] = 0.711; // TOP/BOTTOM Quiet margin = mm (spec.)
136
+ break;
137
+ }
138
+ case 'RM4SCC': { // RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
139
+ $xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
140
+ $bpi = 22; // Bars per inch
141
+ // Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
142
+ $this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
143
+ $this->daft = array('D'=>5, 'A'=>5, 'F'=>8, 'T'=>2); // Descender; Ascender; Full; Tracker bar heights
144
+ $arrcode = $this->barcode_rm4scc($code, false);
145
+ $arrcode['nom-X'] = $xdim ;
146
+ $arrcode['nom-H'] = 5.0; // Nominal value for Height of Full bar in mm (spec.)
147
+ $arrcode['quietL'] = 2; // LEFT Quiet margin = mm (spec.)
148
+ $arrcode['quietR'] = 2; // RIGHT Quiet margin = mm (spec.)
149
+ $arrcode['quietTB'] = 2; // TOP/BOTTOM Quiet margin = mm (spec?)
150
+ break;
151
+ }
152
+ case 'KIX': { // KIX (Klant index - Customer index)
153
+ $xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
154
+ $bpi = 22; // Bars per inch
155
+ // Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
156
+ $this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
157
+ $this->daft = array('D'=>5, 'A'=>5, 'F'=>8, 'T'=>2); // Descender; Ascender; Full; Tracker bar heights
158
+ $arrcode = $this->barcode_rm4scc($code, true);
159
+ $arrcode['nom-X'] = $xdim ;
160
+ $arrcode['nom-H'] = 5.0; // Nominal value for Height of Full bar in mm (? spec.)
161
+ $arrcode['quietL'] = 2; // LEFT Quiet margin = mm (spec.)
162
+ $arrcode['quietR'] = 2; // RIGHT Quiet margin = mm (spec.)
163
+ $arrcode['quietTB'] = 2; // TOP/BOTTOM Quiet margin = mm (spec.)
164
+ break;
165
+ }
166
+ case 'POSTNET': { // POSTNET
167
+ $xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
168
+ $bpi = 22; // Bars per inch
169
+ // Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
170
+ $this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
171
+ $arrcode = $this->barcode_postnet($code, false);
172
+ $arrcode['nom-X'] = $xdim ;
173
+ $arrcode['nom-H'] = 3.175; // Nominal value for Height of Full bar in mm (spec.)
174
+ $arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (?spec.)
175
+ $arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (?spec.)
176
+ $arrcode['quietTB'] = 1.016; // TOP/BOTTOM Quiet margin = mm (?spec.)
177
+ break;
178
+ }
179
+ case 'PLANET': { // PLANET
180
+ $xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
181
+ $bpi = 22; // Bars per inch
182
+ // Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
183
+ $this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
184
+ $arrcode = $this->barcode_postnet($code, true);
185
+ $arrcode['nom-X'] = $xdim ;
186
+ $arrcode['nom-H'] = 3.175; // Nominal value for Height of Full bar in mm (spec.)
187
+ $arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (?spec.)
188
+ $arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (?spec.)
189
+ $arrcode['quietTB'] = 1.016; // TOP/BOTTOM Quiet margin = mm (?spec.)
190
+ break;
191
+ }
192
+
193
+ case 'C93': { // CODE 93 - USS-93
194
+ $arrcode = $this->barcode_code93($code);
195
+ if ($arrcode == false) { break; }
196
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
197
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
198
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
199
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
200
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
201
+ break;
202
+ }
203
+ case 'CODE11': { // CODE 11
204
+ if ($pr > 0) { $this->print_ratio = $pr; }
205
+ else { $this->print_ratio = 3; } // spec: Pr= 1:2.24 - 1:3.5
206
+ $arrcode = $this->barcode_code11($code);
207
+ if ($arrcode == false) { break; }
208
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
209
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
210
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
211
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
212
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
213
+ break;
214
+ }
215
+ case 'MSI': // MSI (Variation of Plessey code)
216
+ case 'MSI+': { // MSI + CHECKSUM (modulo 11)
217
+ if (strtoupper($type)=='MSI') { $arrcode = $this->barcode_msi($code, false); }
218
+ if (strtoupper($type)=='MSI+') { $arrcode = $this->barcode_msi($code, true); }
219
+ if ($arrcode == false) { break; }
220
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
221
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
222
+ $arrcode['lightmL'] = 12; // LEFT light margin = x X-dim (spec.)
223
+ $arrcode['lightmR'] = 12; // RIGHT light margin = x X-dim (spec.)
224
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
225
+ break;
226
+ }
227
+ case 'CODABAR': { // CODABAR
228
+ if ($pr > 0) { $this->print_ratio = $pr; }
229
+ else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
230
+ if (strtoupper($type)=='CODABAR') { $arrcode = $this->barcode_codabar($code); }
231
+ if ($arrcode == false) { break; }
232
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
233
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
234
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
235
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
236
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
237
+ break;
238
+ }
239
+ case 'C128A': // CODE 128 A
240
+ case 'C128B': // CODE 128 B
241
+ case 'C128C': // CODE 128 C
242
+ case 'EAN128A': // EAN 128 A
243
+ case 'EAN128B': // EAN 128 B
244
+ case 'EAN128C': { // EAN 128 C
245
+ if (strtoupper($type)=='C128A') { $arrcode = $this->barcode_c128($code, 'A'); }
246
+ if (strtoupper($type)=='C128B') { $arrcode = $this->barcode_c128($code, 'B'); }
247
+ if (strtoupper($type)=='C128C') { $arrcode = $this->barcode_c128($code, 'C'); }
248
+ if (strtoupper($type)=='EAN128A') { $arrcode = $this->barcode_c128($code, 'A', true); }
249
+ if (strtoupper($type)=='EAN128B') { $arrcode = $this->barcode_c128($code, 'B', true); }
250
+ if (strtoupper($type)=='EAN128C') { $arrcode = $this->barcode_c128($code, 'C', true); }
251
+ if ($arrcode == false) { break; }
252
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
253
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
254
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
255
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
256
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
257
+ break;
258
+ }
259
+ case 'C39': // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
260
+ case 'C39+': // CODE 39 with checksum
261
+ case 'C39E': // CODE 39 EXTENDED
262
+ case 'C39E+': { // CODE 39 EXTENDED + CHECKSUM
263
+ if ($pr > 0) { $this->print_ratio = $pr; }
264
+ else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
265
+ $code = str_replace(chr(194).chr(160), ' ', $code); // mPDF 5.3.95 (for utf-8 encoded)
266
+ $code = str_replace(chr(160), ' ', $code); // mPDF 5.3.95 (for win-1252)
267
+ if (strtoupper($type)=='C39') { $arrcode = $this->barcode_code39($code, false, false); }
268
+ if (strtoupper($type)=='C39+') { $arrcode = $this->barcode_code39($code, false, true); }
269
+ if (strtoupper($type)=='C39E') { $arrcode = $this->barcode_code39($code, true, false); }
270
+ if (strtoupper($type)=='C39E+') { $arrcode = $this->barcode_code39($code, true, true); }
271
+ if ($arrcode == false) { break; }
272
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
273
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
274
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
275
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
276
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
277
+ break;
278
+ }
279
+ case 'S25': // Standard 2 of 5
280
+ case 'S25+': { // Standard 2 of 5 + CHECKSUM
281
+ if ($pr > 0) { $this->print_ratio = $pr; }
282
+ else { $this->print_ratio = 3; } // spec: Pr=1:3/1:4.5
283
+ if (strtoupper($type)=='S25') { $arrcode = $this->barcode_s25($code, false); }
284
+ if (strtoupper($type)=='S25+') { $arrcode = $this->barcode_s25($code, true); }
285
+ if ($arrcode == false) { break; }
286
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
287
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
288
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
289
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
290
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
291
+ break;
292
+ }
293
+ case 'I25': // Interleaved 2 of 5
294
+ case 'I25+': { // Interleaved 2 of 5 + CHECKSUM
295
+ if ($pr > 0) { $this->print_ratio = $pr; }
296
+ else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
297
+ if (strtoupper($type)=='I25') { $arrcode = $this->barcode_i25($code, false); }
298
+ if (strtoupper($type)=='I25+') { $arrcode = $this->barcode_i25($code, true); }
299
+ if ($arrcode == false) { break; }
300
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
301
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
302
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
303
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
304
+ $arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
305
+ break;
306
+ }
307
+ case 'I25B': // Interleaved 2 of 5 + Bearer bars
308
+ case 'I25B+': { // Interleaved 2 of 5 + CHECKSUM + Bearer bars
309
+ if ($pr > 0) { $this->print_ratio = $pr; }
310
+ else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
311
+ if (strtoupper($type)=='I25B') { $arrcode = $this->barcode_i25($code, false); }
312
+ if (strtoupper($type)=='I25B+') { $arrcode = $this->barcode_i25($code, true); }
313
+ if ($arrcode == false) { break; }
314
+ $arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
315
+ $arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
316
+ $arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
317
+ $arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
318
+ $arrcode['lightTB'] = 2; // TOP/BOTTOM light margin = x X-dim (non-spec.) - used for bearer bars
319
+ break;
320
+ }
321
+ default: {
322
+ $this->barcode_array = false;
323
+ }
324
+ }
325
+ $this->barcode_array = $arrcode;
326
+ }
327
+
328
+ /**
329
+ * CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
330
+ */
331
+ protected function barcode_code39($code, $extended=false, $checksum=false) {
332
+ $chr['0'] = '111221211';
333
+ $chr['1'] = '211211112';
334
+ $chr['2'] = '112211112';
335
+ $chr['3'] = '212211111';
336
+ $chr['4'] = '111221112';
337
+ $chr['5'] = '211221111';
338
+ $chr['6'] = '112221111';
339
+ $chr['7'] = '111211212';
340
+ $chr['8'] = '211211211';
341
+ $chr['9'] = '112211211';
342
+ $chr['A'] = '211112112';
343
+ $chr['B'] = '112112112';
344
+ $chr['C'] = '212112111';
345
+ $chr['D'] = '111122112';
346
+ $chr['E'] = '211122111';
347
+ $chr['F'] = '112122111';
348
+ $chr['G'] = '111112212';
349
+ $chr['H'] = '211112211';
350
+ $chr['I'] = '112112211';
351
+ $chr['J'] = '111122211';
352
+ $chr['K'] = '211111122';
353
+ $chr['L'] = '112111122';
354
+ $chr['M'] = '212111121';
355
+ $chr['N'] = '111121122';
356
+ $chr['O'] = '211121121';
357
+ $chr['P'] = '112121121';
358
+ $chr['Q'] = '111111222';
359
+ $chr['R'] = '211111221';
360
+ $chr['S'] = '112111221';
361
+ $chr['T'] = '111121221';
362
+ $chr['U'] = '221111112';
363
+ $chr['V'] = '122111112';
364
+ $chr['W'] = '222111111';
365
+ $chr['X'] = '121121112';
366
+ $chr['Y'] = '221121111';
367
+ $chr['Z'] = '122121111';
368
+ $chr['-'] = '121111212';
369
+ $chr['.'] = '221111211';
370
+ $chr[' '] = '122111211';
371
+ $chr['$'] = '121212111';
372
+ $chr['/'] = '121211121';
373
+ $chr['+'] = '121112121';
374
+ $chr['%'] = '111212121';
375
+ $chr['*'] = '121121211';
376
+
377
+ $code = strtoupper($code);
378
+ if ($extended) {
379
+ // extended mode
380
+ $code = $this->encode_code39_ext($code);
381
+ }
382
+ if ($code === false) {
383
+ return false;
384
+ }
385
+ if ($checksum) {
386
+ // checksum
387
+ $checkdigit = $this->checksum_code39($code);
388
+ $code .= $checkdigit ;
389
+ }
390
+ // add start and stop codes
391
+ $code = '*'.$code.'*';
392
+
393
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
394
+ $k = 0;
395
+ $clen = strlen($code);
396
+ for ($i = 0; $i < $clen; ++$i) {
397
+ $char = $code[$i];
398
+ if(!isset($chr[$char])) {
399
+ // invalid character
400
+ return false;
401
+ }
402
+ for ($j = 0; $j < 9; ++$j) {
403
+ if (($j % 2) == 0) {
404
+ $t = true; // bar
405
+ } else {
406
+ $t = false; // space
407
+ }
408
+ $x = $chr[$char][$j];
409
+ if ($x == 2) { $w = $this->print_ratio; }
410
+ else { $w = 1; }
411
+
412
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
413
+ $bararray['maxw'] += $w;
414
+ ++$k;
415
+ }
416
+ $bararray['bcode'][$k] = array('t' => false, 'w' => 1, 'h' => 1, 'p' => 0);
417
+ $bararray['maxw'] += 1;
418
+ ++$k;
419
+ }
420
+ $bararray['checkdigit'] = $checkdigit;
421
+ return $bararray;
422
+ }
423
+
424
+ /**
425
+ * Encode a string to be used for CODE 39 Extended mode.
426
+ */
427
+ protected function encode_code39_ext($code) {
428
+ $encode = array(
429
+ chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C',
430
+ chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G',
431
+ chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K',
432
+ chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O',
433
+ chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S',
434
+ chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W',
435
+ chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A',
436
+ chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E',
437
+ chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C',
438
+ chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G',
439
+ chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K',
440
+ chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O',
441
+ chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',
442
+ chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',
443
+ chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F',
444
+ chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J',
445
+ chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',
446
+ chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',
447
+ chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',
448
+ chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',
449
+ chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',
450
+ chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',
451
+ chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K',
452
+ chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O',
453
+ chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C',
454
+ chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G',
455
+ chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K',
456
+ chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O',
457
+ chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S',
458
+ chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W',
459
+ chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P',
460
+ chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');
461
+ $code_ext = '';
462
+ $clen = strlen($code);
463
+ for ($i = 0 ; $i < $clen; ++$i) {
464
+ if (ord($code[$i]) > 127) {
465
+ return false;
466
+ }
467
+ $code_ext .= $encode[$code[$i]];
468
+ }
469
+ return $code_ext;
470
+ }
471
+
472
+ /**
473
+ * Calculate CODE 39 checksum (modulo 43).
474
+ */
475
+ protected function checksum_code39($code) {
476
+ $chars = array(
477
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
478
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
479
+ 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
480
+ 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
481
+ $sum = 0;
482
+ $clen = strlen($code);
483
+ for ($i = 0 ; $i < $clen; ++$i) {
484
+ $k = array_keys($chars, $code[$i]);
485
+ $sum += $k[0];
486
+ }
487
+ $j = ($sum % 43);
488
+ return $chars[$j];
489
+ }
490
+
491
+ /**
492
+ * CODE 93 - USS-93
493
+ * Compact code similar to Code 39
494
+ */
495
+ protected function barcode_code93($code) {
496
+ $chr['0'] = '131112';
497
+ $chr['1'] = '111213';
498
+ $chr['2'] = '111312';
499
+ $chr['3'] = '111411';
500
+ $chr['4'] = '121113';
501
+ $chr['5'] = '121212';
502
+ $chr['6'] = '121311';
503
+ $chr['7'] = '111114';
504
+ $chr['8'] = '131211';
505
+ $chr['9'] = '141111';
506
+ $chr['A'] = '211113';
507
+ $chr['B'] = '211212';
508
+ $chr['C'] = '211311';
509
+ $chr['D'] = '221112';
510
+ $chr['E'] = '221211';
511
+ $chr['F'] = '231111';
512
+ $chr['G'] = '112113';
513
+ $chr['H'] = '112212';
514
+ $chr['I'] = '112311';
515
+ $chr['J'] = '122112';
516
+ $chr['K'] = '132111';
517
+ $chr['L'] = '111123';
518
+ $chr['M'] = '111222';
519
+ $chr['N'] = '111321';
520
+ $chr['O'] = '121122';
521
+ $chr['P'] = '131121';
522
+ $chr['Q'] = '212112';
523
+ $chr['R'] = '212211';
524
+ $chr['S'] = '211122';
525
+ $chr['T'] = '211221';
526
+ $chr['U'] = '221121';
527
+ $chr['V'] = '222111';
528
+ $chr['W'] = '112122';
529
+ $chr['X'] = '112221';
530
+ $chr['Y'] = '122121';
531
+ $chr['Z'] = '123111';
532
+ $chr['-'] = '121131';
533
+ $chr['.'] = '311112';
534
+ $chr[' '] = '311211';
535
+ $chr['$'] = '321111';
536
+ $chr['/'] = '112131';
537
+ $chr['+'] = '113121';
538
+ $chr['%'] = '211131';
539
+ $chr[128] = '121221'; // ($)
540
+ $chr[129] = '311121'; // (/)
541
+ $chr[130] = '122211'; // (+)
542
+ $chr[131] = '312111'; // (%)
543
+ $chr['*'] = '111141';
544
+ $code = strtoupper($code);
545
+ $encode = array(
546
+ chr(0) => chr(131).'U', chr(1) => chr(128).'A', chr(2) => chr(128).'B', chr(3) => chr(128).'C',
547
+ chr(4) => chr(128).'D', chr(5) => chr(128).'E', chr(6) => chr(128).'F', chr(7) => chr(128).'G',
548
+ chr(8) => chr(128).'H', chr(9) => chr(128).'I', chr(10) => chr(128).'J', chr(11) => '£K',
549
+ chr(12) => chr(128).'L', chr(13) => chr(128).'M', chr(14) => chr(128).'N', chr(15) => chr(128).'O',
550
+ chr(16) => chr(128).'P', chr(17) => chr(128).'Q', chr(18) => chr(128).'R', chr(19) => chr(128).'S',
551
+ chr(20) => chr(128).'T', chr(21) => chr(128).'U', chr(22) => chr(128).'V', chr(23) => chr(128).'W',
552
+ chr(24) => chr(128).'X', chr(25) => chr(128).'Y', chr(26) => chr(128).'Z', chr(27) => chr(131).'A',
553
+ chr(28) => chr(131).'B', chr(29) => chr(131).'C', chr(30) => chr(131).'D', chr(31) => chr(131).'E',
554
+ chr(32) => ' ', chr(33) => chr(129).'A', chr(34) => chr(129).'B', chr(35) => chr(129).'C',
555
+ chr(36) => chr(129).'D', chr(37) => chr(129).'E', chr(38) => chr(129).'F', chr(39) => chr(129).'G',
556
+ chr(40) => chr(129).'H', chr(41) => chr(129).'I', chr(42) => chr(129).'J', chr(43) => chr(129).'K',
557
+ chr(44) => chr(129).'L', chr(45) => '-', chr(46) => '.', chr(47) => chr(129).'O',
558
+ chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',
559
+ chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',
560
+ chr(56) => '8', chr(57) => '9', chr(58) => chr(129).'Z', chr(59) => chr(131).'F',
561
+ chr(60) => chr(131).'G', chr(61) => chr(131).'H', chr(62) => chr(131).'I', chr(63) => chr(131).'J',
562
+ chr(64) => chr(131).'V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',
563
+ chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',
564
+ chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',
565
+ chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',
566
+ chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',
567
+ chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',
568
+ chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => chr(131).'K',
569
+ chr(92) => chr(131).'L', chr(93) => chr(131).'M', chr(94) => chr(131).'N', chr(95) => chr(131).'O',
570
+ chr(96) => chr(131).'W', chr(97) => chr(130).'A', chr(98) => chr(130).'B', chr(99) => chr(130).'C',
571
+ chr(100) => chr(130).'D', chr(101) => chr(130).'E', chr(102) => chr(130).'F', chr(103) => chr(130).'G',
572
+ chr(104) => chr(130).'H', chr(105) => chr(130).'I', chr(106) => chr(130).'J', chr(107) => chr(130).'K',
573
+ chr(108) => chr(130).'L', chr(109) => chr(130).'M', chr(110) => chr(130).'N', chr(111) => chr(130).'O',
574
+ chr(112) => chr(130).'P', chr(113) => chr(130).'Q', chr(114) => chr(130).'R', chr(115) => chr(130).'S',
575
+ chr(116) => chr(130).'T', chr(117) => chr(130).'U', chr(118) => chr(130).'V', chr(119) => chr(130).'W',
576
+ chr(120) => chr(130).'X', chr(121) => chr(130).'Y', chr(122) => chr(130).'Z', chr(123) => chr(131).'P',
577
+ chr(124) => chr(131).'Q', chr(125) => chr(131).'R', chr(126) => chr(131).'S', chr(127) => chr(131).'T');
578
+ $code_ext = '';
579
+ $clen = strlen($code);
580
+ for ($i = 0 ; $i < $clen; ++$i) {
581
+ if (ord($code[$i]) > 127) {
582
+ return false;
583
+ }
584
+ $code_ext .= $encode[$code[$i]];
585
+ }
586
+ // checksum
587
+ $checkdigit = $this->checksum_code93($code);
588
+ $code .= $checkdigit ;
589
+ // add start and stop codes
590
+ $code = '*'.$code.'*';
591
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
592
+ $k = 0;
593
+ $clen = strlen($code);
594
+ for ($i = 0; $i < $clen; ++$i) {
595
+ $char = $code[$i];
596
+ if(!isset($chr[$char])) {
597
+ // invalid character
598
+ return false;
599
+ }
600
+ for ($j = 0; $j < 6; ++$j) {
601
+ if (($j % 2) == 0) {
602
+ $t = true; // bar
603
+ } else {
604
+ $t = false; // space
605
+ }
606
+ $w = $chr[$char][$j];
607
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
608
+ $bararray['maxw'] += $w;
609
+ ++$k;
610
+ }
611
+ }
612
+ $bararray['bcode'][$k] = array('t' => true, 'w' => 1, 'h' => 1, 'p' => 0);
613
+ $bararray['maxw'] += 1;
614
+ ++$k;
615
+ $bararray['checkdigit'] = $checkdigit;
616
+ return $bararray;
617
+ }
618
+
619
+ /**
620
+ * Calculate CODE 93 checksum (modulo 47).
621
+ */
622
+ protected function checksum_code93($code) {
623
+ $chars = array(
624
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
625
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
626
+ 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
627
+ 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
628
+ // translate special characters
629
+ $code = strtr($code, chr(128).chr(129).chr(130).chr(131), '$/+%');
630
+ $len = strlen($code);
631
+ // calculate check digit C
632
+ $p = 1;
633
+ $check = 0;
634
+ for ($i = ($len - 1); $i >= 0; --$i) {
635
+ $k = array_keys($chars, $code[$i]);
636
+ $check += ($k[0] * $p);
637
+ ++$p;
638
+ if ($p > 20) {
639
+ $p = 1;
640
+ }
641
+ }
642
+ $check %= 47;
643
+ $c = $chars[$check];
644
+ $code .= $c;
645
+ // calculate check digit K
646
+ $p = 1;
647
+ $check = 0;
648
+ for ($i = $len; $i >= 0; --$i) {
649
+ $k = array_keys($chars, $code[$i]);
650
+ $check += ($k[0] * $p);
651
+ ++$p;
652
+ if ($p > 15) {
653
+ $p = 1;
654
+ }
655
+ }
656
+ $check %= 47;
657
+ $k = $chars[$check];
658
+ return $c.$k;
659
+ }
660
+
661
+ /**
662
+ * Checksum for standard 2 of 5 barcodes.
663
+ */
664
+ protected function checksum_s25($code) {
665
+ $len = strlen($code);
666
+ $sum = 0;
667
+ for ($i = 0; $i < $len; $i+=2) {
668
+ $sum += $code[$i];
669
+ }
670
+ $sum *= 3;
671
+ for ($i = 1; $i < $len; $i+=2) {
672
+ $sum += ($code[$i]);
673
+ }
674
+ $r = $sum % 10;
675
+ if($r > 0) {
676
+ $r = (10 - $r);
677
+ }
678
+ return $r;
679
+ }
680
+
681
+ /**
682
+ * MSI.
683
+ * Variation of Plessey code, with similar applications
684
+ * Contains digits (0 to 9) and encodes the data only in the width of bars.
685
+ */
686
+ protected function barcode_msi($code, $checksum=false) {
687
+ $chr['0'] = '100100100100';
688
+ $chr['1'] = '100100100110';
689
+ $chr['2'] = '100100110100';
690
+ $chr['3'] = '100100110110';
691
+ $chr['4'] = '100110100100';
692
+ $chr['5'] = '100110100110';
693
+ $chr['6'] = '100110110100';
694
+ $chr['7'] = '100110110110';
695
+ $chr['8'] = '110100100100';
696
+ $chr['9'] = '110100100110';
697
+ $chr['A'] = '110100110100';
698
+ $chr['B'] = '110100110110';
699
+ $chr['C'] = '110110100100';
700
+ $chr['D'] = '110110100110';
701
+ $chr['E'] = '110110110100';
702
+ $chr['F'] = '110110110110';
703
+ if ($checksum) {
704
+ // add checksum
705
+ $clen = strlen($code);
706
+ $p = 2;
707
+ $check = 0;
708
+ for ($i = ($clen - 1); $i >= 0; --$i) {
709
+ $check += (hexdec($code[$i]) * $p);
710
+ ++$p;
711
+ if ($p > 7) {
712
+ $p = 2;
713
+ }
714
+ }
715
+ $check %= 11;
716
+ if ($check > 0) {
717
+ $check = 11 - $check;
718
+ }
719
+ $code .= $check;
720
+ $checkdigit = $check;
721
+ }
722
+ $seq = '110'; // left guard
723
+ $clen = strlen($code);
724
+ for ($i = 0; $i < $clen; ++$i) {
725
+ $digit = $code[$i];
726
+ if (!isset($chr[$digit])) {
727
+ // invalid character
728
+ return false;
729
+ }
730
+ $seq .= $chr[$digit];
731
+ }
732
+ $seq .= '1001'; // right guard
733
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
734
+ $bararray['checkdigit'] = $checkdigit;
735
+ return $this->binseq_to_array($seq, $bararray);
736
+ }
737
+
738
+ /**
739
+ * Standard 2 of 5 barcodes.
740
+ * Used in airline ticket marking, photofinishing
741
+ * Contains digits (0 to 9) and encodes the data only in the width of bars.
742
+ */
743
+ protected function barcode_s25($code, $checksum=false) {
744
+ $chr['0'] = '10101110111010';
745
+ $chr['1'] = '11101010101110';
746
+ $chr['2'] = '10111010101110';
747
+ $chr['3'] = '11101110101010';
748
+ $chr['4'] = '10101110101110';
749
+ $chr['5'] = '11101011101010';
750
+ $chr['6'] = '10111011101010';
751
+ $chr['7'] = '10101011101110';
752
+ $chr['8'] = '10101110111010';
753
+ $chr['9'] = '10111010111010';
754
+ if ($checksum) {
755
+ // add checksum
756
+ $checkdigit = $this->checksum_s25($code);
757
+ $code .= $checkdigit ;
758
+ }
759
+ if((strlen($code) % 2) != 0) {
760
+ // add leading zero if code-length is odd
761
+ $code = '0'.$code;
762
+ }
763
+ $seq = '11011010';
764
+ $clen = strlen($code);
765
+ for ($i = 0; $i < $clen; ++$i) {
766
+ $digit = $code[$i];
767
+ if (!isset($chr[$digit])) {
768
+ // invalid character
769
+ return false;
770
+ }
771
+ $seq .= $chr[$digit];
772
+ }
773
+ $seq .= '1101011';
774
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
775
+ $bararray['checkdigit'] = $checkdigit;
776
+ return $this->binseq_to_array($seq, $bararray);
777
+ }
778
+
779
+ /**
780
+ * Convert binary barcode sequence to barcode array
781
+ */
782
+ protected function binseq_to_array($seq, $bararray) {
783
+ $len = strlen($seq);
784
+ $w = 0;
785
+ $k = 0;
786
+ for ($i = 0; $i < $len; ++$i) {
787
+ $w += 1;
788
+ if (($i == ($len - 1)) OR (($i < ($len - 1)) AND ($seq[$i] != $seq[($i+1)]))) {
789
+ if ($seq[$i] == '1') {
790
+ $t = true; // bar
791
+ } else {
792
+ $t = false; // space
793
+ }
794
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
795
+ $bararray['maxw'] += $w;
796
+ ++$k;
797
+ $w = 0;
798
+ }
799
+ }
800
+ return $bararray;
801
+ }
802
+
803
+ /**
804
+ * Interleaved 2 of 5 barcodes.
805
+ * Compact numeric code, widely used in industry, air cargo
806
+ * Contains digits (0 to 9) and encodes the data in the width of both bars and spaces.
807
+ */
808
+ protected function barcode_i25($code, $checksum=false) {
809
+ $chr['0'] = '11221';
810
+ $chr['1'] = '21112';
811
+ $chr['2'] = '12112';
812
+ $chr['3'] = '22111';
813
+ $chr['4'] = '11212';
814
+ $chr['5'] = '21211';
815
+ $chr['6'] = '12211';
816
+ $chr['7'] = '11122';
817
+ $chr['8'] = '21121';
818
+ $chr['9'] = '12121';
819
+ $chr['A'] = '11';
820
+ $chr['Z'] = '21';
821
+ if ($checksum) {
822
+ // add checksum
823
+ $checkdigit = $this->checksum_s25($code);
824
+ $code .= $checkdigit ;
825
+ }
826
+ if((strlen($code) % 2) != 0) {
827
+ // add leading zero if code-length is odd
828
+ $code = '0'.$code;
829
+ }
830
+ // add start and stop codes
831
+ $code = 'AA'.strtolower($code).'ZA';
832
+
833
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
834
+ $k = 0;
835
+ $clen = strlen($code);
836
+ for ($i = 0; $i < $clen; $i = ($i + 2)) {
837
+ $char_bar = $code[$i];
838
+ $char_space = $code[$i+1];
839
+ if((!isset($chr[$char_bar])) OR (!isset($chr[$char_space]))) {
840
+ // invalid character
841
+ return false;
842
+ }
843
+ // create a bar-space sequence
844
+ $seq = '';
845
+ $chrlen = strlen($chr[$char_bar]);
846
+ for ($s = 0; $s < $chrlen; $s++){
847
+ $seq .= $chr[$char_bar][$s] . $chr[$char_space][$s];
848
+ }
849
+ $seqlen = strlen($seq);
850
+ for ($j = 0; $j < $seqlen; ++$j) {
851
+ if (($j % 2) == 0) {
852
+ $t = true; // bar
853
+ } else {
854
+ $t = false; // space
855
+ }
856
+ $x = $seq[$j];
857
+ if ($x == 2) { $w = $this->print_ratio; }
858
+ else { $w = 1; }
859
+
860
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
861
+ $bararray['maxw'] += $w;
862
+ ++$k;
863
+ }
864
+ }
865
+ $bararray['checkdigit'] = $checkdigit;
866
+ return $bararray;
867
+ }
868
+
869
+ /**
870
+ * C128 barcodes.
871
+ * Very capable code, excellent density, high reliability; in very wide use world-wide
872
+ */
873
+ protected function barcode_c128($code, $type='B', $ean=false) {
874
+ $code = strcode2utf($code); // mPDF 5.7.1 Allows e.g. <barcode code="5432&#013;1068" type="C128A" />
875
+ $chr = array(
876
+ '212222', /* 00 */
877
+ '222122', /* 01 */
878
+ '222221', /* 02 */
879
+ '121223', /* 03 */
880
+ '121322', /* 04 */
881
+ '131222', /* 05 */
882
+ '122213', /* 06 */
883
+ '122312', /* 07 */
884
+ '132212', /* 08 */
885
+ '221213', /* 09 */
886
+ '221312', /* 10 */
887
+ '231212', /* 11 */
888
+ '112232', /* 12 */
889
+ '122132', /* 13 */
890
+ '122231', /* 14 */
891
+ '113222', /* 15 */
892
+ '123122', /* 16 */
893
+ '123221', /* 17 */
894
+ '223211', /* 18 */
895
+ '221132', /* 19 */
896
+ '221231', /* 20 */
897
+ '213212', /* 21 */
898
+ '223112', /* 22 */
899
+ '312131', /* 23 */
900
+ '311222', /* 24 */
901
+ '321122', /* 25 */
902
+ '321221', /* 26 */
903
+ '312212', /* 27 */
904
+ '322112', /* 28 */
905
+ '322211', /* 29 */
906
+ '212123', /* 30 */
907
+ '212321', /* 31 */
908
+ '232121', /* 32 */
909
+ '111323', /* 33 */
910
+ '131123', /* 34 */
911
+ '131321', /* 35 */
912
+ '112313', /* 36 */
913
+ '132113', /* 37 */
914
+ '132311', /* 38 */
915
+ '211313', /* 39 */
916
+ '231113', /* 40 */
917
+ '231311', /* 41 */
918
+ '112133', /* 42 */
919
+ '112331', /* 43 */
920
+ '132131', /* 44 */
921
+ '113123', /* 45 */
922
+ '113321', /* 46 */
923
+ '133121', /* 47 */
924
+ '313121', /* 48 */
925
+ '211331', /* 49 */
926
+ '231131', /* 50 */
927
+ '213113', /* 51 */
928
+ '213311', /* 52 */
929
+ '213131', /* 53 */
930
+ '311123', /* 54 */
931
+ '311321', /* 55 */
932
+ '331121', /* 56 */
933
+ '312113', /* 57 */
934
+ '312311', /* 58 */
935
+ '332111', /* 59 */
936
+ '314111', /* 60 */
937
+ '221411', /* 61 */
938
+ '431111', /* 62 */
939
+ '111224', /* 63 */
940
+ '111422', /* 64 */
941
+ '121124', /* 65 */
942
+ '121421', /* 66 */
943
+ '141122', /* 67 */
944
+ '141221', /* 68 */
945
+ '112214', /* 69 */
946
+ '112412', /* 70 */
947
+ '122114', /* 71 */
948
+ '122411', /* 72 */
949
+ '142112', /* 73 */
950
+ '142211', /* 74 */
951
+ '241211', /* 75 */
952
+ '221114', /* 76 */
953
+ '413111', /* 77 */
954
+ '241112', /* 78 */
955
+ '134111', /* 79 */
956
+ '111242', /* 80 */
957
+ '121142', /* 81 */
958
+ '121241', /* 82 */
959
+ '114212', /* 83 */
960
+ '124112', /* 84 */
961
+ '124211', /* 85 */
962
+ '411212', /* 86 */
963
+ '421112', /* 87 */
964
+ '421211', /* 88 */
965
+ '212141', /* 89 */
966
+ '214121', /* 90 */
967
+ '412121', /* 91 */
968
+ '111143', /* 92 */
969
+ '111341', /* 93 */
970
+ '131141', /* 94 */
971
+ '114113', /* 95 */
972
+ '114311', /* 96 */
973
+ '411113', /* 97 */
974
+ '411311', /* 98 */
975
+ '113141', /* 99 */
976
+ '114131', /* 100 */
977
+ '311141', /* 101 */
978
+ '411131', /* 102 */
979
+ '211412', /* 103 START A */
980
+ '211214', /* 104 START B */
981
+ '211232', /* 105 START C */
982
+ '233111', /* STOP */
983
+ '200000' /* END */
984
+ );
985
+ $keys = '';
986
+ switch(strtoupper($type)) {
987
+ case 'A': {
988
+ $startid = 103;
989
+ $keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_';
990
+ for ($i = 0; $i < 32; ++$i) {
991
+ $keys .= chr($i);
992
+ }
993
+ break;
994
+ }
995
+ case 'B': {
996
+ $startid = 104;
997
+ $keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.chr(127);
998
+ break;
999
+ }
1000
+ case 'C': {
1001
+ $startid = 105;
1002
+ $keys = '';
1003
+ if ((strlen($code) % 2) != 0) {
1004
+ // The length of barcode value must be even ($code). You must pad the number with zeros
1005
+ return false;
1006
+ }
1007
+ for ($i = 0; $i <= 99; ++$i) {
1008
+ $keys .= chr($i);
1009
+ }
1010
+ $new_code = '';
1011
+ $hclen = (strlen($code) / 2);
1012
+ for ($i = 0; $i < $hclen; ++$i) {
1013
+ $new_code .= chr(intval($code{(2 * $i)}.$code{(2 * $i + 1)}));
1014
+ }
1015
+ $code = $new_code;
1016
+ break;
1017
+ }
1018
+ default: {
1019
+ return false;
1020
+ }
1021
+ }
1022
+
1023
+ // calculate check character
1024
+ $sum = $startid;
1025
+ if ($ean) { $code = chr(102) . $code; } // Add FNC 1 - which identifies it as EAN-128
1026
+ $clen = strlen($code);
1027
+ for ($i = 0; $i < $clen; ++$i) {
1028
+ if ($ean && $i==0) { $sum += 102; }
1029
+ else { $sum += (strpos($keys, $code[$i]) * ($i+1)); }
1030
+ }
1031
+ $check = ($sum % 103);
1032
+ $checkdigit = $check ;
1033
+ // add start, check and stop codes
1034
+ $code = chr($startid).$code.chr($check).chr(106).chr(107);
1035
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
1036
+ $k = 0;
1037
+ $len = strlen($code);
1038
+ for ($i = 0; $i < $len; ++$i) {
1039
+ $ck = strpos($keys, $code[$i]);
1040
+ if (($i == 0) || ($ean && $i==1) | ($i > ($len-4))) {
1041
+ $char_num = ord($code[$i]);
1042
+ $seq = $chr[$char_num];
1043
+ } elseif(($ck >= 0) AND isset($chr[$ck])) {
1044
+ $seq = $chr[$ck];
1045
+ } else {
1046
+ // invalid character
1047
+ return false;
1048
+ }
1049
+ for ($j = 0; $j < 6; ++$j) {
1050
+ if (($j % 2) == 0) {
1051
+ $t = true; // bar
1052
+ } else {
1053
+ $t = false; // space
1054
+ }
1055
+ $w = $seq[$j];
1056
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
1057
+ $bararray['maxw'] += $w;
1058
+ ++$k;
1059
+ }
1060
+ }
1061
+ $bararray['checkdigit'] = $checkdigit;
1062
+ return $bararray;
1063
+ }
1064
+
1065
+ /**
1066
+ * EAN13 and UPC-A barcodes.
1067
+ * EAN13: European Article Numbering international retail product code
1068
+ * UPC-A: Universal product code seen on almost all retail products in the USA and Canada
1069
+ * UPC-E: Short version of UPC symbol
1070
+ */
1071
+ protected function barcode_eanupc($code, $len=13) {
1072
+ $upce = false;
1073
+ $checkdigit = false;
1074
+ if ($len == 6) {
1075
+ $len = 12; // UPC-A
1076
+ $upce = true; // UPC-E mode
1077
+ }
1078
+ $data_len = $len - 1;
1079
+ //Padding
1080
+ $code = str_pad($code, $data_len, '0', STR_PAD_LEFT);
1081
+ $code_len = strlen($code);
1082
+ // calculate check digit
1083
+ $sum_a = 0;
1084
+ for ($i = 1; $i < $data_len; $i+=2) {
1085
+ $sum_a += $code[$i];
1086
+ }
1087
+ if ($len > 12) {
1088
+ $sum_a *= 3;
1089
+ }
1090
+ $sum_b = 0;
1091
+ for ($i = 0; $i < $data_len; $i+=2) {
1092
+ $sum_b += ($code[$i]);
1093
+ }
1094
+ if ($len < 13) {
1095
+ $sum_b *= 3;
1096
+ }
1097
+ $r = ($sum_a + $sum_b) % 10;
1098
+ if($r > 0) {
1099
+ $r = (10 - $r);
1100
+ }
1101
+ if ($code_len == $data_len) {
1102
+ // add check digit
1103
+ $code .= $r;
1104
+ $checkdigit = $r;
1105
+ } elseif ($r !== intval($code[$data_len])) {
1106
+ // wrong checkdigit
1107
+ return false;
1108
+ }
1109
+ if ($len == 12) {
1110
+ // UPC-A
1111
+ $code = '0'.$code;
1112
+ ++$len;
1113
+ }
1114
+ if ($upce) {
1115
+ // convert UPC-A to UPC-E
1116
+ $tmp = substr($code, 4, 3);
1117
+ $prod_code = intval(substr($code,7,5)); // product code
1118
+ $invalid_upce = false;
1119
+ if (($tmp == '000') OR ($tmp == '100') OR ($tmp == '200')) {
1120
+ // manufacturer code ends in 000, 100, or 200
1121
+ $upce_code = substr($code, 2, 2).substr($code, 9, 3).substr($code, 4, 1);
1122
+ if ($prod_code > 999) { $invalid_upce = true; }
1123
+ } else {
1124
+ $tmp = substr($code, 5, 2);
1125
+ if ($tmp == '00') {
1126
+ // manufacturer code ends in 00
1127
+ $upce_code = substr($code, 2, 3).substr($code, 10, 2).'3';
1128
+ if ($prod_code > 99) { $invalid_upce = true; }
1129
+ } else {
1130
+ $tmp = substr($code, 6, 1);
1131
+ if ($tmp == '0') {
1132
+ // manufacturer code ends in 0
1133
+ $upce_code = substr($code, 2, 4).substr($code, 11, 1).'4';
1134
+ if ($prod_code > 9) { $invalid_upce = true; }
1135
+ } else {
1136
+ // manufacturer code does not end in zero
1137
+ $upce_code = substr($code, 2, 5).substr($code, 11, 1);
1138
+ if ($prod_code > 9) { $invalid_upce = true; }
1139
+ }
1140
+ }
1141
+ }
1142
+ if ($invalid_upce) { die("Error - UPC-A cannot produce a valid UPC-E barcode"); } // Error generating a UPCE code
1143
+ }
1144
+ //Convert digits to bars
1145
+ $codes = array(
1146
+ 'A'=>array( // left odd parity
1147
+ '0'=>'0001101',
1148
+ '1'=>'0011001',
1149
+ '2'=>'0010011',
1150
+ '3'=>'0111101',
1151
+ '4'=>'0100011',
1152
+ '5'=>'0110001',
1153
+ '6'=>'0101111',
1154
+ '7'=>'0111011',
1155
+ '8'=>'0110111',
1156
+ '9'=>'0001011'),
1157
+ 'B'=>array( // left even parity
1158
+ '0'=>'0100111',
1159
+ '1'=>'0110011',
1160
+ '2'=>'0011011',
1161
+ '3'=>'0100001',
1162
+ '4'=>'0011101',
1163
+ '5'=>'0111001',
1164
+ '6'=>'0000101',
1165
+ '7'=>'0010001',
1166
+ '8'=>'0001001',
1167
+ '9'=>'0010111'),
1168
+ 'C'=>array( // right
1169
+ '0'=>'1110010',
1170
+ '1'=>'1100110',
1171
+ '2'=>'1101100',
1172
+ '3'=>'1000010',
1173
+ '4'=>'1011100',
1174
+ '5'=>'1001110',
1175
+ '6'=>'1010000',
1176
+ '7'=>'1000100',
1177
+ '8'=>'1001000',
1178
+ '9'=>'1110100')
1179
+ );
1180
+ $parities = array(
1181
+ '0'=>array('A','A','A','A','A','A'),
1182
+ '1'=>array('A','A','B','A','B','B'),
1183
+ '2'=>array('A','A','B','B','A','B'),
1184
+ '3'=>array('A','A','B','B','B','A'),
1185
+ '4'=>array('A','B','A','A','B','B'),
1186
+ '5'=>array('A','B','B','A','A','B'),
1187
+ '6'=>array('A','B','B','B','A','A'),
1188
+ '7'=>array('A','B','A','B','A','B'),
1189
+ '8'=>array('A','B','A','B','B','A'),
1190
+ '9'=>array('A','B','B','A','B','A')
1191
+ );
1192
+ $upce_parities = array();
1193
+ $upce_parities[0] = array(
1194
+ '0'=>array('B','B','B','A','A','A'),
1195
+ '1'=>array('B','B','A','B','A','A'),
1196
+ '2'=>array('B','B','A','A','B','A'),
1197
+ '3'=>array('B','B','A','A','A','B'),
1198
+ '4'=>array('B','A','B','B','A','A'),
1199
+ '5'=>array('B','A','A','B','B','A'),
1200
+ '6'=>array('B','A','A','A','B','B'),
1201
+ '7'=>array('B','A','B','A','B','A'),
1202
+ '8'=>array('B','A','B','A','A','B'),
1203
+ '9'=>array('B','A','A','B','A','B')
1204
+ );
1205
+ $upce_parities[1] = array(
1206
+ '0'=>array('A','A','A','B','B','B'),
1207
+ '1'=>array('A','A','B','A','B','B'),
1208
+ '2'=>array('A','A','B','B','A','B'),
1209
+ '3'=>array('A','A','B','B','B','A'),
1210
+ '4'=>array('A','B','A','A','B','B'),
1211
+ '5'=>array('A','B','B','A','A','B'),
1212
+ '6'=>array('A','B','B','B','A','A'),
1213
+ '7'=>array('A','B','A','B','A','B'),
1214
+ '8'=>array('A','B','A','B','B','A'),
1215
+ '9'=>array('A','B','B','A','B','A')
1216
+ );
1217
+ $k = 0;
1218
+ $seq = '101'; // left guard bar
1219
+ if ($upce) {
1220
+ $bararray = array('code' => $upce_code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
1221
+ $p = $upce_parities[$code{1}][$r];
1222
+ for ($i = 0; $i < 6; ++$i) {
1223
+ $seq .= $codes[$p[$i]][$upce_code[$i]];
1224
+ }
1225
+ $seq .= '010101'; // right guard bar
1226
+ } else {
1227
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
1228
+ $half_len = ceil($len / 2);
1229
+ if ($len == 8) {
1230
+ for ($i = 0; $i < $half_len; ++$i) {
1231
+ $seq .= $codes['A'][$code[$i]];
1232
+ }
1233
+ } else {
1234
+ $p = $parities[$code{0}];
1235
+ for ($i = 1; $i < $half_len; ++$i) {
1236
+ $seq .= $codes[$p[$i-1]][$code[$i]];
1237
+ }
1238
+ }
1239
+ $seq .= '01010'; // center guard bar
1240
+ for ($i = $half_len; $i < $len; ++$i) {
1241
+ $seq .= $codes['C'][$code[$i]];
1242
+ }
1243
+ $seq .= '101'; // right guard bar
1244
+ }
1245
+ $clen = strlen($seq);
1246
+ $w = 0;
1247
+ for ($i = 0; $i < $clen; ++$i) {
1248
+ $w += 1;
1249
+ if (($i == ($clen - 1)) OR (($i < ($clen - 1)) AND ($seq[$i] != $seq[($i+1)]))) {
1250
+ if ($seq[$i] == '1') {
1251
+ $t = true; // bar
1252
+ } else {
1253
+ $t = false; // space
1254
+ }
1255
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
1256
+ $bararray['maxw'] += $w;
1257
+ ++$k;
1258
+ $w = 0;
1259
+ }
1260
+ }
1261
+ $bararray['checkdigit'] = $checkdigit;
1262
+ return $bararray;
1263
+ }
1264
+
1265
+ /**
1266
+ * UPC-Based Extentions
1267
+ * 2-Digit Ext.: Used to indicate magazines and newspaper issue numbers
1268
+ * 5-Digit Ext.: Used to mark suggested retail price of books
1269
+ */
1270
+ protected function barcode_eanext($code, $len=5) {
1271
+ //Padding
1272
+ $code = str_pad($code, $len, '0', STR_PAD_LEFT);
1273
+ // calculate check digit
1274
+ if ($len == 2) {
1275
+ $r = $code % 4;
1276
+ } elseif ($len == 5) {
1277
+ $r = (3 * ($code{0} + $code{2} + $code{4})) + (9 * ($code{1} + $code{3}));
1278
+ $r %= 10;
1279
+ } else {
1280
+ return false;
1281
+ }
1282
+ //Convert digits to bars
1283
+ $codes = array(
1284
+ 'A'=>array( // left odd parity
1285
+ '0'=>'0001101',
1286
+ '1'=>'0011001',
1287
+ '2'=>'0010011',
1288
+ '3'=>'0111101',
1289
+ '4'=>'0100011',
1290
+ '5'=>'0110001',
1291
+ '6'=>'0101111',
1292
+ '7'=>'0111011',
1293
+ '8'=>'0110111',
1294
+ '9'=>'0001011'),
1295
+ 'B'=>array( // left even parity
1296
+ '0'=>'0100111',
1297
+ '1'=>'0110011',
1298
+ '2'=>'0011011',
1299
+ '3'=>'0100001',
1300
+ '4'=>'0011101',
1301
+ '5'=>'0111001',
1302
+ '6'=>'0000101',
1303
+ '7'=>'0010001',
1304
+ '8'=>'0001001',
1305
+ '9'=>'0010111')
1306
+ );
1307
+ $parities = array();
1308
+ $parities[2] = array(
1309
+ '0'=>array('A','A'),
1310
+ '1'=>array('A','B'),
1311
+ '2'=>array('B','A'),
1312
+ '3'=>array('B','B')
1313
+ );
1314
+ $parities[5] = array(
1315
+ '0'=>array('B','B','A','A','A'),
1316
+ '1'=>array('B','A','B','A','A'),
1317
+ '2'=>array('B','A','A','B','A'),
1318
+ '3'=>array('B','A','A','A','B'),
1319
+ '4'=>array('A','B','B','A','A'),
1320
+ '5'=>array('A','A','B','B','A'),
1321
+ '6'=>array('A','A','A','B','B'),
1322
+ '7'=>array('A','B','A','B','A'),
1323
+ '8'=>array('A','B','A','A','B'),
1324
+ '9'=>array('A','A','B','A','B')
1325
+ );
1326
+ $p = $parities[$len][$r];
1327
+ $seq = '1011'; // left guard bar
1328
+ $seq .= $codes[$p[0]][$code{0}];
1329
+ for ($i = 1; $i < $len; ++$i) {
1330
+ $seq .= '01'; // separator
1331
+ $seq .= $codes[$p[$i]][$code[$i]];
1332
+ }
1333
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
1334
+ return $this->binseq_to_array($seq, $bararray);
1335
+ }
1336
+
1337
+ /**
1338
+ * POSTNET and PLANET barcodes.
1339
+ * Used by U.S. Postal Service for automated mail sorting
1340
+ */
1341
+ protected function barcode_postnet($code, $planet=false) {
1342
+ // bar lenght
1343
+ if ($planet) {
1344
+ $barlen = Array(
1345
+ 0 => Array(1,1,2,2,2),
1346
+ 1 => Array(2,2,2,1,1),
1347
+ 2 => Array(2,2,1,2,1),
1348
+ 3 => Array(2,2,1,1,2),
1349
+ 4 => Array(2,1,2,2,1),
1350
+ 5 => Array(2,1,2,1,2),
1351
+ 6 => Array(2,1,1,2,2),
1352
+ 7 => Array(1,2,2,2,1),
1353
+ 8 => Array(1,2,2,1,2),
1354
+ 9 => Array(1,2,1,2,2)
1355
+ );
1356
+ } else {
1357
+ $barlen = Array(
1358
+ 0 => Array(2,2,1,1,1),
1359
+ 1 => Array(1,1,1,2,2),
1360
+ 2 => Array(1,1,2,1,2),
1361
+ 3 => Array(1,1,2,2,1),
1362
+ 4 => Array(1,2,1,1,2),
1363
+ 5 => Array(1,2,1,2,1),
1364
+ 6 => Array(1,2,2,1,1),
1365
+ 7 => Array(2,1,1,1,2),
1366
+ 8 => Array(2,1,1,2,1),
1367
+ 9 => Array(2,1,2,1,1)
1368
+ );
1369
+ }
1370
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 5, 'bcode' => array());
1371
+ $k = 0;
1372
+ $code = str_replace('-', '', $code);
1373
+ $code = str_replace(' ', '', $code);
1374
+ $len = strlen($code);
1375
+ // calculate checksum
1376
+ $sum = 0;
1377
+ for ($i = 0; $i < $len; ++$i) {
1378
+ $sum += intval($code[$i]);
1379
+ }
1380
+ $chkd = ($sum % 10);
1381
+ if($chkd > 0) {
1382
+ $chkd = (10 - $chkd);
1383
+ }
1384
+ $code .= $chkd;
1385
+ $checkdigit = $chkd;
1386
+ $len = strlen($code);
1387
+ // start bar
1388
+ $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 5, 'p' => 0);
1389
+ $bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 5, 'p' => 0);
1390
+ $bararray['maxw'] += (1 + $this->gapwidth );
1391
+ for ($i = 0; $i < $len; ++$i) {
1392
+ for ($j = 0; $j < 5; ++$j) {
1393
+ $bh = $barlen[$code[$i]][$j];
1394
+ if ($bh == 2) {
1395
+ $h = 5;
1396
+ $p = 0;
1397
+ }
1398
+ else {
1399
+ $h = 2;
1400
+ $p = 3;
1401
+ }
1402
+ $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
1403
+ $bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 2, 'p' => 0);
1404
+ $bararray['maxw'] += (1 + $this->gapwidth );
1405
+ }
1406
+ }
1407
+ // end bar
1408
+ $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 5, 'p' => 0);
1409
+ $bararray['maxw'] += 1;
1410
+ $bararray['checkdigit'] = $checkdigit;
1411
+ return $bararray;
1412
+ }
1413
+
1414
+ /**
1415
+ * RM4SCC - CBC - KIX
1416
+ * RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index)
1417
+ * RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service.
1418
+ */
1419
+ protected function barcode_rm4scc($code, $kix=false) {
1420
+ $notkix = !$kix;
1421
+ // bar mode
1422
+ // 1 = pos 1, length 2
1423
+ // 2 = pos 1, length 3
1424
+ // 3 = pos 2, length 1
1425
+ // 4 = pos 2, length 2
1426
+ $barmode = array(
1427
+ '0' => array(3,3,2,2),
1428
+ '1' => array(3,4,1,2),
1429
+ '2' => array(3,4,2,1),
1430
+ '3' => array(4,3,1,2),
1431
+ '4' => array(4,3,2,1),
1432
+ '5' => array(4,4,1,1),
1433
+ '6' => array(3,1,4,2),
1434
+ '7' => array(3,2,3,2),
1435
+ '8' => array(3,2,4,1),
1436
+ '9' => array(4,1,3,2),
1437
+ 'A' => array(4,1,4,1),
1438
+ 'B' => array(4,2,3,1),
1439
+ 'C' => array(3,1,2,4),
1440
+ 'D' => array(3,2,1,4),
1441
+ 'E' => array(3,2,2,3),
1442
+ 'F' => array(4,1,1,4),
1443
+ 'G' => array(4,1,2,3),
1444
+ 'H' => array(4,2,1,3),
1445
+ 'I' => array(1,3,4,2),
1446
+ 'J' => array(1,4,3,2),
1447
+ 'K' => array(1,4,4,1),
1448
+ 'L' => array(2,3,3,2),
1449
+ 'M' => array(2,3,4,1),
1450
+ 'N' => array(2,4,3,1),
1451
+ 'O' => array(1,3,2,4),
1452
+ 'P' => array(1,4,1,4),
1453
+ 'Q' => array(1,4,2,3),
1454
+ 'R' => array(2,3,1,4),
1455
+ 'S' => array(2,3,2,3),
1456
+ 'T' => array(2,4,1,3),
1457
+ 'U' => array(1,1,4,4),
1458
+ 'V' => array(1,2,3,4),
1459
+ 'W' => array(1,2,4,3),
1460
+ 'X' => array(2,1,3,4),
1461
+ 'Y' => array(2,1,4,3),
1462
+ 'Z' => array(2,2,3,3)
1463
+ );
1464
+ $code = strtoupper($code);
1465
+ $len = strlen($code);
1466
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => $this->daft['F'], 'bcode' => array());
1467
+ if ($notkix) {
1468
+ // table for checksum calculation (row,col)
1469
+ $checktable = array(
1470
+ '0' => array(1,1),
1471
+ '1' => array(1,2),
1472
+ '2' => array(1,3),
1473
+ '3' => array(1,4),
1474
+ '4' => array(1,5),
1475
+ '5' => array(1,0),
1476
+ '6' => array(2,1),
1477
+ '7' => array(2,2),
1478
+ '8' => array(2,3),
1479
+ '9' => array(2,4),
1480
+ 'A' => array(2,5),
1481
+ 'B' => array(2,0),
1482
+ 'C' => array(3,1),
1483
+ 'D' => array(3,2),
1484
+ 'E' => array(3,3),
1485
+ 'F' => array(3,4),
1486
+ 'G' => array(3,5),
1487
+ 'H' => array(3,0),
1488
+ 'I' => array(4,1),
1489
+ 'J' => array(4,2),
1490
+ 'K' => array(4,3),
1491
+ 'L' => array(4,4),
1492
+ 'M' => array(4,5),
1493
+ 'N' => array(4,0),
1494
+ 'O' => array(5,1),
1495
+ 'P' => array(5,2),
1496
+ 'Q' => array(5,3),
1497
+ 'R' => array(5,4),
1498
+ 'S' => array(5,5),
1499
+ 'T' => array(5,0),
1500
+ 'U' => array(0,1),
1501
+ 'V' => array(0,2),
1502
+ 'W' => array(0,3),
1503
+ 'X' => array(0,4),
1504
+ 'Y' => array(0,5),
1505
+ 'Z' => array(0,0)
1506
+ );
1507
+ $row = 0;
1508
+ $col = 0;
1509
+ for ($i = 0; $i < $len; ++$i) {
1510
+ $row += $checktable[$code[$i]][0];
1511
+ $col += $checktable[$code[$i]][1];
1512
+ }
1513
+ $row %= 6;
1514
+ $col %= 6;
1515
+ $chk = array_keys($checktable, array($row,$col));
1516
+ $code .= $chk[0];
1517
+ $bararray['checkdigit'] = $chk[0];
1518
+ ++$len;
1519
+ }
1520
+ $k = 0;
1521
+ if ($notkix) {
1522
+ // start bar
1523
+ $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $this->daft['A'] , 'p' => 0);
1524
+ $bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => $this->daft['A'] , 'p' => 0);
1525
+ $bararray['maxw'] += (1 + $this->gapwidth) ;
1526
+ }
1527
+ for ($i = 0; $i < $len; ++$i) {
1528
+ for ($j = 0; $j < 4; ++$j) {
1529
+ switch ($barmode[$code[$i]][$j]) {
1530
+ case 1: {
1531
+ // ascender (A)
1532
+ $p = 0;
1533
+ $h = $this->daft['A'];
1534
+ break;
1535
+ }
1536
+ case 2: {
1537
+ // full bar (F)
1538
+ $p = 0;
1539
+ $h = $this->daft['F'];
1540
+ break;
1541
+ }
1542
+ case 3: {
1543
+ // tracker (T)
1544
+ $p = ($this->daft['F'] - $this->daft['T'])/2;
1545
+ $h = $this->daft['T'];
1546
+ break;
1547
+ }
1548
+ case 4: {
1549
+ // descender (D)
1550
+ $p = $this->daft['F'] - $this->daft['D'];
1551
+ $h = $this->daft['D'];
1552
+ break;
1553
+ }
1554
+ }
1555
+
1556
+ $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
1557
+ $bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth, 'h' => 2, 'p' => 0);
1558
+ $bararray['maxw'] += (1 + $this->gapwidth) ;
1559
+ }
1560
+ }
1561
+ if ($notkix) {
1562
+ // stop bar
1563
+ $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $this->daft['F'], 'p' => 0);
1564
+ $bararray['maxw'] += 1;
1565
+ }
1566
+ return $bararray;
1567
+ }
1568
+
1569
+ /**
1570
+ * CODABAR barcodes.
1571
+ * Older code often used in library systems, sometimes in blood banks
1572
+ */
1573
+ protected function barcode_codabar($code) {
1574
+ $chr = array(
1575
+ '0' => '11111221',
1576
+ '1' => '11112211',
1577
+ '2' => '11121121',
1578
+ '3' => '22111111',
1579
+ '4' => '11211211',
1580
+ '5' => '21111211',
1581
+ '6' => '12111121',
1582
+ '7' => '12112111',
1583
+ '8' => '12211111',
1584
+ '9' => '21121111',
1585
+ '-' => '11122111',
1586
+ '$' => '11221111',
1587
+ ':' => '21112121',
1588
+ '/' => '21211121',
1589
+ '.' => '21212111',
1590
+ '+' => '11222221',
1591
+ 'A' => '11221211',
1592
+ 'B' => '12121121',
1593
+ 'C' => '11121221',
1594
+ 'D' => '11122211'
1595
+ );
1596
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
1597
+ $k = 0;
1598
+ $w = 0;
1599
+ $seq = '';
1600
+ $code = strtoupper($code);
1601
+ $len = strlen($code);
1602
+ for ($i = 0; $i < $len; ++$i) {
1603
+ if (!isset($chr[$code[$i]])) {
1604
+ return false;
1605
+ }
1606
+ $seq = $chr[$code[$i]];
1607
+ for ($j = 0; $j < 8; ++$j) {
1608
+ if (($j % 2) == 0) {
1609
+ $t = true; // bar
1610
+ } else {
1611
+ $t = false; // space
1612
+ }
1613
+ $x = $seq[$j];
1614
+ if ($x == 2) { $w = $this->print_ratio; }
1615
+ else { $w = 1; }
1616
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
1617
+ $bararray['maxw'] += $w;
1618
+ ++$k;
1619
+ }
1620
+ }
1621
+ return $bararray;
1622
+ }
1623
+
1624
+ /**
1625
+ * CODE11 barcodes.
1626
+ * Used primarily for labeling telecommunications equipment
1627
+ */
1628
+ protected function barcode_code11($code) {
1629
+ $chr = array(
1630
+ '0' => '111121',
1631
+ '1' => '211121',
1632
+ '2' => '121121',
1633
+ '3' => '221111',
1634
+ '4' => '112121',
1635
+ '5' => '212111',
1636
+ '6' => '122111',
1637
+ '7' => '111221',
1638
+ '8' => '211211',
1639
+ '9' => '211111',
1640
+ '-' => '112111',
1641
+ 'S' => '112211'
1642
+ );
1643
+
1644
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
1645
+ $k = 0;
1646
+ $w = 0;
1647
+ $seq = '';
1648
+ $len = strlen($code);
1649
+ // calculate check digit C
1650
+ $p = 1;
1651
+ $check = 0;
1652
+ for ($i = ($len - 1); $i >= 0; --$i) {
1653
+ $digit = $code[$i];
1654
+ if ($digit == '-') {
1655
+ $dval = 10;
1656
+ } else {
1657
+ $dval = intval($digit);
1658
+ }
1659
+ $check += ($dval * $p);
1660
+ ++$p;
1661
+ if ($p > 10) {
1662
+ $p = 1;
1663
+ }
1664
+ }
1665
+ $check %= 11;
1666
+ if ($check == 10) {
1667
+ $check = '-';
1668
+ }
1669
+ $code .= $check;
1670
+ $checkdigit = $check;
1671
+ if ($len > 10) {
1672
+ // calculate check digit K
1673
+ $p = 1;
1674
+ $check = 0;
1675
+ for ($i = $len; $i >= 0; --$i) {
1676
+ $digit = $code[$i];
1677
+ if ($digit == '-') {
1678
+ $dval = 10;
1679
+ } else {
1680
+ $dval = intval($digit);
1681
+ }
1682
+ $check += ($dval * $p);
1683
+ ++$p;
1684
+ if ($p > 9) {
1685
+ $p = 1;
1686
+ }
1687
+ }
1688
+ $check %= 11;
1689
+ $code .= $check;
1690
+ $checkdigit .= $check;
1691
+ ++$len;
1692
+ }
1693
+ $code = 'S'.$code.'S';
1694
+ $len += 3;
1695
+ for ($i = 0; $i < $len; ++$i) {
1696
+ if (!isset($chr[$code[$i]])) {
1697
+ return false;
1698
+ }
1699
+ $seq = $chr[$code[$i]];
1700
+ for ($j = 0; $j < 6; ++$j) {
1701
+ if (($j % 2) == 0) {
1702
+ $t = true; // bar
1703
+ } else {
1704
+ $t = false; // space
1705
+ }
1706
+ $x = $seq[$j];
1707
+ if ($x == 2) { $w = $this->print_ratio; }
1708
+ else { $w = 1; }
1709
+ $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
1710
+ $bararray['maxw'] += $w;
1711
+ ++$k;
1712
+ }
1713
+ }
1714
+ $bararray['checkdigit'] = $checkdigit;
1715
+ return $bararray;
1716
+ }
1717
+
1718
+
1719
+ /**
1720
+ * IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
1721
+ * (requires PHP bcmath extension)
1722
+ * Intelligent Mail barcode is a 65-bar code for use on mail in the United States.
1723
+ * The fields are described as follows:<ul><li>The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0-4. The allowable encoding ranges shall be 00-04, 10-14, 20-24, 30-34, 40-44, 50-54, 60-64, 70-74, 80-84, and 90-94.</li><li>The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000-999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.</li><li>The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.</li><li>The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000-999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000-99999, 000000000-999999999, and 00000000000-99999999999.</li></ul>
1724
+ */
1725
+ protected function barcode_imb($code) {
1726
+ $asc_chr = array(4,0,2,6,3,5,1,9,8,7,1,2,0,6,4,8,2,9,5,3,0,1,3,7,4,6,8,9,2,0,5,1,9,4,3,8,6,7,1,2,4,3,9,5,7,8,3,0,2,1,4,0,9,1,7,0,2,4,6,3,7,1,9,5,8);
1727
+ $dsc_chr = array(7,1,9,5,8,0,2,4,6,3,5,8,9,7,3,0,6,1,7,4,6,8,9,2,5,1,7,5,4,3,8,7,6,0,2,5,4,9,3,0,1,6,8,2,0,4,5,9,6,7,5,2,6,3,8,5,1,9,8,7,4,0,2,6,3);
1728
+ $asc_pos = array(3,0,8,11,1,12,8,11,10,6,4,12,2,7,9,6,7,9,2,8,4,0,12,7,10,9,0,7,10,5,7,9,6,8,2,12,1,4,2,0,1,5,4,6,12,1,0,9,4,7,5,10,2,6,9,11,2,12,6,7,5,11,0,3,2);
1729
+ $dsc_pos = array(2,10,12,5,9,1,5,4,3,9,11,5,10,1,6,3,4,1,10,0,2,11,8,6,1,12,3,8,6,4,4,11,0,6,1,9,11,5,3,7,3,10,7,11,8,2,10,3,5,8,0,3,12,11,8,4,5,1,3,0,7,12,9,8,10);
1730
+ $code_arr = explode('-', $code);
1731
+ $tracking_number = $code_arr[0];
1732
+ if (isset($code_arr[1])) {
1733
+ $routing_code = $code_arr[1];
1734
+ } else {
1735
+ $routing_code = '';
1736
+ }
1737
+ // Conversion of Routing Code
1738
+ switch (strlen($routing_code)) {
1739
+ case 0: {
1740
+ $binary_code = 0;
1741
+ break;
1742
+ }
1743
+ case 5: {
1744
+ $binary_code = bcadd($routing_code, '1');
1745
+ break;
1746
+ }
1747
+ case 9: {
1748
+ $binary_code = bcadd($routing_code, '100001');
1749
+ break;
1750
+ }
1751
+ case 11: {
1752
+ $binary_code = bcadd($routing_code, '1000100001');
1753
+ break;
1754
+ }
1755
+ default: {
1756
+ return false;
1757
+ break;
1758
+ }
1759
+ }
1760
+ $binary_code = bcmul($binary_code, 10);
1761
+ $binary_code = bcadd($binary_code, $tracking_number{0});
1762
+ $binary_code = bcmul($binary_code, 5);
1763
+ $binary_code = bcadd($binary_code, $tracking_number{1});
1764
+ $binary_code .= substr($tracking_number, 2, 18);
1765
+ // convert to hexadecimal
1766
+ $binary_code = $this->dec_to_hex($binary_code);
1767
+ // pad to get 13 bytes
1768
+ $binary_code = str_pad($binary_code, 26, '0', STR_PAD_LEFT);
1769
+ // convert string to array of bytes
1770
+ $binary_code_arr = chunk_split($binary_code, 2, "\r");
1771
+ $binary_code_arr = substr($binary_code_arr, 0, -1);
1772
+ $binary_code_arr = explode("\r", $binary_code_arr);
1773
+ // calculate frame check sequence
1774
+ $fcs = $this->imb_crc11fcs($binary_code_arr);
1775
+ // exclude first 2 bits from first byte
1776
+ $first_byte = sprintf('%2s', dechex((hexdec($binary_code_arr[0]) << 2) >> 2));
1777
+ $binary_code_102bit = $first_byte.substr($binary_code, 2);
1778
+ // convert binary data to codewords
1779
+ $codewords = array();
1780
+ $data = $this->hex_to_dec($binary_code_102bit);
1781
+ $codewords[0] = bcmod($data, 636) * 2;
1782
+ $data = bcdiv($data, 636);
1783
+ for ($i = 1; $i < 9; ++$i) {
1784
+ $codewords[$i] = bcmod($data, 1365);
1785
+ $data = bcdiv($data, 1365);
1786
+ }
1787
+ $codewords[9] = $data;
1788
+ if (($fcs >> 10) == 1) {
1789
+ $codewords[9] += 659;
1790
+ }
1791
+ // generate lookup tables
1792
+ $table2of13 = $this->imb_tables(2, 78);
1793
+ $table5of13 = $this->imb_tables(5, 1287);
1794
+ // convert codewords to characters
1795
+ $characters = array();
1796
+ $bitmask = 512;
1797
+ foreach($codewords as $k => $val) {
1798
+ if ($val <= 1286) {
1799
+ $chrcode = $table5of13[$val];
1800
+ } else {
1801
+ $chrcode = $table2of13[($val - 1287)];
1802
+ }
1803
+ if (($fcs & $bitmask) > 0) {
1804
+ // bitwise invert
1805
+ $chrcode = ((~$chrcode) & 8191);
1806
+ }
1807
+ $characters[] = $chrcode;
1808
+ $bitmask /= 2;
1809
+ }
1810
+ $characters = array_reverse($characters);
1811
+ // build bars
1812
+ $k = 0;
1813
+ $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => $this->daft['F'], 'bcode' => array());
1814
+ for ($i = 0; $i < 65; ++$i) {
1815
+ $asc = (($characters[$asc_chr[$i]] & pow(2, $asc_pos[$i])) > 0);
1816
+ $dsc = (($characters[$dsc_chr[$i]] & pow(2, $dsc_pos[$i])) > 0);
1817
+ if ($asc AND $dsc) {
1818
+ // full bar (F)
1819
+ $p = 0;
1820
+ $h = $this->daft['F'];
1821
+ } elseif ($asc) {
1822
+ // ascender (A)
1823
+ $p = 0;
1824
+ $h = $this->daft['A'];
1825
+ } elseif ($dsc) {
1826
+ // descender (D)
1827
+ $p = $this->daft['F'] - $this->daft['D'];
1828
+ $h = $this->daft['D'];
1829
+ } else {
1830
+ // tracker (T)
1831
+ $p = ($this->daft['F'] - $this->daft['T'])/2;
1832
+ $h = $this->daft['T'];
1833
+ }
1834
+ $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
1835
+ // Gap
1836
+ $bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 1, 'p' => 0);
1837
+ $bararray['maxw'] += (1 + $this->gapwidth );
1838
+ }
1839
+ unset($bararray['bcode'][($k - 1)]);
1840
+ $bararray['maxw'] -= $this->gapwidth ;
1841
+ return $bararray;
1842
+ }
1843
+
1844
+ /**
1845
+ * Convert large integer number to hexadecimal representation.
1846
+ * (requires PHP bcmath extension)
1847
+ */
1848
+ public function dec_to_hex($number) {
1849
+ $i = 0;
1850
+ $hex = array();
1851
+ if($number == 0) {
1852
+ return '00';
1853
+ }
1854
+ while($number > 0) {
1855
+ if($number == 0) {
1856
+ array_push($hex, '0');
1857
+ } else {
1858
+ array_push($hex, strtoupper(dechex(bcmod($number, '16'))));
1859
+ $number = bcdiv($number, '16', 0);
1860
+ }
1861
+ }
1862
+ $hex = array_reverse($hex);
1863
+ return implode($hex);
1864
+ }
1865
+
1866
+ /**
1867
+ * Convert large hexadecimal number to decimal representation (string).
1868
+ * (requires PHP bcmath extension)
1869
+ */
1870
+ public function hex_to_dec($hex) {
1871
+ $dec = 0;
1872
+ $bitval = 1;
1873
+ $len = strlen($hex);
1874
+ for($pos = ($len - 1); $pos >= 0; --$pos) {
1875
+ $dec = bcadd($dec, bcmul(hexdec($hex[$pos]), $bitval));
1876
+ $bitval = bcmul($bitval, 16);
1877
+ }
1878
+ return $dec;
1879
+ }
1880
+
1881
+ /**
1882
+ * Intelligent Mail Barcode calculation of Frame Check Sequence
1883
+ */
1884
+ protected function imb_crc11fcs($code_arr) {
1885
+ $genpoly = 0x0F35; // generator polynomial
1886
+ $fcs = 0x07FF; // Frame Check Sequence
1887
+ // do most significant byte skipping the 2 most significant bits
1888
+ $data = hexdec($code_arr[0]) << 5;
1889
+ for ($bit = 2; $bit < 8; ++$bit) {
1890
+ if (($fcs ^ $data) & 0x400) {
1891
+ $fcs = ($fcs << 1) ^ $genpoly;
1892
+ } else {
1893
+ $fcs = ($fcs << 1);
1894
+ }
1895
+ $fcs &= 0x7FF;
1896
+ $data <<= 1;
1897
+ }
1898
+ // do rest of bytes
1899
+ for ($byte = 1; $byte < 13; ++$byte) {
1900
+ $data = hexdec($code_arr[$byte]) << 3;
1901
+ for ($bit = 0; $bit < 8; ++$bit) {
1902
+ if (($fcs ^ $data) & 0x400) {
1903
+ $fcs = ($fcs << 1) ^ $genpoly;
1904
+ } else {
1905
+ $fcs = ($fcs << 1);
1906
+ }
1907
+ $fcs &= 0x7FF;
1908
+ $data <<= 1;
1909
+ }
1910
+ }
1911
+ return $fcs;
1912
+ }
1913
+
1914
+ /**
1915
+ * Reverse unsigned short value
1916
+ */
1917
+ protected function imb_reverse_us($num) {
1918
+ $rev = 0;
1919
+ for ($i = 0; $i < 16; ++$i) {
1920
+ $rev <<= 1;
1921
+ $rev |= ($num & 1);
1922
+ $num >>= 1;
1923
+ }
1924
+ return $rev;
1925
+ }
1926
+
1927
+ /**
1928
+ * generate Nof13 tables used for Intelligent Mail Barcode
1929
+ */
1930
+ protected function imb_tables($n, $size) {
1931
+ $table = array();
1932
+ $lli = 0; // LUT lower index
1933
+ $lui = $size - 1; // LUT upper index
1934
+ for ($count = 0; $count < 8192; ++$count) {
1935
+ $bit_count = 0;
1936
+ for ($bit_index = 0; $bit_index < 13; ++$bit_index) {
1937
+ $bit_count += intval(($count & (1 << $bit_index)) != 0);
1938
+ }
1939
+ // if we don't have the right number of bits on, go on to the next value
1940
+ if ($bit_count == $n) {
1941
+ $reverse = ($this->imb_reverse_us($count) >> 3);
1942
+ // if the reverse is less than count, we have already visited this pair before
1943
+ if ($reverse >= $count) {
1944
+ // If count is symmetric, place it at the first free slot from the end of the list.
1945
+ // Otherwise, place it at the first free slot from the beginning of the list AND place $reverse ath the next free slot from the beginning of the list
1946
+ if ($reverse == $count) {
1947
+ $table[$lui] = $count;
1948
+ --$lui;
1949
+ } else {
1950
+ $table[$lli] = $count;
1951
+ ++$lli;
1952
+ $table[$lli] = $reverse;
1953
+ ++$lli;
1954
+ }
1955
+ }
1956
+ }
1957
+ }
1958
+ return $table;
1959
+ }
1960
+
1961
+ } // end of class
1962
+
1963
+ //============================================================+
1964
+ // END OF FILE
1965
+ //============================================================+
1966
+ ?>
mPDF/classes/bmp.php ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class bmp {
4
+
5
+ var $mpdf = null;
6
+
7
+ function bmp(&$mpdf) {
8
+ $this->mpdf = $mpdf;
9
+ }
10
+
11
+
12
+ function _getBMPimage($data, $file) {
13
+ $info = array();
14
+ // Adapted from script by Valentin Schmidt
15
+ // http://staff.dasdeck.de/valentin/fpdf/fpdf_bmp/
16
+ $bfOffBits=$this->_fourbytes2int_le(substr($data,10,4));
17
+ $width=$this->_fourbytes2int_le(substr($data,18,4));
18
+ $height=$this->_fourbytes2int_le(substr($data,22,4));
19
+ $flip = ($height<0);
20
+ if ($flip) $height =-$height;
21
+ $biBitCount=$this->_twobytes2int_le(substr($data,28,2));
22
+ $biCompression=$this->_fourbytes2int_le(substr($data,30,4));
23
+ $info = array('w'=>$width, 'h'=>$height);
24
+ if ($biBitCount<16){
25
+ $info['cs'] = 'Indexed';
26
+ $info['bpc'] = $biBitCount;
27
+ $palStr = substr($data,54,($bfOffBits-54));
28
+ $pal = '';
29
+ $cnt = strlen($palStr)/4;
30
+ for ($i=0;$i<$cnt;$i++){
31
+ $n = 4*$i;
32
+ $pal .= $palStr[$n+2].$palStr[$n+1].$palStr[$n];
33
+ }
34
+ $info['pal'] = $pal;
35
+ }
36
+ else{
37
+ $info['cs'] = 'DeviceRGB';
38
+ $info['bpc'] = 8;
39
+ }
40
+
41
+ if ($this->mpdf->restrictColorSpace==1 || $this->mpdf->PDFX || $this->mpdf->restrictColorSpace==3) {
42
+ if (($this->mpdf->PDFA && !$this->mpdf->PDFAauto) || ($this->mpdf->PDFX && !$this->mpdf->PDFXauto)) { $this->mpdf->PDFAXwarnings[] = "Image cannot be converted to suitable colour space for PDFA or PDFX file - ".$file." - (Image replaced by 'no-image'.)"; }
43
+ return array('error' => "BMP Image cannot be converted to suitable colour space - ".$file." - (Image replaced by 'no-image'.)");
44
+ }
45
+
46
+ $biXPelsPerMeter=$this->_fourbytes2int_le(substr($data,38,4)); // horizontal pixels per meter, usually set to zero
47
+ //$biYPelsPerMeter=$this->_fourbytes2int_le(substr($data,42,4)); // vertical pixels per meter, usually set to zero
48
+ $biXPelsPerMeter=round($biXPelsPerMeter/1000 *25.4);
49
+ //$biYPelsPerMeter=round($biYPelsPerMeter/1000 *25.4);
50
+ $info['set-dpi'] = $biXPelsPerMeter;
51
+
52
+ switch ($biCompression){
53
+ case 0:
54
+ $str = substr($data,$bfOffBits);
55
+ break;
56
+ case 1: # BI_RLE8
57
+ $str = $this->rle8_decode(substr($data,$bfOffBits), $width);
58
+ break;
59
+ case 2: # BI_RLE4
60
+ $str = $this->rle4_decode(substr($data,$bfOffBits), $width);
61
+ break;
62
+ }
63
+ $bmpdata = '';
64
+ $padCnt = (4-ceil(($width/(8/$biBitCount)))%4)%4;
65
+ switch ($biBitCount){
66
+ case 1:
67
+ case 4:
68
+ case 8:
69
+ $w = floor($width/(8/$biBitCount)) + ($width%(8/$biBitCount)?1:0);
70
+ $w_row = $w + $padCnt;
71
+ if ($flip){
72
+ for ($y=0;$y<$height;$y++){
73
+ $y0 = $y*$w_row;
74
+ for ($x=0;$x<$w;$x++)
75
+ $bmpdata .= $str[$y0+$x];
76
+ }
77
+ }else{
78
+ for ($y=$height-1;$y>=0;$y--){
79
+ $y0 = $y*$w_row;
80
+ for ($x=0;$x<$w;$x++)
81
+ $bmpdata .= $str[$y0+$x];
82
+ }
83
+ }
84
+ break;
85
+
86
+ case 16:
87
+ $w_row = $width*2 + $padCnt;
88
+ if ($flip){
89
+ for ($y=0;$y<$height;$y++){
90
+ $y0 = $y*$w_row;
91
+ for ($x=0;$x<$width;$x++){
92
+ $n = (ord( $str[$y0 + 2*$x + 1])*256 + ord( $str[$y0 + 2*$x]));
93
+ $b = ($n & 31)<<3; $g = ($n & 992)>>2; $r = ($n & 31744)>>7128;
94
+ $bmpdata .= chr($r) . chr($g) . chr($b);
95
+ }
96
+ }
97
+ }else{
98
+ for ($y=$height-1;$y>=0;$y--){
99
+ $y0 = $y*$w_row;
100
+ for ($x=0;$x<$width;$x++){
101
+ $n = (ord( $str[$y0 + 2*$x + 1])*256 + ord( $str[$y0 + 2*$x]));
102
+ $b = ($n & 31)<<3; $g = ($n & 992)>>2; $r = ($n & 31744)>>7;
103
+ $bmpdata .= chr($r) . chr($g) . chr($b);
104
+ }
105
+ }
106
+ }
107
+ break;
108
+
109
+ case 24:
110
+ case 32:
111
+ $byteCnt = $biBitCount/8;
112
+ $w_row = $width*$byteCnt + $padCnt;
113
+
114
+ if ($flip){
115
+ for ($y=0;$y<$height;$y++){
116
+ $y0 = $y*$w_row;
117
+ for ($x=0;$x<$width;$x++){
118
+ $i = $y0 + $x*$byteCnt ; # + 1
119
+ $bmpdata .= $str[$i+2].$str[$i+1].$str[$i];
120
+ }
121
+ }
122
+ }else{
123
+ for ($y=$height-1;$y>=0;$y--){
124
+ $y0 = $y*$w_row;
125
+ for ($x=0;$x<$width;$x++){
126
+ $i = $y0 + $x*$byteCnt ; # + 1
127
+ $bmpdata .= $str[$i+2].$str[$i+1].$str[$i];
128
+ }
129
+ }
130
+ }
131
+ break;
132
+
133
+ default:
134
+ return array('error' => 'Error parsing BMP image - Unsupported image biBitCount');
135
+ }
136
+ if ($this->mpdf->compress) {
137
+ $bmpdata=gzcompress($bmpdata);
138
+ $info['f']='FlateDecode';
139
+ }
140
+ $info['data']=$bmpdata;
141
+ $info['type']='bmp';
142
+ return $info;
143
+ }
144
+
145
+ function _fourbytes2int_le($s) {
146
+ //Read a 4-byte integer from string
147
+ return (ord($s[3])<<24) + (ord($s[2])<<16) + (ord($s[1])<<8) + ord($s[0]);
148
+ }
149
+
150
+ function _twobytes2int_le($s) {
151
+ //Read a 2-byte integer from string
152
+ return (ord(substr($s, 1, 1))<<8) + ord(substr($s, 0, 1));
153
+ }
154
+
155
+
156
+ # Decoder for RLE8 compression in windows bitmaps
157
+ # see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_6x0u.asp
158
+ function rle8_decode ($str, $width){
159
+ $lineWidth = $width + (3 - ($width-1) % 4);
160
+ $out = '';
161
+ $cnt = strlen($str);
162
+ for ($i=0;$i<$cnt;$i++){
163
+ $o = ord($str[$i]);
164
+ switch ($o){
165
+ case 0: # ESCAPE
166
+ $i++;
167
+ switch (ord($str[$i])){
168
+ case 0: # NEW LINE
169
+ $padCnt = $lineWidth - strlen($out)%$lineWidth;
170
+ if ($padCnt<$lineWidth) $out .= str_repeat(chr(0), $padCnt); # pad line
171
+ break;
172
+ case 1: # END OF FILE
173
+ $padCnt = $lineWidth - strlen($out)%$lineWidth;
174
+ if ($padCnt<$lineWidth) $out .= str_repeat(chr(0), $padCnt); # pad line
175
+ break 3;
176
+ case 2: # DELTA
177
+ $i += 2;
178
+ break;
179
+ default: # ABSOLUTE MODE
180
+ $num = ord($str[$i]);
181
+ for ($j=0;$j<$num;$j++)
182
+ $out .= $str[++$i];
183
+ if ($num % 2) $i++;
184
+ }
185
+ break;
186
+ default:
187
+ $out .= str_repeat($str[++$i], $o);
188
+ }
189
+ }
190
+ return $out;
191
+ }
192
+
193
+ # Decoder for RLE4 compression in windows bitmaps
194
+ # see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_6x0u.asp
195
+ function rle4_decode ($str, $width){
196
+ $w = floor($width/2) + ($width % 2);
197
+ $lineWidth = $w + (3 - ( ($width-1) / 2) % 4);
198
+ $pixels = array();
199
+ $cnt = strlen($str);
200
+ for ($i=0;$i<$cnt;$i++){
201
+ $o = ord($str[$i]);
202
+ switch ($o){
203
+ case 0: # ESCAPE
204
+ $i++;
205
+ switch (ord($str[$i])){
206
+ case 0: # NEW LINE
207
+ while (count($pixels)%$lineWidth!=0)
208
+ $pixels[]=0;
209
+ break;
210
+ case 1: # END OF FILE
211
+ while (count($pixels)%$lineWidth!=0)
212
+ $pixels[]=0;
213
+ break 3;
214
+ case 2: # DELTA
215
+ $i += 2;
216
+ break;
217
+ default: # ABSOLUTE MODE
218
+ $num = ord($str[$i]);
219
+ for ($j=0;$j<$num;$j++){
220
+ if ($j%2==0){
221
+ $c = ord($str[++$i]);
222
+ $pixels[] = ($c & 240)>>4;
223
+ } else
224
+ $pixels[] = $c & 15;
225
+ }
226
+ if ($num % 2) $i++;
227
+ }
228
+ break;
229
+ default:
230
+ $c = ord($str[++$i]);
231
+ for ($j=0;$j<$o;$j++)
232
+ $pixels[] = ($j%2==0 ? ($c & 240)>>4 : $c & 15);
233
+ }
234
+ }
235
+
236
+ $out = '';
237
+ if (count($pixels)%2) $pixels[]=0;
238
+ $cnt = count($pixels)/2;
239
+ for ($i=0;$i<$cnt;$i++)
240
+ $out .= chr(16*$pixels[2*$i] + $pixels[2*$i+1]);
241
+ return $out;
242
+ }
243
+
244
+
245
+
246
+ }
247
+
248
+ ?>
mPDF/classes/cssmgr.php ADDED
@@ -0,0 +1,1566 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class cssmgr {
4
+
5
+ var $mpdf = null;
6
+
7
+ var $tablecascadeCSS;
8
+ var $listcascadeCSS;
9
+ var $cascadeCSS;
10
+ var $CSS;
11
+ var $tbCSSlvl;
12
+ var $listCSSlvl;
13
+
14
+
15
+ function cssmgr(&$mpdf) {
16
+ $this->mpdf = $mpdf;
17
+ $this->tablecascadeCSS = array();
18
+ $this->listcascadeCSS = array();
19
+ $this->CSS=array();
20
+ $this->cascadeCSS = array();
21
+ $this->tbCSSlvl = 0;
22
+ $this->listCSSlvl = 0;
23
+ }
24
+
25
+
26
+ function ReadDefaultCSS($CSSstr) {
27
+ $CSS = array();
28
+ $CSSstr = preg_replace('|/\*.*?\*/|s',' ',$CSSstr);
29
+ $CSSstr = preg_replace('/[\s\n\r\t\f]/s',' ',$CSSstr);
30
+ $CSSstr = preg_replace('/(<\!\-\-|\-\->)/s',' ',$CSSstr);
31
+ if ($CSSstr ) {
32
+ preg_match_all('/(.*?)\{(.*?)\}/',$CSSstr,$styles);
33
+ for($i=0; $i < count($styles[1]) ; $i++) {
34
+ $stylestr= trim($styles[2][$i]);
35
+ $stylearr = explode(';',$stylestr);
36
+ foreach($stylearr AS $sta) {
37
+ if (trim($sta)) {
38
+ // Changed to allow style="background: url('http://www.bpm1.com/bg.jpg')"
39
+ list($property,$value) = explode(':',$sta,2);
40
+ $property = trim($property);
41
+ $value = preg_replace('/\s*!important/i','',$value);
42
+ $value = trim($value);
43
+ if ($property && ($value || $value==='0')) {
44
+ $classproperties[strtoupper($property)] = $value;
45
+ }
46
+ }
47
+ }
48
+ $classproperties = $this->fixCSS($classproperties);
49
+ $tagstr = strtoupper(trim($styles[1][$i]));
50
+ $tagarr = explode(',',$tagstr);
51
+ foreach($tagarr AS $tg) {
52
+ $tags = preg_split('/\s+/',trim($tg));
53
+ $level = count($tags);
54
+ if ($level == 1) { // e.g. p or .class or #id or p.class or p#id
55
+ $t = trim($tags[0]);
56
+ if ($t) {
57
+ $tag = '';
58
+ if (preg_match('/^('.$this->mpdf->allowedCSStags.')$/',$t)) { $tag= $t; }
59
+ if ($this->CSS[$tag] && $tag) { $CSS[$tag] = $this->array_merge_recursive_unique($CSS[$tag], $classproperties); }
60
+ else if ($tag) { $CSS[$tag] = $classproperties; }
61
+ }
62
+ }
63
+ }
64
+ $properties = array();
65
+ $values = array();
66
+ $classproperties = array();
67
+ }
68
+
69
+ } // end of if
70
+ return $CSS;
71
+ }
72
+
73
+
74
+
75
+ function ReadCSS($html) {
76
+ preg_match_all('/<style[^>]*media=["\']([^"\'>]*)["\'].*?<\/style>/is',$html,$m);
77
+ for($i=0; $i<count($m[0]); $i++) {
78
+ if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) {
79
+ $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
80
+ }
81
+ }
82
+ preg_match_all('/<link[^>]*media=["\']([^"\'>]*)["\'].*?>/is',$html,$m);
83
+ for($i=0; $i<count($m[0]); $i++) {
84
+ if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) {
85
+ $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
86
+ }
87
+ }
88
+
89
+ // mPDF 5.5.02
90
+ // Remove Comment tags <!-- ... --> inside CSS as <style> in HTML document
91
+ // Remove Comment tags /* ... */ inside CSS as <style> in HTML document
92
+ // But first, we replace upper and mixed case closing style tag with lower
93
+ // case so we can use str_replace later.
94
+ preg_replace('/<\/style>/i', '</style>', $html);
95
+ preg_match_all('/<style.*?>(.*?)<\/style>/si',$html,$m);
96
+ if (count($m[1])) {
97
+ for($i=0;$i<count($m[1]);$i++) {
98
+ // Remove comment tags
99
+ $sub = preg_replace('/(<\!\-\-|\-\->)/s',' ',$m[1][$i]);
100
+ $sub = '>'.preg_replace('|/\*.*?\*/|s',' ',$sub).'</style>';
101
+ $html = str_replace('>'.$m[1][$i].'</style>', $sub, $html);
102
+ }
103
+ }
104
+
105
+
106
+ $html = preg_replace('/<!--mpdf/i','',$html);
107
+ $html = preg_replace('/mpdf-->/i','',$html);
108
+ $html = preg_replace('/<\!\-\-.*?\-\->/s',' ',$html);
109
+
110
+ $match = 0; // no match for instance
111
+ $regexp = ''; // This helps debugging: showing what is the REAL string being processed
112
+ $CSSext = array();
113
+
114
+ //CSS inside external files
115
+ $regexp = '/<link[^>]*rel=["\']stylesheet["\'][^>]*href=["\']([^>"\']*)["\'].*?>/si';
116
+ $x = preg_match_all($regexp,$html,$cxt);
117
+ if ($x) {
118
+ $match += $x;
119
+ $CSSext = $cxt[1];
120
+ }
121
+
122
+ $regexp = '/<link[^>]*href=["\']([^>"\']*)["\'][^>]*?rel=["\']stylesheet["\'].*?>/si';
123
+ $x = preg_match_all($regexp,$html,$cxt);
124
+ if ($x) {
125
+ $match += $x;
126
+ $CSSext = array_merge($CSSext,$cxt[1]);
127
+ }
128
+
129
+ // look for @import stylesheets
130
+ //$regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css)[\'\"]{0,1}\)/si';
131
+ $regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css(\?\S+)?)[\'\"]{0,1}\)/si';
132
+ $x = preg_match_all($regexp,$html,$cxt);
133
+ if ($x) {
134
+ $match += $x;
135
+ $CSSext = array_merge($CSSext,$cxt[1]);
136
+ }
137
+
138
+ // look for @import without the url()
139
+ //$regexp = '/@import [\'\"]{0,1}([^;]*?\.css)[\'\"]{0,1}/si';
140
+ $regexp = '/@import [\'\"]{0,1}([^;]*?\.css(\?\S+)?)[\'\"]{0,1}/si';
141
+ $x = preg_match_all($regexp,$html,$cxt);
142
+ if ($x) {
143
+ $match += $x;
144
+ $CSSext = array_merge($CSSext,$cxt[1]);
145
+ }
146
+
147
+ $ind = 0;
148
+ $CSSstr = '';
149
+
150
+ if (!is_array($this->cascadeCSS)) $this->cascadeCSS = array();
151
+
152
+ while($match){
153
+ $path = $CSSext[$ind];
154
+ $this->mpdf->GetFullPath($path);
155
+ $CSSextblock = $this->mpdf->_get_file($path);
156
+ if ($CSSextblock) {
157
+ // look for embedded @import stylesheets in other stylesheets
158
+ // and fix url paths (including background-images) relative to stylesheet
159
+ //$regexpem = '/@import url\([\'\"]{0,1}(.*?\.css)[\'\"]{0,1}\)/si';
160
+ $regexpem = '/@import url\([\'\"]{0,1}(.*?\.css(\?\S+)?)[\'\"]{0,1}\)/si';
161
+ $xem = preg_match_all($regexpem,$CSSextblock,$cxtem);
162
+ $cssBasePath = preg_replace('/\/[^\/]*$/','',$path) . '/';
163
+ if ($xem) {
164
+ foreach($cxtem[1] AS $cxtembedded) {
165
+ // path is relative to original stlyesheet!!
166
+ $this->mpdf->GetFullPath($cxtembedded, $cssBasePath );
167
+ $match++;
168
+ $CSSext[] = $cxtembedded;
169
+ }
170
+ }
171
+ $regexpem = '/(background[^;]*url\s*\(\s*[\'\"]{0,1})([^\)\'\"]*)([\'\"]{0,1}\s*\))/si';
172
+ $xem = preg_match_all($regexpem,$CSSextblock,$cxtem);
173
+ if ($xem) {
174
+ for ($i=0;$i<count($cxtem[0]);$i++) {
175
+ // path is relative to original stlyesheet!!
176
+ $embedded = $cxtem[2][$i];
177
+ if (!preg_match('/^data:image/i', $embedded)) { // mPDF 5.5.13
178
+ $this->mpdf->GetFullPath($embedded, $cssBasePath );
179
+ $CSSextblock = preg_replace('/'.preg_quote($cxtem[0][$i],'/').'/', ($cxtem[1][$i].$embedded.$cxtem[3][$i]), $CSSextblock);
180
+ }
181
+ }
182
+ }
183
+ $CSSstr .= ' '.$CSSextblock;
184
+ }
185
+ $match--;
186
+ $ind++;
187
+ } //end of match
188
+
189
+ $match = 0; // reset value, if needed
190
+ // CSS as <style> in HTML document
191
+ $regexp = '/<style.*?>(.*?)<\/style>/si';
192
+ $match = preg_match_all($regexp,$html,$CSSblock);
193
+ if ($match) {
194
+ $tmpCSSstr = implode(' ',$CSSblock[1]);
195
+ $regexpem = '/(background[^;]*url\s*\(\s*[\'\"]{0,1})([^\)\'\"]*)([\'\"]{0,1}\s*\))/si';
196
+ $xem = preg_match_all($regexpem,$tmpCSSstr ,$cxtem);
197
+ if ($xem) {
198
+ for ($i=0;$i<count($cxtem[0]);$i++) {
199
+ $embedded = $cxtem[2][$i];
200
+ if (!preg_match('/^data:image/i', $embedded)) { // mPDF 5.5.13
201
+ $this->mpdf->GetFullPath($embedded);
202
+ $tmpCSSstr = preg_replace('/'.preg_quote($cxtem[0][$i],'/').'/', ($cxtem[1][$i].$embedded.$cxtem[3][$i]), $tmpCSSstr );
203
+ }
204
+ }
205
+ }
206
+ $CSSstr .= ' '.$tmpCSSstr;
207
+ }
208
+ // Remove comments
209
+ $CSSstr = preg_replace('|/\*.*?\*/|s',' ',$CSSstr);
210
+ $CSSstr = preg_replace('/[\s\n\r\t\f]/s',' ',$CSSstr);
211
+
212
+ if (preg_match('/@media/',$CSSstr)) {
213
+ preg_match_all('/@media(.*?)\{(([^\{\}]*\{[^\{\}]*\})+)\s*\}/is',$CSSstr,$m);
214
+ for($i=0; $i<count($m[0]); $i++) {
215
+ if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) {
216
+ $CSSstr = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$CSSstr);
217
+ }
218
+ else {
219
+ $CSSstr = preg_replace('/'.preg_quote($m[0][$i],'/').'/',' '.$m[2][$i].' ',$CSSstr);
220
+ }
221
+ }
222
+ }
223
+
224
+ // mPDF 5.5.13
225
+ // Replace any background: url(data:image... with temporary image file reference
226
+ preg_match_all("/(url\(data:image\/(jpeg|gif|png);base64,(.*)\))/siU", $CSSstr, $idata);
227
+ if (count($idata[0])) {
228
+ for($i=0;$i<count($idata[0]);$i++) {
229
+ $file = _MPDF_TEMP_PATH.'_tempCSSidata'.RAND(1,10000).'_'.$i.'.'.$idata[2][$i];
230
+ //Save to local file
231
+ file_put_contents($file, base64_decode($idata[3][$i]));
232
+ // $this->mpdf->GetFullPath($file); // ? is this needed - NO mPDF 5.6.03
233
+ $CSSstr = str_replace($idata[0][$i], 'url("'.$file.'")', $CSSstr); // mPDF 5.5.17
234
+ }
235
+ }
236
+
237
+ $CSSstr = preg_replace('/(<\!\-\-|\-\->)/s',' ',$CSSstr);
238
+ if ($CSSstr ) {
239
+ preg_match_all('/(.*?)\{(.*?)\}/',$CSSstr,$styles);
240
+ for($i=0; $i < count($styles[1]) ; $i++) {
241
+ // SET array e.g. $classproperties['COLOR'] = '#ffffff';
242
+ $stylestr= trim($styles[2][$i]);
243
+ $stylearr = explode(';',$stylestr);
244
+ foreach($stylearr AS $sta) {
245
+ if (trim($sta)) {
246
+ // Changed to allow style="background: url('http://www.bpm1.com/bg.jpg')"
247
+ list($property,$value) = explode(':',$sta,2);
248
+ $property = trim($property);
249
+ $value = preg_replace('/\s*!important/i','',$value);
250
+ $value = trim($value);
251
+ if ($property && ($value || $value==='0')) {
252
+ // Ignores -webkit-gradient so doesn't override -moz-
253
+ if ((strtoupper($property)=='BACKGROUND-IMAGE' || strtoupper($property)=='BACKGROUND') && preg_match('/-webkit-gradient/i',$value)) {
254
+ continue;
255
+ }
256
+ $classproperties[strtoupper($property)] = $value;
257
+ }
258
+ }
259
+ }
260
+ $classproperties = $this->fixCSS($classproperties);
261
+ $tagstr = strtoupper(trim($styles[1][$i]));
262
+ $tagarr = explode(',',$tagstr);
263
+ $pageselectors = false; // used to turn on $this->mpdf->mirrorMargins
264
+ foreach($tagarr AS $tg) {
265
+ $tags = preg_split('/\s+/',trim($tg));
266
+ $level = count($tags);
267
+ $t = '';
268
+ $t2 = '';
269
+ $t3 = '';
270
+ if (trim($tags[0])=='@PAGE') {
271
+ if (isset($tags[0])) { $t = trim($tags[0]); }
272
+ if (isset($tags[1])) { $t2 = trim($tags[1]); }
273
+ if (isset($tags[2])) { $t3 = trim($tags[2]); }
274
+ $tag = '';
275
+ if ($level==1) { $tag = $t; }
276
+ else if ($level==2 && preg_match('/^[:](.*)$/',$t2,$m)) {
277
+ $tag = $t.'>>PSEUDO>>'.$m[1];
278
+ if ($m[1]=='LEFT' || $m[1]=='RIGHT') { $pageselectors = true; } // used to turn on $this->mpdf->mirrorMargins
279
+ }
280
+ else if ($level==2) { $tag = $t.'>>NAMED>>'.$t2; }
281
+ else if ($level==3 && preg_match('/^[:](.*)$/',$t3,$m)) {
282
+ $tag = $t.'>>NAMED>>'.$t2.'>>PSEUDO>>'.$m[1];
283
+ if ($m[1]=='LEFT' || $m[1]=='RIGHT') { $pageselectors = true; } // used to turn on $this->mpdf->mirrorMargins
284
+ }
285
+ if (isset($this->CSS[$tag]) && $tag) { $this->CSS[$tag] = $this->array_merge_recursive_unique($this->CSS[$tag], $classproperties); }
286
+ else if ($tag) { $this->CSS[$tag] = $classproperties; }
287
+ }
288
+
289
+ else if ($level == 1) { // e.g. p or .class or #id or p.class or p#id
290
+ if (isset($tags[0])) { $t = trim($tags[0]); }
291
+ if ($t) {
292
+ $tag = '';
293
+ if (preg_match('/^[.](.*)$/',$t,$m)) { $tag = 'CLASS>>'.$m[1]; }
294
+ else if (preg_match('/^[#](.*)$/',$t,$m)) { $tag = 'ID>>'.$m[1]; }
295
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[.](.*)$/',$t,$m)) { $tag = $m[1].'>>CLASS>>'.$m[2]; }
296
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')\s*:NTH-CHILD\((.*)\)$/',$t,$m)) { $tag = $m[1].'>>SELECTORNTHCHILD>>'.$m[2]; }
297
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[#](.*)$/',$t,$m)) { $tag = $m[1].'>>ID>>'.$m[2]; }
298
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')$/',$t)) { $tag= $t; }
299
+ if (isset($this->CSS[$tag]) && $tag) { $this->CSS[$tag] = $this->array_merge_recursive_unique($this->CSS[$tag], $classproperties); }
300
+ else if ($tag) { $this->CSS[$tag] = $classproperties; }
301
+ }
302
+ }
303
+ else {
304
+ $tmp = array();
305
+ for($n=0;$n<$level;$n++) {
306
+ if (isset($tags[$n])) { $t = trim($tags[$n]); }
307
+ else { $t = ''; }
308
+ if ($t) {
309
+ $tag = '';
310
+ if (preg_match('/^[.](.*)$/',$t,$m)) { $tag = 'CLASS>>'.$m[1]; }
311
+ else if (preg_match('/^[#](.*)$/',$t,$m)) { $tag = 'ID>>'.$m[1]; }
312
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[.](.*)$/',$t,$m)) { $tag = $m[1].'>>CLASS>>'.$m[2]; }
313
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')\s*:NTH-CHILD\((.*)\)$/',$t,$m)) { $tag = $m[1].'>>SELECTORNTHCHILD>>'.$m[2]; }
314
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[#](.*)$/',$t,$m)) { $tag = $m[1].'>>ID>>'.$m[2]; }
315
+ else if (preg_match('/^('.$this->mpdf->allowedCSStags.')$/',$t)) { $tag= $t; }
316
+
317
+ if ($tag) $tmp[] = $tag;
318
+ else { break; }
319
+ }
320
+ }
321
+
322
+ if ($tag) {
323
+ $x = &$this->cascadeCSS;
324
+ foreach($tmp AS $tp) { $x = &$x[$tp]; }
325
+ $x = $this->array_merge_recursive_unique($x, $classproperties);
326
+ $x['depth'] = $level;
327
+ }
328
+ }
329
+ }
330
+ if ($pageselectors) { $this->mpdf->mirrorMargins = true; }
331
+ $properties = array();
332
+ $values = array();
333
+ $classproperties = array();
334
+ }
335
+ } // end of if
336
+ //Remove CSS (tags and content), if any
337
+ $regexp = '/<style.*?>(.*?)<\/style>/si'; // it can be <style> or <style type="txt/css">
338
+ $html = preg_replace($regexp,'',$html);
339
+ //print_r($this->CSS); exit;
340
+ //print_r($this->cascadeCSS); exit;
341
+ return $html;
342
+ }
343
+
344
+
345
+
346
+ function readInlineCSS($html) {
347
+ //Fix incomplete CSS code
348
+ $size = strlen($html)-1;
349
+ if (substr($html,$size,1) != ';') $html .= ';';
350
+ //Make CSS[Name-of-the-class] = array(key => value)
351
+ $regexp = '|\\s*?(\\S+?):(.+?);|i';
352
+ preg_match_all( $regexp, $html, $styleinfo);
353
+ $properties = $styleinfo[1];
354
+ $values = $styleinfo[2];
355
+ //Array-properties and Array-values must have the SAME SIZE!
356
+ $classproperties = array();
357
+ for($i = 0; $i < count($properties) ; $i++) {
358
+ // Ignores -webkit-gradient so doesn't override -moz-
359
+ if ((strtoupper($properties[$i])=='BACKGROUND-IMAGE' || strtoupper($properties[$i])=='BACKGROUND') && preg_match('/-webkit-gradient/i',$values[$i])) {
360
+ continue;
361
+ }
362
+ $classproperties[strtoupper($properties[$i])] = trim($values[$i]);
363
+ }
364
+ return $this->fixCSS($classproperties);
365
+ }
366
+
367
+
368
+
369
+ function _fix_borderStr($bd) {
370
+ preg_match_all("/\((.*?)\)/", $bd, $m);
371
+ if (count($m[1])) {
372
+ for($i=0;$i<count($m[1]);$i++) {
373
+ $sub = preg_replace("/ /", "", $m[1][$i]);
374
+ $bd = preg_replace('/'.preg_quote($m[1][$i], '/').'/si', $sub, $bd);
375
+ }
376
+ }
377
+
378
+ $prop = preg_split('/\s+/',trim($bd));
379
+ $w = 'medium';
380
+ $c = '#000000';
381
+ $s = 'none';
382
+
383
+ if ( count($prop) == 1 ) {
384
+ // solid
385
+ if (in_array($prop[0],$this->mpdf->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) { $s = $prop[0]; }
386
+ // #000000
387
+ else if (is_array($this->mpdf->ConvertColor($prop[0]))) { $c = $prop[0]; }
388
+ // 1px
389
+ else { $w = $prop[0]; }
390
+ }
391
+ else if (count($prop) == 2 ) {
392
+ // 1px solid
393
+ if (in_array($prop[1],$this->mpdf->borderstyles) || $prop[1] == 'none' || $prop[1] == 'hidden' ) { $w = $prop[0]; $s = $prop[1]; }
394
+ // solid #000000
395
+ else if (in_array($prop[0],$this->mpdf->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) { $s = $prop[0]; $c = $prop[1]; }
396
+ // 1px #000000
397
+ else { $w = $prop[0]; $c = $prop[1]; }
398
+ }
399
+ else if ( count($prop) == 3 ) {
400
+ // Change #000000 1px solid to 1px solid #000000 (proper)
401
+ if (substr($prop[0],0,1) == '#') { $c = $prop[0]; $w = $prop[1]; $s = $prop[2]; }
402
+ // Change solid #000000 1px to 1px solid #000000 (proper)
403
+ else if (substr($prop[0],1,1) == '#') { $s = $prop[0]; $c = $prop[1]; $w = $prop[2]; }
404
+ // Change solid 1px #000000 to 1px solid #000000 (proper)
405
+ else if (in_array($prop[0],$this->mpdf->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) {
406
+ $s = $prop[0]; $w = $prop[1]; $c = $prop[2];
407
+ }
408
+ else { $w = $prop[0]; $s = $prop[1]; $c = $prop[2]; }
409
+ }
410
+ else { return ''; }
411
+ $s = strtolower($s);
412
+ return $w.' '.$s.' '.$c;
413
+ }
414
+
415
+
416
+
417
+ function fixCSS($prop) {
418
+ if (!is_array($prop) || (count($prop)==0)) return array();
419
+ $newprop = array();
420
+ foreach($prop AS $k => $v) {
421
+ if ($k != 'BACKGROUND-IMAGE' && $k != 'BACKGROUND' && $k != 'ODD-HEADER-NAME' && $k != 'EVEN-HEADER-NAME' && $k != 'ODD-FOOTER-NAME' && $k != 'EVEN-FOOTER-NAME' && $k != 'HEADER' && $k != 'FOOTER') {
422
+ $v = strtolower($v);
423
+ }
424
+
425
+ if ($k == 'FONT') {
426
+ $s = trim($v);
427
+ preg_match_all('/\"(.*?)\"/',$s,$ff);
428
+ if (count($ff[1])) {
429
+ foreach($ff[1] AS $ffp) {
430
+ $w = preg_split('/\s+/',$ffp);
431
+ $s = preg_replace('/\"'.$ffp.'\"/',$w[0],$s);
432
+ }
433
+ }
434
+ preg_match_all('/\'(.*?)\'/',$s,$ff);
435
+ if (count($ff[1])) {
436
+ foreach($ff[1] AS $ffp) {
437
+ $w = preg_split('/\s+/',$ffp);
438
+ $s = preg_replace('/\''.$ffp.'\'/',$w[0],$s);
439
+ }
440
+ }
441
+ $s = preg_replace('/\s*,\s*/',',',$s);
442
+ $bits = preg_split('/\s+/',$s);
443
+ if (count($bits)>1) {
444
+ $k = 'FONT-FAMILY'; $v = $bits[(count($bits)-1)];
445
+ $fs = $bits[(count($bits)-2)];
446
+ if (preg_match('/(.*?)\/(.*)/',$fs, $fsp)) {
447
+ $newprop['FONT-SIZE'] = $fsp[1];
448
+ $newprop['LINE-HEIGHT'] = $fsp[2];
449
+ }
450
+ else { $newprop['FONT-SIZE'] = $fs; }
451
+ if (preg_match('/(italic|oblique)/i',$s)) { $newprop['FONT-STYLE'] = 'italic'; }
452
+ else { $newprop['FONT-STYLE'] = 'normal'; }
453
+ if (preg_match('/bold/i',$s)) { $newprop['FONT-WEIGHT'] = 'bold'; }
454
+ else { $newprop['FONT-WEIGHT'] = 'normal'; }
455
+ if (preg_match('/small-caps/i',$s)) { $newprop['TEXT-TRANSFORM'] = 'uppercase'; }
456
+ }
457
+ }
458
+ if ($k == 'FONT-FAMILY') {
459
+ $aux_fontlist = explode(",",$v);
460
+ $found = 0;
461
+ foreach($aux_fontlist AS $f) {
462
+ $fonttype = trim($f);
463
+ $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
464
+ $fonttype = preg_replace('/ /','',$fonttype);
465
+ $v = strtolower(trim($fonttype));
466
+ if (isset($this->mpdf->fonttrans[$v]) && $this->mpdf->fonttrans[$v]) { $v = $this->mpdf->fonttrans[$v]; }
467
+ if ((!$this->mpdf->onlyCoreFonts && in_array($v,$this->mpdf->available_unifonts)) ||
468
+ in_array($v,array('ccourier','ctimes','chelvetica')) ||
469
+ ($this->mpdf->onlyCoreFonts && in_array($v,array('courier','times','helvetica','arial'))) ||
470
+ in_array($v, array('sjis','uhc','big5','gb'))) {
471
+ $newprop[$k] = $v;
472
+ $found = 1;
473
+ break;
474
+ }
475
+ }
476
+ if (!$found) {
477
+ foreach($aux_fontlist AS $f) {
478
+ $fonttype = trim($f);
479
+ $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
480
+ $fonttype = preg_replace('/ /','',$fonttype);
481
+ $v = strtolower(trim($fonttype));
482
+ if (isset($this->mpdf->fonttrans[$v]) && $this->mpdf->fonttrans[$v]) { $v = $this->mpdf->fonttrans[$v]; }
483
+ if (in_array($v,$this->mpdf->sans_fonts) || in_array($v,$this->mpdf->serif_fonts) || in_array($v,$this->mpdf->mono_fonts) ) {
484
+ $newprop[$k] = $v;
485
+ break;
486
+ }
487
+ }
488
+ }
489
+ }
490
+ else if ($k == 'MARGIN') {
491
+ $tmp = $this->expand24($v);
492
+ $newprop['MARGIN-TOP'] = $tmp['T'];
493
+ $newprop['MARGIN-RIGHT'] = $tmp['R'];
494
+ $newprop['MARGIN-BOTTOM'] = $tmp['B'];
495
+ $newprop['MARGIN-LEFT'] = $tmp['L'];
496
+ }
497
+ /*-- BORDER-RADIUS --*/
498
+ else if ($k == 'BORDER-RADIUS' || $k == 'BORDER-TOP-LEFT-RADIUS' || $k == 'BORDER-TOP-RIGHT-RADIUS' || $k == 'BORDER-BOTTOM-LEFT-RADIUS' || $k == 'BORDER-BOTTOM-RIGHT-RADIUS') {
499
+ $tmp = $this->border_radius_expand($v,$k);
500
+ if (isset($tmp['TL-H'])) $newprop['BORDER-TOP-LEFT-RADIUS-H'] = $tmp['TL-H'];
501
+ if (isset($tmp['TL-V'])) $newprop['BORDER-TOP-LEFT-RADIUS-V'] = $tmp['TL-V'];
502
+ if (isset($tmp['TR-H'])) $newprop['BORDER-TOP-RIGHT-RADIUS-H'] = $tmp['TR-H'];
503
+ if (isset($tmp['TR-V'])) $newprop['BORDER-TOP-RIGHT-RADIUS-V'] = $tmp['TR-V'];
504
+ if (isset($tmp['BL-H'])) $newprop['BORDER-BOTTOM-LEFT-RADIUS-H'] = $tmp['BL-H'];
505
+ if (isset($tmp['BL-V'])) $newprop['BORDER-BOTTOM-LEFT-RADIUS-V'] = $tmp['BL-V'];
506
+ if (isset($tmp['BR-H'])) $newprop['BORDER-BOTTOM-RIGHT-RADIUS-H'] = $tmp['BR-H'];
507
+ if (isset($tmp['BR-V'])) $newprop['BORDER-BOTTOM-RIGHT-RADIUS-V'] = $tmp['BR-V'];
508
+ }
509
+ /*-- END BORDER-RADIUS --*/
510
+ else if ($k == 'PADDING') {
511
+ $tmp = $this->expand24($v);
512
+ $newprop['PADDING-TOP'] = $tmp['T'];
513
+ $newprop['PADDING-RIGHT'] = $tmp['R'];
514
+ $newprop['PADDING-BOTTOM'] = $tmp['B'];
515
+ $newprop['PADDING-LEFT'] = $tmp['L'];
516
+ }
517
+ else if ($k == 'BORDER') {
518
+ if ($v == '1') { $v = '1px solid #000000'; }
519
+ else { $v = $this->_fix_borderStr($v); }
520
+ $newprop['BORDER-TOP'] = $v;
521
+ $newprop['BORDER-RIGHT'] = $v;
522
+ $newprop['BORDER-BOTTOM'] = $v;
523
+ $newprop['BORDER-LEFT'] = $v;
524
+ }
525
+ else if ($k == 'BORDER-TOP') {
526
+ $newprop['BORDER-TOP'] = $this->_fix_borderStr($v);
527
+ }
528
+ else if ($k == 'BORDER-RIGHT') {
529
+ $newprop['BORDER-RIGHT'] = $this->_fix_borderStr($v);
530
+ }
531
+ else if ($k == 'BORDER-BOTTOM') {
532
+ $newprop['BORDER-BOTTOM'] = $this->_fix_borderStr($v);
533
+ }
534
+ else if ($k == 'BORDER-LEFT') {
535
+ $newprop['BORDER-LEFT'] = $this->_fix_borderStr($v);
536
+ }
537
+ else if ($k == 'BORDER-STYLE') {
538
+ $e = $this->expand24($v);
539
+ $newprop['BORDER-TOP-STYLE'] = $e['T'];
540
+ $newprop['BORDER-RIGHT-STYLE'] = $e['R'];
541
+ $newprop['BORDER-BOTTOM-STYLE'] = $e['B'];
542
+ $newprop['BORDER-LEFT-STYLE'] = $e['L'];
543
+ }
544
+ else if ($k == 'BORDER-WIDTH') {
545
+ $e = $this->expand24($v);
546
+ $newprop['BORDER-TOP-WIDTH'] = $e['T'];
547
+ $newprop['BORDER-RIGHT-WIDTH'] = $e['R'];
548
+ $newprop['BORDER-BOTTOM-WIDTH'] = $e['B'];
549
+ $newprop['BORDER-LEFT-WIDTH'] = $e['L'];
550
+ }
551
+ else if ($k == 'BORDER-COLOR') {
552
+ $e = $this->expand24($v);
553
+ $newprop['BORDER-TOP-COLOR'] = $e['T'];
554
+ $newprop['BORDER-RIGHT-COLOR'] = $e['R'];
555
+ $newprop['BORDER-BOTTOM-COLOR'] = $e['B'];
556
+ $newprop['BORDER-LEFT-COLOR'] = $e['L'];
557
+ }
558
+
559
+ else if ($k == 'BORDER-SPACING') {
560
+ $prop = preg_split('/\s+/',trim($v));
561
+ if (count($prop) == 1 ) {
562
+ $newprop['BORDER-SPACING-H'] = $prop[0];
563
+ $newprop['BORDER-SPACING-V'] = $prop[0];
564
+ }
565
+ else if (count($prop) == 2 ) {
566
+ $newprop['BORDER-SPACING-H'] = $prop[0];
567
+ $newprop['BORDER-SPACING-V'] = $prop[1];
568
+ }
569
+ }
570
+ else if ($k == 'TEXT-OUTLINE') { // mPDF 5.6.07
571
+ $prop = preg_split('/\s+/',trim($v));
572
+ if (trim(strtolower($v)) == 'none' ) {
573
+ $newprop['TEXT-OUTLINE'] = 'none';
574
+ }
575
+ else if (count($prop) == 2 ) {
576
+ $newprop['TEXT-OUTLINE-WIDTH'] = $prop[0];
577
+ $newprop['TEXT-OUTLINE-COLOR'] = $prop[1];
578
+ }
579
+ else if (count($prop) == 3 ) {
580
+ $newprop['TEXT-OUTLINE-WIDTH'] = $prop[0];
581
+ $newprop['TEXT-OUTLINE-COLOR'] = $prop[2];
582
+ }
583
+ }
584
+ else if ($k == 'SIZE') {
585
+ $prop = preg_split('/\s+/',trim($v));
586
+ if (preg_match('/(auto|portrait|landscape)/',$prop[0])) {
587
+ $newprop['SIZE'] = strtoupper($prop[0]);
588
+ }
589
+ else if (count($prop) == 1 ) {
590
+ $newprop['SIZE']['W'] = $this->mpdf->ConvertSize($prop[0]);
591
+ $newprop['SIZE']['H'] = $this->mpdf->ConvertSize($prop[0]);
592
+ }
593
+ else if (count($prop) == 2 ) {
594
+ $newprop['SIZE']['W'] = $this->mpdf->ConvertSize($prop[0]);
595
+ $newprop['SIZE']['H'] = $this->mpdf->ConvertSize($prop[1]);
596
+ }
597
+ }
598
+ else if ($k == 'SHEET-SIZE') {
599
+ $prop = preg_split('/\s+/',trim($v));
600
+ if (count($prop) == 2 ) {
601
+ $newprop['SHEET-SIZE'] = array($this->mpdf->ConvertSize($prop[0]), $this->mpdf->ConvertSize($prop[1]));
602
+ }
603
+ else {
604
+ if(preg_match('/([0-9a-zA-Z]*)-L/i',$v,$m)) { // e.g. A4-L = A$ landscape
605
+ $ft = $this->mpdf->_getPageFormat($m[1]);
606
+ $format = array($ft[1],$ft[0]);
607
+ }
608
+ else { $format = $this->mpdf->_getPageFormat($v); }
609
+ if ($format) { $newprop['SHEET-SIZE'] = array($format[0]/_MPDFK, $format[1]/_MPDFK); }
610
+ }
611
+ }
612
+ else if ($k == 'BACKGROUND') {
613
+ $bg = $this->parseCSSbackground($v);
614
+ if ($bg['c']) { $newprop['BACKGROUND-COLOR'] = $bg['c']; }
615
+ else { $newprop['BACKGROUND-COLOR'] = 'transparent'; }
616
+ /*-- BACKGROUNDS --*/
617
+ if ($bg['i']) {
618
+ $newprop['BACKGROUND-IMAGE'] = $bg['i'];
619
+ if ($bg['r']) { $newprop['BACKGROUND-REPEAT'] = $bg['r']; }
620
+ if ($bg['p']) { $newprop['BACKGROUND-POSITION'] = $bg['p']; }
621
+ }
622
+ else { $newprop['BACKGROUND-IMAGE'] = ''; }
623
+ /*-- END BACKGROUNDS --*/
624
+ }
625
+ /*-- BACKGROUNDS --*/
626
+ else if ($k == 'BACKGROUND-IMAGE') {
627
+ if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$v,$m)) {
628
+ $newprop['BACKGROUND-IMAGE'] = $m[0];
629
+ continue;
630
+ }
631
+ if (preg_match('/url\([\'\"]{0,1}(.*?)[\'\"]{0,1}\)/i',$v,$m)) {
632
+ $newprop['BACKGROUND-IMAGE'] = $m[1];
633
+ }
634
+
635
+ else if (strtolower($v)=='none') { $newprop['BACKGROUND-IMAGE'] = ''; }
636
+
637
+ }
638
+ else if ($k == 'BACKGROUND-REPEAT') {
639
+ if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/i',$v,$m)) {
640
+ $newprop['BACKGROUND-REPEAT'] = strtolower($m[1]);
641
+ }
642
+ }
643
+ else if ($k == 'BACKGROUND-POSITION') {
644
+ $s = $v;
645
+ $bits = preg_split('/\s+/',trim($s));
646
+ // These should be Position x1 or x2
647
+ if (count($bits)==1) {
648
+ if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
649
+ else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
650
+ else { $bg['p'] = $bits[0] . ' 50%'; }
651
+ }
652
+ else if (count($bits)==2) {
653
+ // Can be either right center or center right
654
+ if (preg_match('/(top|bottom)/',$bits[0]) || preg_match('/(left|right)/',$bits[1])) {
655
+ $bg['p'] = $bits[1] . ' '.$bits[0];
656
+ }
657
+ else {
658
+ $bg['p'] = $bits[0] . ' '.$bits[1];
659
+ }
660
+ }
661
+ if ($bg['p']) {
662
+ $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
663
+ $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
664
+ $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
665
+ if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
666
+ $bg['p'] = false;
667
+ }
668
+ }
669
+ if ($bg['p']) { $newprop['BACKGROUND-POSITION'] = $bg['p']; }
670
+ }
671
+ /*-- END BACKGROUNDS --*/
672
+ else if ($k == 'IMAGE-ORIENTATION') {
673
+ if (preg_match('/([\-]*[0-9\.]+)(deg|grad|rad)/i',$v,$m)) {
674
+ $angle = $m[1] + 0;
675
+ if (strtolower($m[2])=='deg') { $angle = $angle; }
676
+ else if (strtolower($m[2])=='grad') { $angle *= (360/400); }
677
+ else if (strtolower($m[2])=='rad') { $angle = rad2deg($angle); }
678
+ while($angle < 0) { $angle += 360; }
679
+ $angle = ($angle % 360);
680
+ $angle /= 90;
681
+ $angle = round($angle) * 90;
682
+ $newprop['IMAGE-ORIENTATION'] = $angle;
683
+ }
684
+ }
685
+ // mPDF 5.6.13
686
+ else if ($k == 'TEXT-ALIGN') {
687
+ if (preg_match('/["\'](.){1}["\']/i',$v,$m)) {
688
+ $d = array_search($m[1],$this->mpdf->decimal_align);
689
+ if ($d !== false) { $newprop['TEXT-ALIGN'] = $d; }
690
+ if (preg_match('/(center|left|right)/i',$v,$m)) { $newprop['TEXT-ALIGN'] .= strtoupper(substr($m[1],0,1)); }
691
+ else { $newprop['TEXT-ALIGN'] .= 'R'; } // default = R
692
+ }
693
+ else if (preg_match('/["\'](\\\[a-fA-F0-9]{1,6})["\']/i',$v,$m)) {
694
+ $utf8 = codeHex2utf(substr($m[1],1,6));
695
+ $d = array_search($utf8,$this->mpdf->decimal_align);
696
+ if ($d !== false) { $newprop['TEXT-ALIGN'] = $d; }
697
+ if (preg_match('/(center|left|right)/i',$v,$m)) { $newprop['TEXT-ALIGN'] .= strtoupper(substr($m[1],0,1)); }
698
+ else { $newprop['TEXT-ALIGN'] .= 'R'; } // default = R
699
+ }
700
+ else { $newprop[$k] = $v; }
701
+ }
702
+
703
+ else {
704
+ $newprop[$k] = $v;
705
+ }
706
+ }
707
+
708
+ return $newprop;
709
+ }
710
+
711
+ function setCSSboxshadow($v) {
712
+ $sh = array();
713
+ $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/',$v,$x); // mPDF 5.6.05
714
+ for($i=0; $i<$c; $i++) {
715
+ $col = preg_replace('/,/','*',$x[0][$i]);
716
+ $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
717
+ }
718
+ $ss = explode(',',$v);
719
+ foreach ($ss AS $s) {
720
+ $new = array('inset'=>false, 'blur'=>0, 'spread'=>0);
721
+ if (preg_match('/inset/i',$s)) { $new['inset'] = true; $s = preg_replace('/\s*inset\s*/','',$s); }
722
+ $p = explode(' ',trim($s));
723
+ if (isset($p[0])) { $new['x'] = $this->mpdf->ConvertSize(trim($p[0]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
724
+ if (isset($p[1])) { $new['y'] = $this->mpdf->ConvertSize(trim($p[1]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
725
+ if (isset($p[2])) {
726
+ if (preg_match('/^\s*[\.\-0-9]/',$p[2])) {
727
+ $new['blur'] = $this->mpdf->ConvertSize(trim($p[2]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false);
728
+ }
729
+ else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[2])); }
730
+ if (isset($p[3])) {
731
+ if (preg_match('/^\s*[\.\-0-9]/',$p[3])) {
732
+ $new['spread'] = $this->mpdf->ConvertSize(trim($p[3]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false);
733
+ }
734
+ else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[3])); }
735
+ if (isset($p[4])) {
736
+ $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[4]));
737
+ }
738
+ }
739
+ }
740
+ if (!$new['col']) { $new['col'] = $this->mpdf->ConvertColor('#888888'); }
741
+ if (isset($new['y'])) { array_unshift($sh, $new); }
742
+ }
743
+ return $sh;
744
+ }
745
+
746
+ function setCSStextshadow($v) {
747
+ $sh = array();
748
+ $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/',$v,$x); // mPDF 5.6.05
749
+ for($i=0; $i<$c; $i++) {
750
+ $col = preg_replace('/,/','*',$x[0][$i]);
751
+ $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
752
+ }
753
+ $ss = explode(',',$v);
754
+ foreach ($ss AS $s) {
755
+ $new = array('blur'=>0);
756
+ $p = explode(' ',trim($s));
757
+ if (isset($p[0])) { $new['x'] = $this->mpdf->ConvertSize(trim($p[0]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
758
+ if (isset($p[1])) { $new['y'] = $this->mpdf->ConvertSize(trim($p[1]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
759
+ if (isset($p[2])) {
760
+ if (preg_match('/^\s*[\.\-0-9]/',$p[2])) {
761
+ $new['blur'] = $this->mpdf->ConvertSize(trim($p[2]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false);
762
+ }
763
+ else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[2])); }
764
+ if (isset($p[3])) {
765
+ $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[3]));
766
+ }
767
+ }
768
+ if (!$new['col']) { $new['col'] = $this->mpdf->ConvertColor('#888888'); }
769
+ if (isset($new['y'])) { array_unshift($sh, $new); }
770
+ }
771
+ return $sh;
772
+ }
773
+
774
+ function parseCSSbackground($s) {
775
+ $bg = array('c'=>false, 'i'=>false, 'r'=>false, 'p'=>false, );
776
+ /*-- BACKGROUNDS --*/
777
+ if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$s,$m)) {
778
+ $bg['i'] = $m[0];
779
+ }
780
+ else
781
+ /*-- END BACKGROUNDS --*/
782
+ if (preg_match('/url\(/i',$s)) {
783
+ // If color, set and strip it off
784
+ // mPDF 5.6.05
785
+ if (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})\s+(url\(.*)/i',$s,$m)) {
786
+ $bg['c'] = strtolower($m[1]);
787
+ $s = $m[3];
788
+ }
789
+ /*-- BACKGROUNDS --*/
790
+ if (preg_match('/url\([\'\"]{0,1}(.*?)[\'\"]{0,1}\)\s*(.*)/i',$s,$m)) {
791
+ $bg['i'] = $m[1];
792
+ $s = strtolower($m[2]);
793
+ if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/',$s,$m)) {
794
+ $bg['r'] = $m[1];
795
+ }
796
+ // Remove repeat, attachment (discarded) and also any inherit
797
+ $s = preg_replace('/(repeat-x|repeat-y|no-repeat|repeat|scroll|fixed|inherit)/','',$s);
798
+ $bits = preg_split('/\s+/',trim($s));
799
+ // These should be Position x1 or x2
800
+ if (count($bits)==1) {
801
+ if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
802
+ else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
803
+ else { $bg['p'] = $bits[0] . ' 50%'; }
804
+ }
805
+ else if (count($bits)==2) {
806
+ // Can be either right center or center right
807
+ if (preg_match('/(top|bottom)/',$bits[0]) || preg_match('/(left|right)/',$bits[1])) {
808
+ $bg['p'] = $bits[1] . ' '.$bits[0];
809
+ }
810
+ else {
811
+ $bg['p'] = $bits[0] . ' '.$bits[1];
812
+ }
813
+ }
814
+ if ($bg['p']) {
815
+ $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
816
+ $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
817
+ $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
818
+ if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
819
+ $bg['p'] = false;
820
+ }
821
+ }
822
+ }
823
+ /*-- END BACKGROUNDS --*/
824
+ }
825
+ else if (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})/i',$s,$m)) { $bg['c'] = strtolower($m[1]); } // mPDF 5.6.05
826
+ return ($bg);
827
+ }
828
+
829
+
830
+ function expand24($mp) {
831
+ $prop = preg_split('/\s+/',trim($mp));
832
+ if (count($prop) == 1 ) {
833
+ return array('T' => $prop[0], 'R' => $prop[0], 'B' => $prop[0], 'L'=> $prop[0]);
834
+ }
835
+ if (count($prop) == 2 ) {
836
+ return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[0], 'L'=> $prop[1]);
837
+ }
838
+
839
+ if (count($prop) == 3 ) {
840
+ return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L'=> $prop[1]);
841
+ }
842
+ if (count($prop) == 4 ) {
843
+ return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L'=> $prop[3]);
844
+ }
845
+ return array();
846
+ }
847
+
848
+ /*-- BORDER-RADIUS --*/
849
+ function border_radius_expand($val,$k) {
850
+ $b = array();
851
+ if ($k == 'BORDER-RADIUS') {
852
+ $hv = explode('/',trim($val));
853
+ $prop = preg_split('/\s+/',trim($hv[0]));
854
+ if (count($prop)==1) {
855
+ $b['TL-H'] = $b['TR-H'] = $b['BR-H'] = $b['BL-H'] = $prop[0];
856
+ }
857
+ else if (count($prop)==2) {
858
+ $b['TL-H'] = $b['BR-H'] = $prop[0];
859
+ $b['TR-H'] = $b['BL-H'] = $prop[1];
860
+ }
861
+ else if (count($prop)==3) {
862
+ $b['TL-H'] = $prop[0];
863
+ $b['TR-H'] = $b['BL-H'] = $prop[1];
864
+ $b['BR-H'] = $prop[2];
865
+ }
866
+ else if (count($prop)==4) {
867
+ $b['TL-H'] = $prop[0];
868
+ $b['TR-H'] = $prop[1];
869
+ $b['BR-H'] = $prop[2];
870
+ $b['BL-H'] = $prop[3];
871
+ }
872
+ if (count($hv)==2) {
873
+ $prop = preg_split('/\s+/',trim($hv[1]));
874
+ if (count($prop)==1) {
875
+ $b['TL-V'] = $b['TR-V'] = $b['BR-V'] = $b['BL-V'] = $prop[0];
876
+ }
877
+ else if (count($prop)==2) {
878
+ $b['TL-V'] = $b['BR-V'] = $prop[0];
879
+ $b['TR-V'] = $b['BL-V'] = $prop[1];
880
+ }
881
+ else if (count($prop)==3) {
882
+ $b['TL-V'] = $prop[0];
883
+ $b['TR-V'] = $b['BL-V'] = $prop[1];
884
+ $b['BR-V'] = $prop[2];
885
+ }
886
+ else if (count($prop)==4) {
887
+ $b['TL-V'] = $prop[0];
888
+ $b['TR-V'] = $prop[1];
889
+ $b['BR-V'] = $prop[2];
890
+ $b['BL-V'] = $prop[3];
891
+ }
892
+ }
893
+ else {
894
+ $b['TL-V'] = $b['TL-H'];
895
+ $b['TR-V'] = $b['TR-H'];
896
+ $b['BL-V'] = $b['BL-H'];
897
+ $b['BR-V'] = $b['BR-H'];
898
+ }
899
+ return $b;
900
+ }
901
+
902
+ // Parse 2
903
+ $h = 0;
904
+ $v = 0;
905
+ $prop = preg_split('/\s+/',trim($val));
906
+ if (count($prop)==1) { $h = $v = $val; }
907
+ else { $h = $prop[0]; $v = $prop[1]; }
908
+ if ($h==0 || $v==0) { $h = $v = 0; }
909
+ if ($k == 'BORDER-TOP-LEFT-RADIUS') {
910
+ $b['TL-H'] = $h;
911
+ $b['TL-V'] = $v;
912
+ }
913
+ else if ($k == 'BORDER-TOP-RIGHT-RADIUS') {
914
+ $b['TR-H'] = $h;
915
+ $b['TR-V'] = $v;
916
+ }
917
+ else if ($k == 'BORDER-BOTTOM-LEFT-RADIUS') {
918
+ $b['BL-H'] = $h;
919
+ $b['BL-V'] = $v;
920
+ }
921
+ else if ($k == 'BORDER-BOTTOM-RIGHT-RADIUS') {
922
+ $b['BR-H'] = $h;
923
+ $b['BR-V'] = $v;
924
+ }
925
+ return $b;
926
+
927
+ }
928
+ /*-- END BORDER-RADIUS --*/
929
+
930
+ function _mergeCSS($p, &$t) {
931
+ // Save Cascading CSS e.g. "div.topic p" at this block level
932
+ if (isset($p) && $p) {
933
+ if ($t) {
934
+ $t = $this->array_merge_recursive_unique($t, $p);
935
+ }
936
+ else { $t = $p; }
937
+ }
938
+ }
939
+
940
+ // for CSS handling
941
+ function array_merge_recursive_unique($array1, $array2) {
942
+ $arrays = func_get_args();
943
+ $narrays = count($arrays);
944
+ $ret = $arrays[0];
945
+ for ($i = 1; $i < $narrays; $i ++) {
946
+ foreach ($arrays[$i] as $key => $value) {
947
+ if (((string) $key) === ((string) intval($key))) { // integer or string as integer key - append
948
+ $ret[] = $value;
949
+ }
950
+ else { // string key - merge
951
+ if (is_array($value) && isset($ret[$key])) {
952
+ $ret[$key] = $this->array_merge_recursive_unique($ret[$key], $value);
953
+ }
954
+ else {
955
+ $ret[$key] = $value;
956
+ }
957
+ }
958
+ }
959
+ }
960
+ return $ret;
961
+ }
962
+
963
+
964
+
965
+ function _mergeFullCSS($p, &$t, $tag, $classes, $id) {
966
+ $this->_mergeCSS($p[$tag], $t);
967
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
968
+ foreach($classes AS $class) {
969
+ $this->_mergeCSS($p['CLASS>>'.$class], $t);
970
+ }
971
+ // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
972
+ if ($tag=='TR' && isset($p) && $p) {
973
+ foreach($p AS $k=>$val) {
974
+ if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
975
+ $select = false;
976
+ if ($tag=='TR') {
977
+ $row = $this->mpdf->row;
978
+ $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
979
+ $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
980
+ if ($this->mpdf->tabletfoot) { $row -= $thnr; }
981
+ else if (!$this->mpdf->tablethead) { $row -= ($thnr + $tfnr); }
982
+ if ($m[1]=='ODD' && ($row % 2) == 0) { $select = true; }
983
+ else if ($m[1]=='EVEN' && ($row % 2) == 1) { $select = true; }
984
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
985
+ if ((($row + 1) % $a[1]) == $a[2]) { $select = true; }
986
+ }
987
+ }
988
+ else if ($tag=='TD' || $tag=='TH') {
989
+ if ($m[1]=='ODD' && ($this->mpdf->col % 2) == 0) { $select = true; }
990
+ else if ($m[1]=='EVEN' && ($this->mpdf->col % 2) == 1) { $select = true; }
991
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
992
+ if ((($this->mpdf->col + 1) % $a[1]) == $a[2]) { $select = true; }
993
+ }
994
+ }
995
+ if ($select) {
996
+ $this->_mergeCSS($p[$tag.'>>SELECTORNTHCHILD>>'.$m[1]], $t);
997
+ }
998
+ }
999
+ }
1000
+ }
1001
+ // STYLESHEET CLASS e.g. #smallone{} #redletter{}
1002
+ if (isset($id) && $id) {
1003
+ $this->_mergeCSS($p['ID>>'.$id], $t);
1004
+ }
1005
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1006
+ foreach($classes AS $class) {
1007
+ $this->_mergeCSS($p[$tag.'>>CLASS>>'.$class], $t);
1008
+ }
1009
+ // STYLESHEET CLASS e.g. #smallone{} #redletter{}
1010
+ if (isset($id)) {
1011
+ $this->_mergeCSS($p[$tag.'>>ID>>'.$id], $t);
1012
+ }
1013
+ }
1014
+
1015
+ function setBorderDominance($prop, $val) {
1016
+ if (isset($prop['BORDER-LEFT']) && $prop['BORDER-LEFT']) { $this->cell_border_dominance_L = $val; }
1017
+ if (isset($prop['BORDER-RIGHT']) && $prop['BORDER-RIGHT']) { $this->cell_border_dominance_R = $val; }
1018
+ if (isset($prop['BORDER-TOP']) && $prop['BORDER-TOP']) { $this->cell_border_dominance_T = $val; }
1019
+ if (isset($prop['BORDER-BOTTOM']) && $prop['BORDER-BOTTOM']) { $this->cell_border_dominance_B = $val; }
1020
+ }
1021
+
1022
+ function _set_mergedCSS(&$m, &$p, $d=true, $bd=false) {
1023
+ if (isset($m)) {
1024
+ if ((isset($m['depth']) && $m['depth']>1) || $d==false) { // include check for 'depth'
1025
+ if ($bd) { $this->setBorderDominance($m, $bd); } // *TABLES*
1026
+ if (is_array($m)) {
1027
+ $p = array_merge($p,$m);
1028
+ $this->_mergeBorders($p,$m);
1029
+ }
1030
+ }
1031
+ }
1032
+ }
1033
+
1034
+
1035
+ function _mergeBorders(&$b, &$a) { // Merges $a['BORDER-TOP-STYLE'] to $b['BORDER-TOP'] etc.
1036
+ foreach(array('TOP','RIGHT','BOTTOM','LEFT') AS $side) {
1037
+ foreach(array('STYLE','WIDTH','COLOR') AS $el) {
1038
+ if (isset($a['BORDER-'.$side.'-'.$el])) { // e.g. $b['BORDER-TOP-STYLE']
1039
+ $s = trim($a['BORDER-'.$side.'-'.$el]);
1040
+ if (isset($b['BORDER-'.$side])) { // e.g. $b['BORDER-TOP']
1041
+ $p = trim($b['BORDER-'.$side]);
1042
+ }
1043
+ else { $p = ''; }
1044
+ if ($el=='STYLE') {
1045
+ if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 '.$s.' \\3', $p); }
1046
+ else { $b['BORDER-'.$side] = '0px '.$s.' #000000'; }
1047
+ }
1048
+ else if ($el=='WIDTH') {
1049
+ if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', $s.' \\2 \\3', $p); }
1050
+ else { $b['BORDER-'.$side] = $s.' none #000000'; }
1051
+ }
1052
+ else if ($el=='COLOR') {
1053
+ if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 \\2 '.$s, $p); }
1054
+ else { $b['BORDER-'.$side] = '0px none '.$s; }
1055
+ }
1056
+ }
1057
+ }
1058
+ }
1059
+ }
1060
+
1061
+
1062
+ function MergeCSS($inherit,$tag,$attr) {
1063
+ $p = array();
1064
+ $zp = array();
1065
+
1066
+ $classes = array();
1067
+ if (isset($attr['CLASS'])) {
1068
+ $classes = preg_split('/\s+/',$attr['CLASS']);
1069
+ }
1070
+ if (!isset($attr['ID'])) { $attr['ID']=''; }
1071
+ //===============================================
1072
+ /*-- TABLES --*/
1073
+ // Set Inherited properties
1074
+ if ($inherit == 'TOPTABLE') { // $tag = TABLE
1075
+ //===============================================
1076
+ // Save Cascading CSS e.g. "div.topic p" at this block level
1077
+
1078
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'])) {
1079
+ $this->tablecascadeCSS[0] = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
1080
+ }
1081
+ else {
1082
+ $this->tablecascadeCSS[0] = $this->cascadeCSS;
1083
+ }
1084
+ }
1085
+ //===============================================
1086
+ // Set Inherited properties
1087
+ if ($inherit == 'TOPTABLE' || $inherit == 'TABLE') {
1088
+ //Cascade everything from last level that is not an actual property, or defined by current tag/attributes
1089
+ if (isset($this->tablecascadeCSS[$this->tbCSSlvl-1]) && is_array($this->tablecascadeCSS[$this->tbCSSlvl-1])) {
1090
+ foreach($this->tablecascadeCSS[$this->tbCSSlvl-1] AS $k=>$v) {
1091
+ $this->tablecascadeCSS[$this->tbCSSlvl][$k] = $v;
1092
+ }
1093
+ }
1094
+ $this->_mergeFullCSS($this->cascadeCSS, $this->tablecascadeCSS[$this->tbCSSlvl], $tag, $classes, $attr['ID']);
1095
+ //===============================================
1096
+ // Cascading forward CSS e.g. "table.topic td" for this table in $this->tablecascadeCSS
1097
+ //===============================================
1098
+ // STYLESHEET TAG e.g. table
1099
+ $this->_mergeFullCSS($this->tablecascadeCSS[$this->tbCSSlvl-1], $this->tablecascadeCSS[$this->tbCSSlvl], $tag, $classes, $attr['ID']);
1100
+ //===============================================
1101
+ }
1102
+ /*-- END TABLES --*/
1103
+ //===============================================
1104
+ /*-- LISTS --*/
1105
+ // Set Inherited properties
1106
+ if ($inherit == 'TOPLIST') { // $tag = UL,OL
1107
+ //===============================================
1108
+ // Save Cascading CSS e.g. "div.topic p" at this block level
1109
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'])) {
1110
+ $this->listcascadeCSS[0] = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
1111
+ }
1112
+ else {
1113
+ $this->listcascadeCSS[0] = $this->cascadeCSS;
1114
+ }
1115
+ }
1116
+ //===============================================
1117
+ // Set Inherited properties
1118
+ if ($inherit == 'TOPLIST' || $inherit == 'LIST') {
1119
+ //Cascade everything from last level that is not an actual property, or defined by current tag/attributes
1120
+ if (isset($this->listcascadeCSS[$this->listCSSlvl-1]) && is_array($this->listcascadeCSS[$this->listCSSlvl-1])) {
1121
+ foreach($this->listcascadeCSS[$this->listCSSlvl-1] AS $k=>$v) {
1122
+ $this->listcascadeCSS[$this->listCSSlvl][$k] = $v;
1123
+ }
1124
+ }
1125
+ $this->_mergeFullCSS($this->cascadeCSS, $this->listcascadeCSS[$this->listCSSlvl], $tag, $classes, $attr['ID']);
1126
+ //===============================================
1127
+ // Cascading forward CSS e.g. "table.topic td" for this list in $this->listcascadeCSS
1128
+ //===============================================
1129
+ // STYLESHEET TAG e.g. table
1130
+ $this->_mergeFullCSS($this->listcascadeCSS[$this->listCSSlvl-1], $this->listcascadeCSS[$this->listCSSlvl], $tag, $classes, $attr['ID']);
1131
+ //===============================================
1132
+ }
1133
+ /*-- END LISTS --*/
1134
+ //===============================================
1135
+ // Set Inherited properties
1136
+ if ($inherit == 'BLOCK') {
1137
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS']) && is_array($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'])) {
1138
+ foreach($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'] AS $k=>$v) {
1139
+ $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$k] = $v;
1140
+
1141
+ }
1142
+ }
1143
+
1144
+ //===============================================
1145
+ // Save Cascading CSS e.g. "div.topic p" at this block level
1146
+ $this->_mergeFullCSS($this->cascadeCSS, $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID']);
1147
+ //===============================================
1148
+ // Cascading forward CSS
1149
+ //===============================================
1150
+ $this->_mergeFullCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'], $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID']);
1151
+ //===============================================
1152
+ // Block properties
1153
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['margin_collapse']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['margin_collapse']) { $p['MARGIN-COLLAPSE'] = 'COLLAPSE'; } // custom tag, but follows CSS principle that border-collapse is inherited
1154
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['line_height']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['line_height']) { $p['LINE-HEIGHT'] = $this->mpdf->blk[$this->mpdf->blklvl-1]['line_height']; }
1155
+
1156
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['direction']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['direction']) { $p['DIRECTION'] = $this->mpdf->blk[$this->mpdf->blklvl-1]['direction']; }
1157
+
1158
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['align']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['align']) {
1159
+ if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'L') { $p['TEXT-ALIGN'] = 'left'; }
1160
+ else if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'J') { $p['TEXT-ALIGN'] = 'justify'; }
1161
+ else if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'R') { $p['TEXT-ALIGN'] = 'right'; }
1162
+ else if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'C') { $p['TEXT-ALIGN'] = 'center'; }
1163
+ }
1164
+ if ($this->mpdf->ColActive || $this->mpdf->keep_block_together) {
1165
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['bgcolor']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['bgcolor']) { // Doesn't officially inherit, but default value is transparent (?=inherited)
1166
+ $cor = $this->mpdf->blk[$this->mpdf->blklvl-1]['bgcolorarray' ];
1167
+ $p['BACKGROUND-COLOR'] = $this->mpdf->_colAtoString($cor);
1168
+ }
1169
+ }
1170
+
1171
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent']) && ($this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent'] || $this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent']===0)) { $p['TEXT-INDENT'] = $this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent']; }
1172
+ if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['InlineProperties'])) {
1173
+ $biilp = $this->mpdf->blk[$this->mpdf->blklvl-1]['InlineProperties'];
1174
+ }
1175
+ else { $biilp = null; }
1176
+ if (isset($biilp[ 'family' ]) && $biilp[ 'family' ]) { $p['FONT-FAMILY'] = $biilp[ 'family' ]; }
1177
+ if (isset($biilp[ 'I' ]) && $biilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
1178
+ if (isset($biilp[ 'sizePt' ]) && $biilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $biilp[ 'sizePt' ] . 'pt'; }
1179
+ if (isset($biilp[ 'B' ]) && $biilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
1180
+ if (isset($biilp[ 'colorarray' ]) && $biilp[ 'colorarray' ]) {
1181
+ $cor = $biilp[ 'colorarray' ];
1182
+ $p['COLOR'] = $this->mpdf->_colAtoString($cor);
1183
+ }
1184
+ if (isset($biilp[ 'fontkerning' ])) {
1185
+ if ($biilp[ 'fontkerning' ]) { $p['FONT-KERNING'] = 'normal'; }
1186
+ else { $p['FONT-KERNING'] = 'none'; }
1187
+ }
1188
+ if (isset($biilp[ 'lSpacingCSS' ]) && $biilp[ 'lSpacingCSS' ]) { $p['LETTER-SPACING'] = $biilp[ 'lSpacingCSS' ]; }
1189
+ if (isset($biilp[ 'wSpacingCSS' ]) && $biilp[ 'wSpacingCSS' ]) { $p['WORD-SPACING'] = $biilp[ 'wSpacingCSS' ]; }
1190
+ if (isset($biilp[ 'toupper' ]) && $biilp[ 'toupper' ]) { $p['TEXT-TRANSFORM'] = 'uppercase'; }
1191
+ else if (isset($biilp[ 'tolower' ]) && $biilp[ 'tolower' ]) { $p['TEXT-TRANSFORM'] = 'lowercase'; }
1192
+ else if (isset($biilp[ 'capitalize' ]) && $biilp[ 'capitalize' ]) { $p['TEXT-TRANSFORM'] = 'capitalize'; }
1193
+ // CSS says text-decoration is not inherited, but IE7 does??
1194
+ if (isset($biilp[ 'underline' ]) && $biilp[ 'underline' ]) { $p['TEXT-DECORATION'] = 'underline'; }
1195
+ if (isset($biilp[ 'smCaps' ]) && $biilp[ 'smCaps' ]) { $p['FONT-VARIANT'] = 'small-caps'; }
1196
+
1197
+ }
1198
+ //===============================================
1199
+ //===============================================
1200
+ /*-- LISTS --*/
1201
+ // Set Inherited properties
1202
+ if ($inherit == 'TOPLIST') {
1203
+ if ($this->listCSSlvl == 1) {
1204
+ $bilp = $this->mpdf->blk[$this->mpdf->blklvl]['InlineProperties'];
1205
+ if (isset($bilp[ 'family' ]) && $bilp[ 'family' ]) { $p['FONT-FAMILY'] = $bilp[ 'family' ]; }
1206
+ if (isset($bilp[ 'I' ]) && $bilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
1207
+ if (isset($bilp[ 'sizePt' ]) && $bilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $bilp[ 'sizePt' ] . 'pt'; }
1208
+ if (isset($bilp[ 'B' ]) && $bilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
1209
+ if (isset($bilp[ 'colorarray' ]) && $bilp[ 'colorarray' ]) {
1210
+ $cor = $bilp[ 'colorarray' ];
1211
+ $p['COLOR'] = $this->mpdf->_colAtoString($cor);
1212
+ }
1213
+ if (isset($bilp[ 'toupper' ]) && $bilp[ 'toupper' ]) { $p['TEXT-TRANSFORM'] = 'uppercase'; }
1214
+ else if (isset($bilp[ 'tolower' ]) && $bilp[ 'tolower' ]) { $p['TEXT-TRANSFORM'] = 'lowercase'; }
1215
+ else if (isset($bilp[ 'capitalize' ]) && $bilp[ 'capitalize' ]) { $p['TEXT-TRANSFORM'] = 'capitalize'; }
1216
+ if (isset($bilp[ 'fontkerning' ])) {
1217
+ if ($bilp[ 'fontkerning' ]) { $p['FONT-KERNING'] = 'normal'; }
1218
+ else { $p['FONT-KERNING'] = 'none'; }
1219
+ }
1220
+ if (isset($bilp[ 'lSpacingCSS' ]) && $bilp[ 'lSpacingCSS' ]) { $p['LETTER-SPACING'] = $bilp[ 'lSpacingCSS' ]; }
1221
+ if (isset($bilp[ 'wSpacingCSS' ]) && $bilp[ 'wSpacingCSS' ]) { $p['WORD-SPACING'] = $bilp[ 'wSpacingCSS' ]; }
1222
+ // CSS says text-decoration is not inherited, but IE7 does??
1223
+ if (isset($bilp[ 'underline' ]) && $bilp[ 'underline' ]) { $p['TEXT-DECORATION'] = 'underline'; }
1224
+ if (isset($bilp[ 'smCaps' ]) && $bilp[ 'smCaps' ]) { $p['FONT-VARIANT'] = 'small-caps'; }
1225
+ if ($tag=='LI') {
1226
+ // Note to self - this should never work, as TOPLIST is not called when LI (see code removed in v5.3)
1227
+ $this->mpdf->Error("If you see this message, please report this as a bug to the mPDF Forum.");
1228
+ }
1229
+ }
1230
+ }
1231
+ /*-- END LISTS --*/
1232
+ //===============================================
1233
+ //===============================================
1234
+ // DEFAULT for this TAG set in DefaultCSS
1235
+ if (isset($this->mpdf->defaultCSS[$tag])) {
1236
+ $zp = $this->fixCSS($this->mpdf->defaultCSS[$tag]);
1237
+ if (is_array($zp)) { // Default overwrites Inherited
1238
+ $p = array_merge($p,$zp); // !! Note other way round !!
1239
+ $this->_mergeBorders($p,$zp);
1240
+ }
1241
+ }
1242
+ //===============================================
1243
+ /*-- TABLES --*/
1244
+ // cellPadding overwrites TD/TH default but not specific CSS set on cell
1245
+ if (($tag=='TD' || $tag=='TH') && isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding']) && ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'] || $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding']===0)) {
1246
+ $p['PADDING-LEFT'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1247
+ $p['PADDING-RIGHT'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1248
+ $p['PADDING-TOP'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1249
+ $p['PADDING-BOTTOM'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1250
+ }
1251
+ /*-- END TABLES --*/
1252
+ //===============================================
1253
+ // STYLESHEET TAG e.g. h1 p div table
1254
+ if (isset($this->CSS[$tag]) && $this->CSS[$tag]) {
1255
+ $zp = $this->CSS[$tag];
1256
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1257
+ if (is_array($zp)) {
1258
+ $p = array_merge($p,$zp);
1259
+ $this->_mergeBorders($p,$zp);
1260
+ }
1261
+ }
1262
+ //===============================================
1263
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1264
+ foreach($classes AS $class) {
1265
+ $zp = array();
1266
+ if (isset($this->CSS['CLASS>>'.$class]) && $this->CSS['CLASS>>'.$class]) { $zp = $this->CSS['CLASS>>'.$class]; }
1267
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1268
+ if (is_array($zp)) {
1269
+ $p = array_merge($p,$zp);
1270
+ $this->_mergeBorders($p,$zp);
1271
+ }
1272
+ }
1273
+ //===============================================
1274
+ /*-- TABLES --*/
1275
+ // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
1276
+ if ($tag=='TR' || $tag=='TD' || $tag=='TH') {
1277
+ foreach($this->CSS AS $k=>$val) {
1278
+ if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
1279
+ $select = false;
1280
+ if ($tag=='TR') {
1281
+ $row = $this->mpdf->row;
1282
+ $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
1283
+ $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
1284
+ if ($this->mpdf->tabletfoot) { $row -= $thnr; }
1285
+ else if (!$this->mpdf->tablethead) { $row -= ($thnr + $tfnr); }
1286
+ if ($m[1]=='ODD' && ($row % 2) == 0) { $select = true; }
1287
+ else if ($m[1]=='EVEN' && ($row % 2) == 1) { $select = true; }
1288
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
1289
+ if ((($row + 1) % $a[1]) == $a[2]) { $select = true; }
1290
+ }
1291
+ }
1292
+ else if ($tag=='TD' || $tag=='TH') {
1293
+ if ($m[1]=='ODD' && ($this->mpdf->col % 2) == 0) { $select = true; }
1294
+ else if ($m[1]=='EVEN' && ($this->mpdf->col % 2) == 1) { $select = true; }
1295
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
1296
+ if ((($this->mpdf->col+1) % $a[1]) == $a[2]) { $select = true; }
1297
+ }
1298
+ }
1299
+ if ($select) {
1300
+ $zp = $this->CSS[$tag.'>>SELECTORNTHCHILD>>'.$m[1]];
1301
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); }
1302
+ if (is_array($zp)) {
1303
+ $p = array_merge($p,$zp);
1304
+ $this->_mergeBorders($p,$zp);
1305
+ }
1306
+ }
1307
+ }
1308
+ }
1309
+ }
1310
+ /*-- END TABLES --*/
1311
+ //===============================================
1312
+ // STYLESHEET ID e.g. #smallone{} #redletter{}
1313
+ if (isset($attr['ID']) && isset($this->CSS['ID>>'.$attr['ID']]) && $this->CSS['ID>>'.$attr['ID']]) {
1314
+ $zp = $this->CSS['ID>>'.$attr['ID']];
1315
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1316
+ if (is_array($zp)) {
1317
+ $p = array_merge($p,$zp);
1318
+ $this->_mergeBorders($p,$zp);
1319
+ }
1320
+ }
1321
+ //===============================================
1322
+ // STYLESHEET CLASS e.g. p.smallone{} div.redletter{}
1323
+ foreach($classes AS $class) {
1324
+ $zp = array();
1325
+ if (isset($this->CSS[$tag.'>>CLASS>>'.$class]) && $this->CSS[$tag.'>>CLASS>>'.$class]) { $zp = $this->CSS[$tag.'>>CLASS>>'.$class]; }
1326
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1327
+ if (is_array($zp)) {
1328
+ $p = array_merge($p,$zp);
1329
+ $this->_mergeBorders($p,$zp);
1330
+ }
1331
+ }
1332
+ //===============================================
1333
+ // STYLESHEET CLASS e.g. p#smallone{} div#redletter{}
1334
+ if (isset($attr['ID']) && isset($this->CSS[$tag.'>>ID>>'.$attr['ID']]) && $this->CSS[$tag.'>>ID>>'.$attr['ID']]) {
1335
+ $zp = $this->CSS[$tag.'>>ID>>'.$attr['ID']];
1336
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1337
+ if (is_array($zp)) {
1338
+ $p = array_merge($p,$zp);
1339
+ $this->_mergeBorders($p,$zp);
1340
+ }
1341
+ }
1342
+ //===============================================
1343
+ // Cascaded e.g. div.class p only works for block level
1344
+ if ($inherit == 'BLOCK') {
1345
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'][$tag], $p);
1346
+ foreach($classes AS $class) {
1347
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS']['CLASS>>'.$class], $p);
1348
+ }
1349
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS']['ID>>'.$attr['ID']], $p);
1350
+ foreach($classes AS $class) {
1351
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'][$tag.'>>CLASS>>'.$class], $p);
1352
+ }
1353
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'][$tag.'>>ID>>'.$attr['ID']], $p);
1354
+ }
1355
+ else if ($inherit == 'INLINE') {
1356
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag], $p);
1357
+ foreach($classes AS $class) {
1358
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS']['CLASS>>'.$class], $p);
1359
+ }
1360
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS']['ID>>'.$attr['ID']], $p);
1361
+ foreach($classes AS $class) {
1362
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag.'>>CLASS>>'.$class], $p);
1363
+ }
1364
+ $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag.'>>ID>>'.$attr['ID']], $p);
1365
+ }
1366
+ /*-- TABLES --*/
1367
+ else if ($inherit == 'TOPTABLE' || $inherit == 'TABLE') { // NB looks at $this->tablecascadeCSS-1 for cascading CSS
1368
+ // false, 9 = don't check for 'depth' and do set border dominance
1369
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag], $p, false, 9);
1370
+ foreach($classes AS $class) {
1371
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1]['CLASS>>'.$class], $p, false, 9);
1372
+ }
1373
+ // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
1374
+ if ($tag=='TR' || $tag=='TD' || $tag=='TH') {
1375
+ foreach($this->tablecascadeCSS[$this->tbCSSlvl-1] AS $k=>$val) {
1376
+ if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
1377
+ $select = false;
1378
+ if ($tag=='TR') {
1379
+ $row = $this->mpdf->row;
1380
+ $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
1381
+ $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
1382
+ if ($this->mpdf->tabletfoot) { $row -= $thnr; }
1383
+ else if (!$this->mpdf->tablethead) { $row -= ($thnr + $tfnr); }
1384
+ if ($m[1]=='ODD' && ($row % 2) == 0) { $select = true; }
1385
+ else if ($m[1]=='EVEN' && ($row % 2) == 1) { $select = true; }
1386
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
1387
+ if ((($row + 1) % $a[1]) == $a[2]) { $select = true; }
1388
+ }
1389
+ }
1390
+ else if ($tag=='TD' || $tag=='TH') {
1391
+ if ($m[1]=='ODD' && ($this->mpdf->col % 2) == 0) { $select = true; }
1392
+ else if ($m[1]=='EVEN' && ($this->mpdf->col % 2) == 1) { $select = true; }
1393
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
1394
+ if ((($this->mpdf->col + 1) % $a[1]) == $a[2]) { $select = true; }
1395
+ }
1396
+ }
1397
+ if ($select) {
1398
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>SELECTORNTHCHILD>>'.$m[1]], $p, false, 9);
1399
+ }
1400
+ }
1401
+ }
1402
+ }
1403
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1]['ID>>'.$attr['ID']], $p, false, 9);
1404
+ foreach($classes AS $class) {
1405
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>CLASS>>'.$class], $p, false, 9);
1406
+ }
1407
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>ID>>'.$attr['ID']], $p, false, 9);
1408
+ }
1409
+ /*-- END TABLES --*/
1410
+ //===============================================
1411
+ /*-- LISTS --*/
1412
+ else if ($inherit == 'TOPLIST' || $inherit == 'LIST') { // NB looks at $this->listcascadeCSS-1 for cascading CSS
1413
+ // false = don't check for 'depth'
1414
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag], $p, false);
1415
+ foreach($classes AS $class) {
1416
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1]['CLASS>>'.$class], $p, false);
1417
+ }
1418
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1]['ID>>'.$attr['ID']], $p, false);
1419
+ foreach($classes AS $class) {
1420
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag.'>>CLASS>>'.$class], $p, false);
1421
+ }
1422
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag.'>>ID>>'.$attr['ID']], $p, false);
1423
+ }
1424
+ /*-- END LISTS --*/
1425
+ //===============================================
1426
+ //===============================================
1427
+ // INLINE STYLE e.g. style="CSS:property"
1428
+ if (isset($attr['STYLE'])) {
1429
+ $zp = $this->readInlineCSS($attr['STYLE']);
1430
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1431
+ if (is_array($zp)) {
1432
+ $p = array_merge($p,$zp);
1433
+ $this->_mergeBorders($p,$zp);
1434
+ }
1435
+ }
1436
+ //===============================================
1437
+ //===============================================
1438
+ // INLINE ATTRIBUTES e.g. .. ALIGN="CENTER">
1439
+ if (isset($attr['LANG']) and $attr['LANG']!='') {
1440
+ $p['LANG'] = $attr['LANG'];
1441
+ }
1442
+ if (isset($attr['COLOR']) and $attr['COLOR']!='') {
1443
+ $p['COLOR'] = $attr['COLOR'];
1444
+ }
1445
+ if ($tag != 'INPUT') {
1446
+ if (isset($attr['WIDTH']) and $attr['WIDTH']!='') {
1447
+ $p['WIDTH'] = $attr['WIDTH'];
1448
+ }
1449
+ if (isset($attr['HEIGHT']) and $attr['HEIGHT']!='') {
1450
+ $p['HEIGHT'] = $attr['HEIGHT'];
1451
+ }
1452
+ }
1453
+ if ($tag == 'FONT') {
1454
+ if (isset($attr['FACE'])) {
1455
+ $p['FONT-FAMILY'] = $attr['FACE'];
1456
+ }
1457
+ if (isset($attr['SIZE']) and $attr['SIZE']!='') {
1458
+ $s = '';
1459
+ if ($attr['SIZE'] === '+1') { $s = '120%'; }
1460
+ else if ($attr['SIZE'] === '-1') { $s = '86%'; }
1461
+ else if ($attr['SIZE'] === '1') { $s = 'XX-SMALL'; }
1462
+ else if ($attr['SIZE'] == '2') { $s = 'X-SMALL'; }
1463
+ else if ($attr['SIZE'] == '3') { $s = 'SMALL'; }
1464
+ else if ($attr['SIZE'] == '4') { $s = 'MEDIUM'; }
1465
+ else if ($attr['SIZE'] == '5') { $s = 'LARGE'; }
1466
+ else if ($attr['SIZE'] == '6') { $s = 'X-LARGE'; }
1467
+ else if ($attr['SIZE'] == '7') { $s = 'XX-LARGE'; }
1468
+ if ($s) $p['FONT-SIZE'] = $s;
1469
+ }
1470
+ }
1471
+ if (isset($attr['VALIGN']) and $attr['VALIGN']!='') {
1472
+ $p['VERTICAL-ALIGN'] = $attr['VALIGN'];
1473
+ }
1474
+ if (isset($attr['VSPACE']) and $attr['VSPACE']!='') {
1475
+ $p['MARGIN-TOP'] = $attr['VSPACE'];
1476
+ $p['MARGIN-BOTTOM'] = $attr['VSPACE'];
1477
+ }
1478
+ if (isset($attr['HSPACE']) and $attr['HSPACE']!='') {
1479
+ $p['MARGIN-LEFT'] = $attr['HSPACE'];
1480
+ $p['MARGIN-RIGHT'] = $attr['HSPACE'];
1481
+ }
1482
+ //===============================================
1483
+ return $p;
1484
+ }
1485
+
1486
+ function PreviewBlockCSS($tag,$attr) {
1487
+ // Looks ahead from current block level to a new level
1488
+ $p = array();
1489
+ $zp = array();
1490
+ $oldcascadeCSS = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
1491
+ $classes = array();
1492
+ if (isset($attr['CLASS'])) { $classes = preg_split('/\s+/',$attr['CLASS']); }
1493
+ //===============================================
1494
+ // DEFAULT for this TAG set in DefaultCSS
1495
+ if (isset($this->mpdf->defaultCSS[$tag])) {
1496
+ $zp = $this->fixCSS($this->mpdf->defaultCSS[$tag]);
1497
+ if (is_array($zp)) { $p = array_merge($zp,$p); } // Inherited overwrites default
1498
+ }
1499
+ // STYLESHEET TAG e.g. h1 p div table
1500
+ if (isset($this->CSS[$tag])) {
1501
+ $zp = $this->CSS[$tag];
1502
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
1503
+ }
1504
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1505
+ foreach($classes AS $class) {
1506
+ $zp = array();
1507
+ if (isset($this->CSS['CLASS>>'.$class])) { $zp = $this->CSS['CLASS>>'.$class]; }
1508
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
1509
+ }
1510
+ // STYLESHEET ID e.g. #smallone{} #redletter{}
1511
+ if (isset($attr['ID']) && isset($this->CSS['ID>>'.$attr['ID']])) {
1512
+ $zp = $this->CSS['ID>>'.$attr['ID']];
1513
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
1514
+ }
1515
+ // STYLESHEET CLASS e.g. p.smallone{} div.redletter{}
1516
+ foreach($classes AS $class) {
1517
+ $zp = array();
1518
+ if (isset($this->CSS[$tag.'>>CLASS>>'.$class])) { $zp = $this->CSS[$tag.'>>CLASS>>'.$class]; }
1519
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
1520
+ }
1521
+ // STYLESHEET CLASS e.g. p#smallone{} div#redletter{}
1522
+ if (isset($attr['ID']) && isset($this->CSS[$tag.'>>ID>>'.$attr['ID']])) {
1523
+ $zp = $this->CSS[$tag.'>>ID>>'.$attr['ID']];
1524
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
1525
+ }
1526
+ //===============================================
1527
+ // STYLESHEET TAG e.g. div h1 div p
1528
+
1529
+ $this->_set_mergedCSS($oldcascadeCSS[$tag], $p);
1530
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1531
+ foreach($classes AS $class) {
1532
+
1533
+ $this->_set_mergedCSS($oldcascadeCSS['CLASS>>'.$class], $p);
1534
+ }
1535
+ // STYLESHEET CLASS e.g. #smallone{} #redletter{}
1536
+ if (isset($attr['ID'])) {
1537
+
1538
+ $this->_set_mergedCSS($oldcascadeCSS['ID>>'.$attr['ID']], $p);
1539
+ }
1540
+ // STYLESHEET CLASS e.g. div.smallone{} p.redletter{}
1541
+ foreach($classes AS $class) {
1542
+
1543
+ $this->_set_mergedCSS($oldcascadeCSS[$tag.'>>CLASS>>'.$class], $p);
1544
+ }
1545
+ // STYLESHEET CLASS e.g. div#smallone{} p#redletter{}
1546
+ if (isset($attr['ID'])) {
1547
+
1548
+ $this->_set_mergedCSS($oldcascadeCSS[$tag.'>>ID>>'.$attr['ID']], $p);
1549
+ }
1550
+ //===============================================
1551
+ // INLINE STYLE e.g. style="CSS:property"
1552
+ if (isset($attr['STYLE'])) {
1553
+ $zp = $this->readInlineCSS($attr['STYLE']);
1554
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
1555
+ }
1556
+ //===============================================
1557
+ return $p;
1558
+ }
1559
+
1560
+
1561
+
1562
+
1563
+
1564
+ } // end of class
1565
+
1566
+ ?>
mPDF/classes/directw.php ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class directw {
4
+
5
+ var $mpdf = null;
6
+
7
+ function directw(&$mpdf) {
8
+ $this->mpdf = $mpdf;
9
+ }
10
+
11
+
12
+ function Write($h,$txt,$currentx=0,$link='',$directionality='ltr',$align='') {
13
+ if (!$align) {
14
+ if ($directionality=='rtl') { $align = 'R'; }
15
+ else { $align = 'L'; }
16
+ }
17
+ if ($h == 0) { $this->mpdf->SetLineHeight(); $h = $this->mpdf->lineheight; }
18
+ //Output text in flowing mode
19
+ $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
20
+
21
+ $wmax = ($w - ($this->mpdf->cMarginL+$this->mpdf->cMarginR));
22
+ $s=str_replace("\r",'',$txt);
23
+ if ($this->mpdf->usingCoreFont) { $nb=strlen($s); }
24
+ else {
25
+ $nb=mb_strlen($s, $this->mpdf->mb_enc );
26
+ // handle single space character
27
+ if(($nb==1) && $s == " ") {
28
+ $this->mpdf->x += $this->mpdf->GetStringWidth($s);
29
+ return;
30
+ }
31
+ }
32
+ $sep=-1;
33
+ $i=0;
34
+ $j=0;
35
+ $l=0;
36
+ $nl=1;
37
+ if (!$this->mpdf->usingCoreFont) {
38
+ if (preg_match("/([".$this->mpdf->pregRTLchars."])/u", $txt)) { $this->mpdf->biDirectional = true; } // *RTL*
39
+ $checkCursive=false;
40
+ if ($this->mpdf->biDirectional) { $checkCursive=true; } // *RTL*
41
+ else if (isset($this->mpdf->CurrentFont['indic']) && $this->mpdf->CurrentFont['indic']) { $checkCursive=true; } // *INDIC*
42
+ while($i<$nb) {
43
+ //Get next character
44
+ $c = mb_substr($s,$i,1,$this->mpdf->mb_enc );
45
+ if($c == "\n") {
46
+ // WORD SPACING
47
+ $this->mpdf->ResetSpacing();
48
+ //Explicit line break
49
+ $tmp = rtrim(mb_substr($s,$j,$i-$j,$this->mpdf->mb_enc));
50
+ if ($directionality == 'rtl' && $align == 'J') { $align = 'R'; } // *RTL*
51
+ $this->mpdf->magic_reverse_dir($tmp, true, $directionality); // *RTL*
52
+ $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
53
+ $i++;
54
+ $sep = -1;
55
+ $j = $i;
56
+ $l = 0;
57
+ if($nl == 1) {
58
+ if ($currentx != 0) $this->mpdf->x=$currentx;
59
+ else $this->mpdf->x=$this->mpdf->lMargin;
60
+ $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
61
+ $wmax = ($w - ($this->mpdf->cMarginL+$this->mpdf->cMarginR));
62
+ }
63
+ $nl++;
64
+ continue;
65
+ }
66
+ if($c == " ") { $sep= $i; }
67
+ $l += $this->mpdf->GetCharWidthNonCore($c); // mPDF 5.3.04
68
+ if($l > $wmax) {
69
+ //Automatic line break (word wrapping)
70
+ if($sep == -1) {
71
+ // WORD SPACING
72
+ $this->mpdf->ResetSpacing();
73
+ if($this->mpdf->x > $this->mpdf->lMargin) {
74
+ //Move to next line
75
+ if ($currentx != 0) $this->mpdf->x=$currentx;
76
+ else $this->mpdf->x=$this->mpdf->lMargin;
77
+ $this->mpdf->y+=$h;
78
+ $w=$this->mpdf->w-$this->mpdf->rMargin-$this->mpdf->x;
79
+ $wmax = ($w - ($this->mpdf->cMarginL+$this->mpdf->cMarginR));
80
+ $i++;
81
+ $nl++;
82
+ continue;
83
+ }
84
+ if($i==$j) { $i++; }
85
+ $tmp = rtrim(mb_substr($s,$j,$i-$j,$this->mpdf->mb_enc));
86
+ if ($directionality == 'rtl' && $align == 'J') { $align = 'R'; } // *RTL*
87
+ $this->mpdf->magic_reverse_dir($tmp, true, $directionality); // *RTL*
88
+ $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
89
+ }
90
+ else {
91
+ $tmp = rtrim(mb_substr($s,$j,$sep-$j,$this->mpdf->mb_enc));
92
+ if ($directionality == 'rtl' && $align == 'J') { $align = 'R'; } // *RTL*
93
+ $this->mpdf->magic_reverse_dir($tmp, true, $directionality); // *RTL*
94
+
95
+ if($align=='J') {
96
+ //////////////////////////////////////////
97
+ // JUSTIFY J using Unicode fonts (Word spacing doesn't work)
98
+ // WORD SPACING
99
+ // Change NON_BREAKING SPACE to spaces so they are 'spaced' properly
100
+ $tmp = str_replace(chr(194).chr(160),chr(32),$tmp );
101
+ $len_ligne = $this->mpdf->GetStringWidth($tmp );
102
+ $nb_carac = mb_strlen( $tmp , $this->mpdf->mb_enc ) ;
103
+ $nb_spaces = mb_substr_count( $tmp ,' ', $this->mpdf->mb_enc ) ;
104
+ $inclCursive=false;
105
+ if ($checkCursive) {
106
+ if (preg_match("/([".$this->mpdf->pregRTLchars."])/u", $tmp)) { $inclCursive = true; } // *RTL*
107
+ if (preg_match("/([".$this->mpdf->pregHIchars.$this->mpdf->pregBNchars.$this->mpdf->pregPAchars."])/u", $tmp)) { $inclCursive = true; } // *INDIC*
108
+ }
109
+ list($charspacing,$ws) = $this->mpdf->GetJspacing($nb_carac,$nb_spaces,((($w-2) - $len_ligne) * _MPDFK),$inclCursive);
110
+ $this->mpdf->SetSpacing($charspacing,$ws);
111
+ //////////////////////////////////////////
112
+ }
113
+ $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
114
+ $i=$sep+1;
115
+ }
116
+ $sep = -1;
117
+ $j = $i;
118
+ $l = 0;
119
+ if($nl==1) {
120
+ if ($currentx != 0) $this->mpdf->x=$currentx;
121
+ else $this->mpdf->x=$this->mpdf->lMargin;
122
+ $w=$this->mpdf->w-$this->mpdf->rMargin-$this->mpdf->x;
123
+ $wmax = ($w - ($this->mpdf->cMarginL+$this->mpdf->cMarginR));
124
+ }
125
+ $nl++;
126
+ }
127
+ else { $i++; }
128
+ }
129
+ //Last chunk
130
+ // WORD SPACING
131
+ $this->mpdf->ResetSpacing();
132
+ }
133
+ else {
134
+ while($i<$nb) {
135
+ //Get next character
136
+ $c=$s[$i];
137
+ if($c == "\n") {
138
+ //Explicit line break
139
+ // WORD SPACING
140
+ $this->mpdf->ResetSpacing();
141
+ $this->mpdf->Cell($w, $h, substr($s, $j, $i-$j), 0, 2, $align, $fill, $link);
142
+ $i++;
143
+ $sep = -1;
144
+ $j = $i;
145
+ $l = 0;
146
+ if($nl == 1) {
147
+ if ($currentx != 0) $this->mpdf->x=$currentx;
148
+ else $this->mpdf->x=$this->mpdf->lMargin;
149
+ $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
150
+ $wmax=$w-($this->mpdf->cMarginL+$this->mpdf->cMarginR);
151
+ }
152
+ $nl++;
153
+ continue;
154
+ }
155
+ if($c == " ") { $sep= $i; }
156
+ $l += $this->mpdf->GetCharWidthCore($c); // mPDF 5.3.04
157
+ if($l > $wmax) {
158
+ //Automatic line break (word wrapping)
159
+ if($sep == -1) {
160
+ // WORD SPACING
161
+ $this->mpdf->ResetSpacing();
162
+ if($this->mpdf->x > $this->mpdf->lMargin) {
163
+ //Move to next line
164
+ if ($currentx != 0) $this->mpdf->x=$currentx;
165
+ else $this->mpdf->x=$this->mpdf->lMargin;
166
+ $this->mpdf->y+=$h;
167
+ $w=$this->mpdf->w-$this->mpdf->rMargin-$this->mpdf->x;
168
+ $wmax=$w-($this->mpdf->cMarginL+$this->mpdf->cMarginR);
169
+ $i++;
170
+ $nl++;
171
+ continue;
172
+ }
173
+ if($i==$j) { $i++; }
174
+ $this->mpdf->Cell($w, $h, substr($s, $j, $i-$j), 0, 2, $align, $fill, $link);
175
+ }
176
+ else {
177
+ $tmp = substr($s, $j, $sep-$j);
178
+ if($align=='J') {
179
+ //////////////////////////////////////////
180
+ // JUSTIFY J using Unicode fonts (Word spacing doesn't work)
181
+ // WORD SPACING
182
+ // Change NON_BREAKING SPACE to spaces so they are 'spaced' properly
183
+ $tmp = str_replace(chr(160),chr(32),$tmp );
184
+ $len_ligne = $this->mpdf->GetStringWidth($tmp );
185
+ $nb_carac = strlen( $tmp ) ;
186
+ $nb_spaces = substr_count( $tmp ,' ' ) ;
187
+ list($charspacing,$ws) = $this->mpdf->GetJspacing($nb_carac,$nb_spaces,((($w-2) - $len_ligne) * _MPDFK),$false);
188
+ $this->mpdf->SetSpacing($charspacing,$ws);
189
+ //////////////////////////////////////////
190
+ }
191
+ $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
192
+ $i=$sep+1;
193
+ }
194
+ $sep = -1;
195
+ $j = $i;
196
+ $l = 0;
197
+ if($nl==1) {
198
+ if ($currentx != 0) $this->mpdf->x=$currentx;
199
+ else $this->mpdf->x=$this->mpdf->lMargin;
200
+ $w=$this->mpdf->w-$this->mpdf->rMargin-$this->mpdf->x;
201
+ $wmax=$w-($this->mpdf->cMarginL+$this->mpdf->cMarginR);
202
+ }
203
+ $nl++;
204
+ }
205
+ else {
206
+ $i++;
207
+ }
208
+ }
209
+ // WORD SPACING
210
+ $this->mpdf->ResetSpacing();
211
+ }
212
+ //Last chunk
213
+ if($i!=$j) {
214
+ if ($currentx != 0) $this->mpdf->x=$currentx;
215
+ else $this->mpdf->x=$this->mpdf->lMargin;
216
+ if ($this->mpdf->usingCoreFont) { $tmp = substr($s,$j,$i-$j); }
217
+ else {
218
+ $tmp = mb_substr($s,$j,$i-$j,$this->mpdf->mb_enc);
219
+ if ($directionality == 'rtl' && $align == 'J') { $align = 'R'; } // *RTL*
220
+ $this->mpdf->magic_reverse_dir($tmp, true, $directionality); // *RTL*
221
+ }
222
+ $this->mpdf->Cell($w,$h,$tmp,0,0,$align,$fill,$link);
223
+ }
224
+ }
225
+
226
+
227
+ function CircularText($x, $y, $r, $text, $align='top', $fontfamily='', $fontsizePt=0, $fontstyle='', $kerning=120, $fontwidth=100, $divider='') { // mPDF 5.5.23
228
+ if ($font || $fontstyle || $fontsizePt) $this->mpdf->SetFont($fontfamily,$fontstyle,$fontsizePt);
229
+ $kerning/=100;
230
+ $fontwidth/=100;
231
+ if($kerning==0) $this->mpdf->Error('Please use values unequal to zero for kerning (CircularText)');
232
+ if($fontwidth==0) $this->mpdf->Error('Please use values unequal to zero for font width (CircularText)');
233
+ $text=str_replace("\r",'',$text);
234
+ //circumference
235
+ $u=($r*2)*M_PI;
236
+ // mPDF 5.5.23
237
+ $checking = true;
238
+ $autoset = false;
239
+ while($checking) {
240
+ $t=0;
241
+ $w = array();
242
+ if ($this->mpdf->usingCoreFont) {
243
+ $nb=strlen($text);
244
+ for($i=0; $i<$nb; $i++){
245
+ $w[$i]=$this->mpdf->GetStringWidth($text[$i]);
246
+ $w[$i]*=$kerning*$fontwidth;
247
+ $t+=$w[$i];
248
+ }
249
+ }
250
+ else {
251
+ $nb=mb_strlen($text, $this->mpdf->mb_enc );
252
+ $lastchar = '';
253
+ $unicode = $this->mpdf->UTF8StringToArray($text);
254
+ for($i=0; $i<$nb; $i++){
255
+ $c = mb_substr($text,$i,1,$this->mpdf->mb_enc );
256
+ $w[$i]=$this->mpdf->GetStringWidth($c);
257
+ $w[$i]*=$kerning*$fontwidth;
258
+ $char = $unicode[$i];
259
+ if ($this->mpdf->useKerning && $lastchar) {
260
+ if (isset($this->mpdf->CurrentFont['kerninfo'][$lastchar][$char])) {
261
+ $tk = $this->mpdf->CurrentFont['kerninfo'][$lastchar][$char] * ($this->mpdf->FontSize/ 1000) * $kerning * $fontwidth;
262
+ $w[$i] += $tk/2;
263
+ $w[$i-1] += $tk/2;
264
+ $t+=$tk;
265
+ }
266
+ }
267
+ $lastchar = $char;
268
+ $t+=$w[$i];
269
+ }
270
+ }
271
+ if ($fontsizePt>=0 || $autoset) { $checking = false; }
272
+ else {
273
+ $t+=$this->mpdf->GetStringWidth(' ');
274
+ if ($divider)
275
+ $t+=$this->mpdf->GetStringWidth(' ');
276
+ if ($fontsizePt==-2)
277
+ $fontsizePt = $this->mpdf->FontSizePt * 0.5 * $u/$t;
278
+ else
279
+ $fontsizePt = $this->mpdf->FontSizePt * $u/$t;
280
+ $this->mpdf->SetFontSize($fontsizePt);
281
+ $autoset = true;
282
+ }
283
+ }
284
+
285
+ //total width of string in degrees
286
+ $d=($t/$u)*360;
287
+
288
+ $this->mpdf->StartTransform();
289
+ // rotate matrix for the first letter to center the text
290
+ // (half of total degrees)
291
+ if($align=='top'){
292
+ $this->mpdf->transformRotate(-$d/2, $x, $y);
293
+ }
294
+ else{
295
+ $this->mpdf->transformRotate($d/2, $x, $y);
296
+ }
297
+ //run through the string
298
+ for($i=0; $i<$nb; $i++){
299
+ if($align=='top'){
300
+ //rotate matrix half of the width of current letter + half of the width of preceding letter
301
+ if($i==0){
302
+ $this->mpdf->transformRotate((($w[$i]/2)/$u)*360, $x, $y);
303
+ }
304
+ else{
305
+ $this->mpdf->transformRotate((($w[$i]/2+$w[$i-1]/2)/$u)*360, $x, $y);
306
+ }
307
+ if($fontwidth!=1){
308
+ $this->mpdf->StartTransform();
309
+ $this->mpdf->transformScale($fontwidth*100, 100, $x, $y);
310
+ }
311
+ $this->mpdf->SetXY($x-$w[$i]/2, $y-$r);
312
+ }
313
+ else{
314
+ //rotate matrix half of the width of current letter + half of the width of preceding letter
315
+ if($i==0){
316
+ $this->mpdf->transformRotate(-(($w[$i]/2)/$u)*360, $x, $y);
317
+ }
318
+ else{
319
+ $this->mpdf->transformRotate(-(($w[$i]/2+$w[$i-1]/2)/$u)*360, $x, $y);
320
+ }
321
+ if($fontwidth!=1){
322
+ $this->mpdf->StartTransform();
323
+ $this->mpdf->transformScale($fontwidth*100, 100, $x, $y);
324
+ }
325
+ $this->mpdf->SetXY($x-$w[$i]/2, $y+$r-($this->mpdf->FontSize));
326
+ }
327
+ if ($this->mpdf->usingCoreFont) { $c=$text[$i]; }
328
+ else { $c = mb_substr($text,$i,1,$this->mpdf->mb_enc ); }
329
+ $this->mpdf->Cell(($w[$i]),$this->mpdf->FontSize,$c,0,0,'C'); // mPDF 5.3.53
330
+ if($fontwidth!=1){
331
+ $this->mpdf->StopTransform();
332
+ }
333
+ }
334
+ $this->mpdf->StopTransform();
335
+
336
+ // mPDF 5.5.23
337
+ if($align=='top' && $divider!=''){
338
+ $wc=$this->mpdf->GetStringWidth($divider);
339
+ $wc*=$kerning*$fontwidth;
340
+
341
+ $this->mpdf->StartTransform();
342
+ $this->mpdf->transformRotate(90, $x, $y);
343
+ $this->mpdf->SetXY($x-$wc/2, $y-$r);
344
+ $this->mpdf->Cell(($wc),$this->mpdf->FontSize,$divider,0,0,'C');
345
+ $this->mpdf->StopTransform();
346
+
347
+ $this->mpdf->StartTransform();
348
+ $this->mpdf->transformRotate(-90, $x, $y);
349
+ $this->mpdf->SetXY($x-$wc/2, $y-$r);
350
+ $this->mpdf->Cell(($wc),$this->mpdf->FontSize,$divider,0,0,'C');
351
+ $this->mpdf->StopTransform();
352
+ }
353
+ }
354
+
355
+ function Shaded_box( $text,$font='',$fontstyle='B',$szfont='',$width='70%',$style='DF',$radius=2.5,$fill='#FFFFFF',$color='#000000',$pad=2 )
356
+ {
357
+ // F (shading - no line),S (line, no shading),DF (both)
358
+ if (!$font) { $font= $this->mpdf->default_font; }
359
+ if (!$szfont) { $szfont = ($this->mpdf->default_font_size * 1.8); }
360
+
361
+ $text = $this->mpdf->purify_utf8_text($text);
362
+ if ($this->mpdf->text_input_as_HTML) {
363
+ $text = $this->mpdf->all_entities_to_utf8($text);
364
+ }
365
+ if ($this->mpdf->usingCoreFont) { $text = mb_convert_encoding($text,$this->mpdf->mb_enc,'UTF-8'); }
366
+ // DIRECTIONALITY
367
+ $this->mpdf->magic_reverse_dir($text, true, $this->mpdf->directionality); // *RTL*
368
+ // Font-specific ligature substitution for Indic fonts
369
+ if (isset($this->mpdf->CurrentFont['indic']) && $this->mpdf->CurrentFont['indic']) $this->mpdf->ConvertIndic($text); // *INDIC*
370
+ $text = ' '.$text.' ';
371
+ if (!$width) { $width = $this->mpdf->pgwidth; } else { $width=$this->mpdf->ConvertSize($width,$this->mpdf->pgwidth); }
372
+ $midpt = $this->mpdf->lMargin+($this->mpdf->pgwidth/2);
373
+ $r1 = $midpt-($width/2); //($this->mpdf->w / 2) - 40;
374
+ $r2 = $r1 + $width; //$r1 + 80;
375
+ $y1 = $this->mpdf->y;
376
+
377
+
378
+ $mid = ($r1 + $r2 ) / 2;
379
+ $loop = 0;
380
+
381
+ while ( $loop == 0 )
382
+ {
383
+ $this->mpdf->SetFont( $font, $fontstyle, $szfont );
384
+ $sz = $this->mpdf->GetStringWidth( $text );
385
+ if ( ($r1+$sz) > $r2 )
386
+ $szfont --;
387
+ else
388
+ $loop ++;
389
+ }
390
+
391
+ $y2 = $this->mpdf->FontSize+($pad*2);
392
+
393
+ $this->mpdf->SetLineWidth(0.1);
394
+ $fc = $this->mpdf->ConvertColor($fill);
395
+ $tc = $this->mpdf->ConvertColor($color);
396
+ $this->mpdf->SetFColor($fc);
397
+ $this->mpdf->SetTColor($tc);
398
+ $this->mpdf->RoundedRect($r1, $y1, ($r2 - $r1), $y2, $radius, $style);
399
+ $this->mpdf->SetX( $r1);
400
+ $this->mpdf->Cell($r2-$r1, $y2, $text, 0, 1, "C" );
401
+ $this->mpdf->SetY($y1+$y2+2); // +2 = mm margin below shaded box
402
+ $this->mpdf->Reset();
403
+ }
404
+
405
+
406
+ }
407
+
408
+ ?>
mPDF/classes/form.php ADDED
@@ -0,0 +1,1498 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class form {
4
+
5
+ var $mpdf = null;
6
+
7
+ var $forms;
8
+ var $formn;
9
+
10
+ //Active Forms
11
+ var $formSubmitNoValueFields;
12
+ var $formExportType;
13
+ var $formSelectDefaultOption;
14
+ var $formUseZapD;
15
+ /* Form Styles */
16
+ var $form_border_color;
17
+ var $form_background_color;
18
+ var $form_border_width;
19
+ var $form_border_style;
20
+ var $form_button_border_color;
21
+ var $form_button_background_color;
22
+ var $form_button_border_width;
23
+ var $form_button_border_style;
24
+ var $form_radio_color;
25
+ var $form_radio_background_color;
26
+
27
+ var $form_element_spacing;
28
+
29
+ // Active forms
30
+ var $formMethod;
31
+ var $formAction;
32
+ var $form_fonts;
33
+ var $form_radio_groups;
34
+ var $form_checkboxes;
35
+ var $pdf_acro_array;
36
+
37
+ var $pdf_array_co;
38
+ var $array_form_button_js;
39
+ var $array_form_choice_js;
40
+ var $array_form_text_js;
41
+
42
+ /* Button Text */
43
+ var $form_button_text;
44
+ var $form_button_text_over;
45
+ var $form_button_text_click;
46
+ var $form_button_icon;
47
+
48
+
49
+ // FORMS
50
+ var $textarea_lineheight;
51
+
52
+ function form(&$mpdf) {
53
+ $this->mpdf = $mpdf;
54
+
55
+ // ACTIVE FORMS
56
+ $this->formExportType = 'xfdf'; // 'xfdf' or 'html'
57
+ $this->formSubmitNoValueFields = true; // Whether to include blank fields when submitting data
58
+ $this->formSelectDefaultOption = true; // for Select drop down box; if no option is explicitly maked as selected,
59
+ // this determines whether to select 1st option (as per browser)
60
+ // - affects whether "required" attribute is relevant
61
+ $this->formUseZapD = true; // Determine whether to use ZapfDingbat icons for radio/checkboxes
62
+
63
+ // FORM STYLES
64
+ // These can alternatively use a 4 number string to represent CMYK colours
65
+ $this->form_border_color = '0.6 0.6 0.72'; // RGB
66
+ $this->form_background_color = '0.975 0.975 0.975'; // RGB
67
+ $this->form_border_width = '1'; // 0 doesn't seem to work as it should
68
+ $this->form_border_style = 'S'; // B - Bevelled; D - Double
69
+ $this->form_button_border_color = '0.2 0.2 0.55';
70
+ $this->form_button_background_color = '0.941 0.941 0.941';
71
+ $this->form_button_border_width = '1';
72
+ $this->form_button_border_style = 'S';
73
+ $this->form_radio_color = '0.0 0.0 0.4'; // radio and checkbox
74
+ $this->form_radio_background_color = '0.9 0.9 0.9';
75
+
76
+ // FORMS
77
+ $this->textarea_lineheight = 1.25;
78
+
79
+ // FORM ELEMENT SPACING
80
+ $this->form_element_spacing['select']['outer']['h'] = 0.5; // Horizontal spacing around SELECT
81
+ $this->form_element_spacing['select']['outer']['v'] = 0.5; // Vertical spacing around SELECT
82
+ $this->form_element_spacing['select']['inner']['h'] = 0.7; // Horizontal padding around SELECT
83
+ $this->form_element_spacing['select']['inner']['v'] = 0.7; // Vertical padding around SELECT
84
+ $this->form_element_spacing['input']['outer']['h'] = 0.5;
85
+ $this->form_element_spacing['input']['outer']['v'] = 0.5;
86
+ $this->form_element_spacing['input']['inner']['h'] = 0.7;
87
+ $this->form_element_spacing['input']['inner']['v'] = 0.7;
88
+ $this->form_element_spacing['textarea']['outer']['h'] = 0.5;
89
+ $this->form_element_spacing['textarea']['outer']['v'] = 0.5;
90
+ $this->form_element_spacing['textarea']['inner']['h'] = 1;
91
+ $this->form_element_spacing['textarea']['inner']['v'] = 0.5;
92
+ $this->form_element_spacing['button']['outer']['h'] = 0.5;
93
+ $this->form_element_spacing['button']['outer']['v'] = 0.5;
94
+ $this->form_element_spacing['button']['inner']['h'] = 2;
95
+ $this->form_element_spacing['button']['inner']['v'] = 1;
96
+
97
+ // INITIALISE non-configurable
98
+ $this->formMethod = 'POST';
99
+ $this->formAction = '';
100
+ $this->form_fonts = array();
101
+ $this->form_radio_groups = array();
102
+ $this->form_checkboxes = false;
103
+ $this->forms = array();
104
+ $this->pdf_array_co = '';
105
+
106
+
107
+ }
108
+
109
+
110
+ function print_ob_text($objattr,$w,$h,$texto,$rtlalign,$k,$blockdir) {
111
+ // TEXT/PASSWORD INPUT
112
+ if ($this->mpdf->useActiveForms) {
113
+ // Flags: 1 - Readonly; 2 - Required; 3 - No export; 13 - textarea; 14 - Password
114
+ $flags = array();
115
+ if ($objattr['disabled'] || $objattr['readonly']) { $flags[] = 1; } // readonly
116
+ if ($objattr['disabled']) { $flags[] = 3; } // no export
117
+ if ($objattr['disabled']) { $objattr['color'] = array(3,128,128,128); } // gray out disabled
118
+ if ($objattr['required']) { $flags[] = 2; } // required
119
+ if (!$objattr['spellcheck']) { $flags[] = 23; } // DoNotSpellCheck
120
+ if ($objattr['subtype']=='PASSWORD') { $flags[] = 14; }
121
+ $this->mpdf->SetTColor($objattr['color']);
122
+ $fieldalign = $rtlalign;
123
+ if ($objattr['text_align']) { $fieldalign = $objattr['text_align']; }
124
+ if ($objattr['subtype']=='PASSWORD') { $val = $objattr['value']; }
125
+ else { $val = $objattr['text']; }
126
+ // mPDF 5.3.25
127
+ $js = array();
128
+ if ($objattr['onCalculate']) { $js[] = array('C', $objattr['onCalculate']); }
129
+ if ($objattr['onValidate']) { $js[] = array('V', $objattr['onValidate']); }
130
+ if ($objattr['onFormat']) { $js[] = array('F', $objattr['onFormat']); }
131
+ if ($objattr['onKeystroke']) { $js[] = array('K', $objattr['onKeystroke']); }
132
+ $this->SetFormText( $w, $h, $objattr['fieldname'], $val, $val, $objattr['title'], $flags, $fieldalign, false, $objattr['maxlength'], $js, $objattr['background-col'], $objattr['border-col'] );
133
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
134
+ }
135
+ else {
136
+ $w -= $this->form_element_spacing['input']['outer']['h']*2 /$k;
137
+ $h -= $this->form_element_spacing['input']['outer']['v']*2 /$k;
138
+ $this->mpdf->x += $this->form_element_spacing['input']['outer']['h'] /$k;
139
+ $this->mpdf->y += $this->form_element_spacing['input']['outer']['v'] /$k;
140
+ // Chop texto to max length $w-inner-padding
141
+ while ($this->mpdf->GetStringWidth($texto) > $w-($this->form_element_spacing['input']['inner']['h']*2)) {
142
+ $texto = mb_substr($texto,0,mb_strlen($texto,$this->mpdf->mb_enc)-1,$this->mpdf->mb_enc);
143
+ }
144
+ $save_linemaxfontsize = $this->mpdf->linemaxfontsize;
145
+ $this->mpdf->linemaxfontsize = $this->mpdf->FontSize;
146
+ $this->mpdf->SetLineWidth(0.2 /$k );
147
+ $this->mpdf->magic_reverse_dir($texto, false, $blockdir); // *RTL*
148
+ if (isset($objattr['disabled']) && $objattr['disabled']) {
149
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(225));
150
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(127));
151
+ }
152
+ else if (isset($objattr['readonly']) && $objattr['readonly']) {
153
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(225));
154
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
155
+ }
156
+ else {
157
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(250));
158
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
159
+ }
160
+ $this->mpdf->Cell($w,$h,$texto,1,0,$rtlalign,1,'',0,$this->form_element_spacing['input']['inner']['h'] /$k ,$this->form_element_spacing['input']['inner']['h'] /$k , 'M');
161
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(255));
162
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
163
+ $this->mpdf->linemaxfontsize = $save_linemaxfontsize;
164
+ }
165
+ }
166
+
167
+ function print_ob_textarea($objattr,$w,$h,$texto,$rtlalign,$k,$blockdir) {
168
+ // TEXTAREA
169
+ if ($this->mpdf->useActiveForms) {
170
+ // Flags: 1 - Readonly; 2 - Required; 3 - No export; 13 - textarea; 14 - Password
171
+ $flags = array();
172
+ $flags = array(13); // textarea
173
+ if ($objattr['disabled'] || $objattr['readonly']) { $flags[] = 1; } // readonly
174
+ if ($objattr['disabled']) { $flags[] = 3; } // no export
175
+ if ($objattr['disabled']) { $objattr['color'] = array(3,128,128,128); } // gray out disabled
176
+ if ($objattr['required']) { $flags[] = 2; } // required
177
+ if (!$objattr['spellcheck']) { $flags[] = 23; } // DoNotSpellCheck
178
+ if ($objattr['donotscroll']) { $flags[] = 24; } // DoNotScroll
179
+ $this->mpdf->SetTColor($objattr['color']);
180
+ $fieldalign = $rtlalign;
181
+ if ($texto == ' ') { $texto = ''; } // mPDF 5.3.24
182
+ if ($objattr['text_align']) { $fieldalign = $objattr['text_align']; }
183
+ // mPDF 5.3.25
184
+ $js = array();
185
+ if ($objattr['onCalculate']) { $js[] = array('C', $objattr['onCalculate']); }
186
+ if ($objattr['onValidate']) { $js[] = array('V', $objattr['onValidate']); }
187
+ if ($objattr['onFormat']) { $js[] = array('F', $objattr['onFormat']); }
188
+ if ($objattr['onKeystroke']) { $js[] = array('K', $objattr['onKeystroke']); }
189
+ $this->SetFormText( $w, $h, $objattr['fieldname'], $texto, $texto, $objattr['title'], $flags, $fieldalign , false, -1, $js, $objattr['background-col'], $objattr['border-col'] );
190
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
191
+ }
192
+ else {
193
+ $w -= $this->form_element_spacing['textarea']['outer']['h']*2 /$k ;
194
+ $h -= $this->form_element_spacing['textarea']['outer']['v']*2 /$k ;
195
+ $this->mpdf->x += $this->form_element_spacing['textarea']['outer']['h'] /$k ;
196
+ $this->mpdf->y += $this->form_element_spacing['textarea']['outer']['v'] /$k ;
197
+ $this->mpdf->SetLineWidth(0.2 /$k );
198
+ if (isset($objattr['disabled']) && $objattr['disabled']) {
199
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(225));
200
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(127));
201
+ }
202
+ else if (isset($objattr['readonly']) && $objattr['readonly']) {
203
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(225));
204
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
205
+ }
206
+ else {
207
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(250));
208
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
209
+ }
210
+ $this->mpdf->Rect($this->mpdf->x,$this->mpdf->y,$w,$h,'DF');
211
+ $w -= $this->form_element_spacing['textarea']['inner']['h']*2 /$k ;
212
+ $this->mpdf->x += $this->form_element_spacing['textarea']['inner']['h'] /$k ;
213
+ $this->mpdf->y += $this->form_element_spacing['textarea']['inner']['v'] /$k ;
214
+ $linesneeded = $this->mpdf->WordWrap($texto,$w);
215
+ if ($linesneeded > $objattr['rows']) { //Too many words inside textarea
216
+ $textoaux = explode("\n",$texto);
217
+ $texto = '';
218
+ for($i=0;$i<$objattr['rows'];$i++) {
219
+ if ($i == ($objattr['rows']-1)) $texto .= $textoaux[$i];
220
+ else $texto .= $textoaux[$i] . "\n";
221
+ }
222
+ $texto = mb_substr($texto,0,mb_strlen($texto,$this->mpdf->mb_enc)-4,$this->mpdf->mb_enc) . "...";
223
+ }
224
+ if ($texto != '') $this->mpdf->MultiCell($w,$this->mpdf->FontSize*$this->textarea_lineheight,$texto,0,'',0,'',$blockdir,true);
225
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(255));
226
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
227
+ }
228
+ }
229
+
230
+ function print_ob_select($objattr,$w,$h,$texto,$rtlalign,$k,$blockdir) {
231
+ // SELECT
232
+ if ($this->mpdf->useActiveForms) {
233
+ // Flags: 1 - Readonly; 2 - Required; 3 - No export; 19 - edit (only if combo)
234
+ $flags = array();
235
+ if ($objattr['disabled']) { $flags[] = 1; } // readonly
236
+ if ($objattr['disabled']) { $flags[] = 3; } // no export
237
+ if ($objattr['disabled']) { $objattr['color'] = array(3,128,128,128); } // gray out disabled
238
+ if ($objattr['required']) { $flags[] = 2; } // required
239
+ if ($objattr['multiple'] && $objattr['size']>1) { $flags[] = 22; } //flag 22 = multiselect (listbox)
240
+ if ($objattr['size']<2) {
241
+ $flags[] = 18; //flag 18 = combobox (else a listbox)
242
+ if ($objattr['editable']) { $flags[] = 19; } // editable
243
+ }
244
+ // only spellcheck if combo and editable
245
+ if (!$objattr['spellcheck'] || $objattr['size']>1 || !$objattr['editable']) { $flags[] = 23; } // DoNotSpellCheck
246
+ if ($objattr['subtype']=='PASSWORD') { $flags[] = 14; }
247
+ if ($objattr['onChange']) { $js = $objattr['onChange']; }
248
+ else { $js = ''; } // mPDF 5.3.37
249
+ $data = array('VAL' => array(), 'OPT' => array(), 'SEL' => array(), );
250
+ for($i=0; $i<count($objattr['items']); $i++) {
251
+ $item = $objattr['items'][$i];
252
+ $data['VAL'][] = $item['exportValue'];
253
+ $data['OPT'][] = $item['content'];
254
+ if ($item['selected']) { $data['SEL'][] = $i; }
255
+ }
256
+ if (count($data['SEL'])==0 && $this->formSelectDefaultOption) {$data['SEL'][] = 0; }
257
+ $this->mpdf->SetTColor($objattr['color']);
258
+ $this->SetFormChoice( $w, $h, $objattr['fieldname'], $flags, $data, $rtlalign, $js );
259
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
260
+ }
261
+ else {
262
+ $save_linemaxfontsize = $this->mpdf->linemaxfontsize;
263
+ $this->mpdf->linemaxfontsize = $this->mpdf->FontSize;
264
+ $this->mpdf->magic_reverse_dir($texto, false, $blockdir); // *RTL*
265
+ $this->mpdf->SetLineWidth(0.2 /$k );
266
+ if (isset($objattr['disabled']) && $objattr['disabled']) {
267
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(225));
268
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(127));
269
+ }
270
+ else {
271
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(250));
272
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
273
+ }
274
+ $w -= $this->form_element_spacing['select']['outer']['h']*2 /$k ;
275
+ $h -= $this->form_element_spacing['select']['outer']['v']*2 /$k ;
276
+ $this->mpdf->x += $this->form_element_spacing['select']['outer']['h'] /$k ;
277
+ $this->mpdf->y += $this->form_element_spacing['select']['outer']['v'] /$k ;
278
+ $this->mpdf->Cell($w-($this->mpdf->FontSize*1.4),$h,$texto,1,0,$rtlalign,1,'',0,$this->form_element_spacing['select']['inner']['h'] /$k,$this->form_element_spacing['select']['inner']['h'] /$k , 'M') ;
279
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(190));
280
+ $save_font = $this->mpdf->FontFamily;
281
+ $save_currentfont = $this->mpdf->currentfontfamily;
282
+ if ($this->mpdf->PDFA || $this->mpdf->PDFX) {
283
+ if (($this->mpdf->PDFA && !$this->mpdf->PDFAauto) || ($this->mpdf->PDFX && !$this->mpdf->PDFXauto)) { $this->mpdf->PDFAXwarnings[] = "Core Adobe font Zapfdingbats cannot be embedded in mPDF - used in Form element: Select - which is required for PDFA1-b or PDFX/1-a. (Different character/font will be substituted.)"; }
284
+ $this->mpdf->SetFont('sans');
285
+ if ($this->mpdf->_charDefined($this->mpdf->CurrentFont['cw'], 9660)) { $down = "\xe2\x96\xbc"; }
286
+ else { $down = '='; }
287
+ $this->mpdf->Cell(($this->mpdf->FontSize*1.4),$h,$down,1,0,'C',1,'',0,0,0, 'M') ;
288
+ }
289
+ else {
290
+ $this->mpdf->SetFont('czapfdingbats','',0);
291
+ $this->mpdf->Cell(($this->mpdf->FontSize*1.4),$h,chr(116),1,0,'C',1,'',0,0,0, 'M') ;
292
+ }
293
+ $this->mpdf->SetFont($save_font,'',0);
294
+ $this->mpdf->currentfontfamily = $save_currentfont;
295
+ $this->mpdf->linemaxfontsize = $save_linemaxfontsize;
296
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(255));
297
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
298
+ }
299
+ }
300
+
301
+ function print_ob_imageinput($objattr,$w,$h,$texto,$rtlalign,$k,$blockdir) {
302
+ // INPUT/BUTTON as IMAGE
303
+ if ($this->mpdf->useActiveForms) {
304
+ // Flags: 1 - Readonly; 3 - No export;
305
+ $flags = array();
306
+ if ($objattr['disabled']) { $flags[] = 1; } // readonly
307
+ if ($objattr['disabled']) { $flags[] = 3; } // no export
308
+ if ($objattr['onClick']) { $js = $objattr['onClick']; }
309
+ else { $js = ''; }
310
+ $this->SetJSButton( $w, $h, $objattr['fieldname'], $objattr['value'], $js, $objattr['ID'], $objattr['title'], $flags, $objattr['Indexed']);
311
+ }
312
+ else {
313
+ $this->mpdf->y = $objattr['INNER-Y'];
314
+ $this->mpdf->_out( sprintf("q %.3F 0 0 %.3F %.3F %.3F cm /I%d Do Q",$objattr['INNER-WIDTH'] *_MPDFK,$objattr['INNER-HEIGHT'] *_MPDFK,$objattr['INNER-X'] *_MPDFK,($this->mpdf->h-($objattr['INNER-Y'] +$objattr['INNER-HEIGHT'] ))*_MPDFK,$objattr['ID'] ) );
315
+ if (isset($objattr['BORDER-WIDTH']) && $objattr['BORDER-WIDTH']) { $this->mpdf->PaintImgBorder($objattr,$is_table); }
316
+ }
317
+ }
318
+
319
+ function print_ob_button($objattr,$w,$h,$texto,$rtlalign,$k,$blockdir) {
320
+ // BUTTON
321
+ if ($this->mpdf->useActiveForms) {
322
+ // Flags: 1 - Readonly; 3 - No export;
323
+ $flags = array();
324
+ if ($objattr['disabled']) { $flags[] = 1; } // readonly
325
+ if ($objattr['disabled']) { $flags[] = 3; } // no export
326
+ if ($objattr['disabled']) { $objattr['color'] = array(3,128,128,128); }
327
+ $this->mpdf->SetTColor($objattr['color']);
328
+ if ($objattr['subtype'] == 'RESET') {
329
+ $this->SetFormButtonText( $objattr['value'] );
330
+ $this->SetFormReset( $w, $h, $objattr['fieldname'], $objattr['value'], $objattr['title'], $flags, $objattr['background-col'], $objattr['border-col'], $objattr['noprint'] );
331
+ }
332
+ else if ($objattr['subtype'] == 'SUBMIT') {
333
+ $url = $this->formAction;
334
+ $type = $this->formExportType;
335
+ $method = $this->formMethod;
336
+ $this->SetFormButtonText( $objattr['value'] );
337
+ $this->SetFormSubmit( $w, $h, $objattr['fieldname'], $objattr['value'], $url, $objattr['title'], $type, $method, $flags, $objattr['background-col'], $objattr['border-col'], $objattr['noprint'] );
338
+ }
339
+ else if ($objattr['subtype'] == 'BUTTON') {
340
+ $this->SetFormButtonText( $objattr['value'] );
341
+ if ($objattr['onClick']) { $js = $objattr['onClick']; }
342
+ else { $js = ''; }
343
+ $this->SetJSButton( $w, $h, $objattr['fieldname'], $objattr['value'], $js, 0, $objattr['title'], $flags, false, $objattr['background-col'], $objattr['border-col'], $objattr['noprint'] );
344
+ }
345
+ $this->mpdf->SetTColor($this->mpdf->ConvertColor(0));
346
+ }
347
+ else {
348
+ $this->mpdf->SetLineWidth(0.2 /$k );
349
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(190));
350
+ $w -= $this->form_element_spacing['button']['outer']['h']*2 /$k ;
351
+ $h -= $this->form_element_spacing['button']['outer']['v']*2 /$k ;
352
+ $this->mpdf->x += $this->form_element_spacing['button']['outer']['h'] /$k ;
353
+ $this->mpdf->y += $this->form_element_spacing['button']['outer']['v'] /$k ;
354
+ $this->mpdf->RoundedRect($this->mpdf->x, $this->mpdf->y, $w, $h, 0.5 /$k , 'DF');
355
+ $w -= $this->form_element_spacing['button']['inner']['h']*2 /$k ;
356
+ $h -= $this->form_element_spacing['button']['inner']['v']*2 /$k ;
357
+ $this->mpdf->x += $this->form_element_spacing['button']['inner']['h'] /$k ;
358
+ $this->mpdf->y += $this->form_element_spacing['button']['inner']['v'] /$k ;
359
+ $save_linemaxfontsize = $this->mpdf->linemaxfontsize;
360
+ $this->mpdf->linemaxfontsize = $this->mpdf->FontSize;
361
+ $this->mpdf->magic_reverse_dir($texto, false, $blockdir); // *RTL*
362
+ $this->mpdf->Cell($w,$h,$texto,'',0,'C',0,'',0,0,0, 'M') ;
363
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(0));
364
+ $this->mpdf->linemaxfontsize = $save_linemaxfontsize;
365
+ }
366
+ }
367
+
368
+ function print_ob_checkbox($objattr,$w,$h,$texto,$rtlalign,$k,$blockdir,$x,$y) {
369
+ // CHECKBOX
370
+ if ($this->mpdf->useActiveForms) {
371
+ // Flags: 1 - Readonly; 2 - Required; 3 - No export;
372
+ $flags = array();
373
+ if ($objattr['disabled']) { $flags[] = 1; } // readonly
374
+ if ($objattr['disabled']) { $flags[] = 3; } // no export
375
+ $checked = false;
376
+ if ($objattr['checked']) { $checked = true; }
377
+ if ($this->formUseZapD) {
378
+ $save_font = $this->mpdf->FontFamily;
379
+ $save_currentfont = $this->mpdf->currentfontfamily;
380
+ $this->mpdf->SetFont('czapfdingbats','',0);
381
+ }
382
+ $this->SetCheckBox( $w, $h, $objattr['fieldname'], $objattr['value'], $objattr['title'], $checked, $flags, $objattr['disabled'] );
383
+ if ($this->formUseZapD) {
384
+ $this->mpdf->SetFont($save_font,'',0);
385
+ $this->mpdf->currentfontfamily = $save_currentfont;
386
+ }
387
+ }
388
+ else {
389
+ $iw = $w * 0.7;
390
+ $ih = $h * 0.7;
391
+ $lx = $x + (($w-$iw)/2);
392
+ $ty = $y + (($h-$ih)/2);
393
+ $rx = $lx + $iw;
394
+ $by = $ty + $ih;
395
+ $this->mpdf->SetLineWidth(0.2 /$k );
396
+ if (isset($objattr['disabled']) && $objattr['disabled']) {
397
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(225));
398
+ $this->mpdf->SetDColor($this->mpdf->ConvertColor(127));
399
+ }
400
+ else {
401
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(250));
402
+ $this->mpdf->SetDColor($this->mpdf->ConvertColor(0));
403
+ }
404
+ $this->mpdf->Rect($lx,$ty,$iw,$ih,'DF');
405
+ if (isset($objattr['checked']) && $objattr['checked']) {
406
+ //Round join and cap
407
+ $this->mpdf->SetLineCap(1);
408
+ $this->mpdf->Line($lx,$ty,$rx,$by);
409
+ $this->mpdf->Line($lx,$by,$rx,$ty);
410
+ //Set line cap style back to square
411
+ $this->mpdf->SetLineCap(2);
412
+ }
413
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(255));
414
+ $this->mpdf->SetDColor($this->mpdf->ConvertColor(0));
415
+ }
416
+ }
417
+
418
+ function print_ob_radio($objattr,$w,$h,$texto,$rtlalign,$k,$blockdir,$x,$y) {
419
+ // RADIO
420
+ if ($this->mpdf->useActiveForms) {
421
+ // Flags: 1 - Readonly; 2 - Required; 3 - No export;
422
+ $flags = array();
423
+ if ($objattr['disabled']) { $flags[] = 1; } // readonly
424
+ if ($objattr['disabled']) { $flags[] = 3; } // no export
425
+ $checked = false;
426
+ if ($objattr['checked']) { $checked = true; }
427
+ if ($this->formUseZapD) {
428
+ $save_font = $this->mpdf->FontFamily;
429
+ $save_currentfont = $this->mpdf->currentfontfamily;
430
+ $this->mpdf->SetFont('czapfdingbats','',0);
431
+ }
432
+ $this->SetRadio( $w, $h, $objattr['fieldname'], $objattr['value'], $objattr['title'], $checked, $flags, $objattr['disabled'] );
433
+ if ($this->formUseZapD) {
434
+ $this->mpdf->SetFont($save_font,'',0);
435
+ $this->mpdf->currentfontfamily = $save_currentfont;
436
+ }
437
+ }
438
+ else {
439
+ $this->mpdf->SetLineWidth(0.2 /$k );
440
+ $radius = $this->mpdf->FontSize *0.35;
441
+ $cx = $x + ($w/2);
442
+ $cy = $y + ($h/2);
443
+ if (isset($objattr['disabled']) && $objattr['disabled']) {
444
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(127));
445
+ $this->mpdf->SetDColor($this->mpdf->ConvertColor(127));
446
+ }
447
+ else {
448
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(0));
449
+ $this->mpdf->SetDColor($this->mpdf->ConvertColor(0));
450
+ }
451
+ $this->mpdf->Circle($cx,$cy,$radius,'D');
452
+ if (isset($objattr['checked']) && $objattr['checked']) {
453
+ $this->mpdf->Circle($cx,$cy,$radius*0.4,'DF');
454
+ }
455
+ $this->mpdf->SetFColor($this->mpdf->ConvertColor(255));
456
+ $this->mpdf->SetDColor($this->mpdf->ConvertColor(0));
457
+
458
+ }
459
+ }
460
+
461
+
462
+ // In _putpages
463
+ function countPageForms($n, &$totaladdnum) {
464
+ foreach( $this->forms as $form ) {
465
+ if ( $form['page'] == $n ) {
466
+ $totaladdnum++;
467
+ if ( $form['typ'] == 'Tx' ) {
468
+ if ( isset($this->array_form_text_js[$form['T']]) ) {
469
+ if ( isset($this->array_form_text_js[$form['T']]['F']) ) { $totaladdnum++; }
470
+ if ( isset($this->array_form_text_js[$form['T']]['K']) ) { $totaladdnum++; }
471
+ if ( isset($this->array_form_text_js[$form['T']]['V']) ) { $totaladdnum++; }
472
+ if ( isset($this->array_form_text_js[$form['T']]['C']) ) { $totaladdnum++; }
473
+ }
474
+ }
475
+ if ( $form['typ'] == 'Bt' ) {
476
+ if ( isset($this->array_form_button_js[$form['T']]) ) { $totaladdnum++; }
477
+ if ( isset($this->form_button_icon[$form['T']]) ) {
478
+ $totaladdnum++;
479
+ if ( $this->form_button_icon[$form['T']]['Indexed'] ) { $totaladdnum++; }
480
+ }
481
+ if ( $form['subtype'] == 'radio' ) { $totaladdnum+=2; }
482
+ else if ( $form['subtype'] == 'checkbox' && $this->formUseZapD ) { $totaladdnum++; }
483
+ else if ( $form['subtype'] == 'checkbox' && !$this->formUseZapD ) { $totaladdnum+=2; }
484
+ }
485
+ if ( $form['typ'] == 'Ch' ) {
486
+ if ( isset($this->array_form_choice_js[$form['T']]) ) { $totaladdnum++; }
487
+ }
488
+ }
489
+ }
490
+ }
491
+
492
+ // In _putpages
493
+ function addFormIds($n, &$s, &$annotid) {
494
+ foreach( $this->forms as $form ) {
495
+ if ( $form['page'] == $n ) {
496
+ $s .= ($annotid) . ' 0 R ';
497
+ $annotid++;
498
+ if ( $form['typ'] == 'Tx' ) {
499
+ if ( isset($this->array_form_text_js[$form['T']]) ) {
500
+ if ( isset($this->array_form_text_js[$form['T']]['F']) ) { $annotid++; }
501
+ if ( isset($this->array_form_text_js[$form['T']]['K']) ) { $annotid++; }
502
+ if ( isset($this->array_form_text_js[$form['T']]['V']) ) { $annotid++; }
503
+ if ( isset($this->array_form_text_js[$form['T']]['C']) ) { $annotid++; }
504
+ }
505
+ }
506
+ if ( $form['typ'] == 'Bt' ) {
507
+ if ( isset($this->array_form_button_js[$form['T']]) ) { $annotid++; }
508
+ if ( isset($this->form_button_icon[$form['T']]) ) {
509
+ $annotid++;
510
+ if ( $this->form_button_icon[$form['T']]['Indexed'] ) { $annotid++; }
511
+ }
512
+ if ( $form['subtype'] == 'radio' ) { $annotid+=2; }
513
+ else if ( $form['subtype'] == 'checkbox' && $this->formUseZapD ) { $annotid++; }
514
+ else if ( $form['subtype'] == 'checkbox' && !$this->formUseZapD ) { $annotid+=2; }
515
+ }
516
+ if ( $form['typ'] == 'Ch' ) {
517
+ if ( isset($this->array_form_choice_js[$form['T']]) ) { $annotid++; }
518
+ }
519
+ }
520
+ }
521
+ }
522
+
523
+ // In _putannots
524
+ function _putFormItems($n, $hPt) {
525
+ foreach( $this->forms as $val) {
526
+ if ( $val['page'] == $n ) {
527
+ if ( $val['typ'] == 'Tx' ) $this->_putform_tx( $val, $hPt );
528
+ if ( $val['typ'] == 'Ch' ) $this->_putform_ch( $val, $hPt );
529
+ if ( $val['typ'] == 'Bt' ) $this->_putform_bt( $val, $hPt );
530
+ }
531
+ }
532
+ }
533
+
534
+ // In _putannots
535
+ function _putRadioItems($n) {
536
+ // Output Radio Groups
537
+ $key = 1;
538
+ foreach($this->form_radio_groups AS $name=>$frg) {
539
+ $this->mpdf->_newobj();
540
+ $this->pdf_acro_array .= $this->mpdf->n.' 0 R ';
541
+ $this->mpdf->_out('<<');
542
+ $this->mpdf->_out('/Type /Annot ');
543
+ $this->mpdf->_out('/Subtype /Widget');
544
+ $this->mpdf->_out('/NM '.$this->mpdf->_textstring(sprintf('%04u-%04u', $n, (3000 + $key++))));
545
+ $this->mpdf->_out('/M '.$this->mpdf->_textstring('D:'.date('YmdHis')));
546
+ $this->mpdf->_out('/Rect [0 0 0 0] ');
547
+ $this->mpdf->_out('/FT /Btn ');
548
+ if ($frg['disabled']) { $flags=array(1,3,15,16); } // NoExport and readonly
549
+ else { $flags=array(15,16); } // Flags for Radiobutton, and NoToggleToOff
550
+ $this->mpdf->_out('/Ff '.$this->_setflag($flags) );
551
+ $kstr = '';
552
+ $optstr = '';
553
+ foreach($frg['kids'] AS $kid) {
554
+ $kstr .= $this->forms[$kid['n']]['obj'].' 0 R ';
555
+ // $optstr .= ' '.$this->mpdf->_textstring($kid['OPT']).' ';
556
+ }
557
+ $this->mpdf->_out('/Kids [ '.$kstr.' ] '); // 11 0 R 12 0 R etc.
558
+ // $this->mpdf->_out('/Opt [ '.$optstr.' ] ');
559
+
560
+ //V entry holds index corresponding to the appearance state of
561
+ //whichever child field is currently in the on state = or Off
562
+ if (isset($frg['on'])) { $state = $frg['on']; }
563
+ else { $state = 'Off'; }
564
+ $this->mpdf->_out('/V /'.$state.' ');
565
+ $this->mpdf->_out('/DV /'.$state.' ');
566
+ $this->mpdf->_out('/T '.$this->mpdf->_textstring($name).' ');
567
+ $this->mpdf->_out('>>');
568
+ $this->mpdf->_out('endobj');
569
+ }
570
+ }
571
+
572
+ function _putFormsCatalog() {
573
+ if (isset($this->pdf_acro_array) ) {
574
+ $this->mpdf->_out('/AcroForm << /DA (/F1 0 Tf 0 g )');
575
+ $this->mpdf->_out('/Q 0');
576
+ $this->mpdf->_out('/Fields ['.$this->pdf_acro_array.']');
577
+ $f = '';
578
+ foreach($this->form_fonts AS $fn) {
579
+ if (is_array($this->mpdf->fonts[$fn]['n'])) { $this->mpdf->Error("Cannot use fonts with SMP or SIP characters for interactive Form elements"); }
580
+ $f .= '/F'.$this->mpdf->fonts[$fn]['i'].' '.$this->mpdf->fonts[$fn]['n'].' 0 R ';
581
+ }
582
+ $this->mpdf->_out('/DR << /Font << '.$f.' >> >>');
583
+ // CO Calculation Order
584
+ if ( $this->pdf_array_co ) {
585
+ $this->mpdf->_out('/CO ['.$this->pdf_array_co.']');
586
+ }
587
+ $this->mpdf->_out('/NeedAppearances true');
588
+ $this->mpdf->_out('>>');
589
+ }
590
+ }
591
+
592
+
593
+
594
+ function SetFormButtonJS( $name, $js ) {
595
+ $js = str_replace("\t",' ', trim($js) );
596
+ if ( isset($name) && isset($js) ) {
597
+ $this->array_form_button_js[$this->mpdf->_escape($name)] = array(
598
+ 'js' => $js
599
+ );
600
+ }
601
+ }
602
+
603
+ function SetFormChoiceJS( $name, $js ) {
604
+ $js = str_replace("\t",' ', trim($js) );
605
+ if ( isset($name) && isset($js) ) {
606
+ $this->array_form_choice_js[$this->mpdf->_escape($name)] = array(
607
+ 'js' => $js
608
+ );
609
+ }
610
+ }
611
+
612
+ function SetFormTextJS( $name, $js) {
613
+ for ($i=0; $i<count($js); $i++) {
614
+ $j = str_replace("\t",' ', trim($js[$i][1]) );
615
+ $format = $js[$i][0];
616
+ if ($name) {
617
+ $this->array_form_text_js[$this->mpdf->_escape($name)][$format] = array('js' => $j);
618
+ }
619
+ }
620
+ }
621
+
622
+
623
+ function Win1252ToPDFDocEncoding($txt) {
624
+ $Win1252ToPDFDocEncoding = array(
625
+ chr(0200) => chr(0240), chr(0214) => chr(0226), chr(0212) => chr(0227), chr(0237) => chr(0230),
626
+ chr(0225) => chr(0200), chr(0210) => chr(0032), chr(0206) => chr(0201), chr(0207) => chr(0202),
627
+ chr(0205) => chr(0203), chr(0227) => chr(0204), chr(0226) => chr(0205), chr(0203) => chr(0206),
628
+ chr(0213) => chr(0210), chr(0233) => chr(0211), chr(0211) => chr(0213), chr(0204) => chr(0214),
629
+ chr(0223) => chr(0215), chr(0224) => chr(0216), chr(0221) => chr(0217), chr(0222) => chr(0220),
630
+ chr(0202) => chr(0221), chr(0232) => chr(0235), chr(0230) => chr(0037), chr(0231) => chr(0222),
631
+ chr(0216) => chr(0231), chr(0240) => chr(0040)
632
+ ); // mPDF 5.3.46
633
+ return strtr($txt, $Win1252ToPDFDocEncoding );
634
+ }
635
+
636
+
637
+ function SetFormText( $w, $h, $name, $value = '', $default = '', $title = '', $flags = array(), $align='L', $hidden = false, $maxlen=-1, $js='', $background_col=false, $border_col=false ) {
638
+ // Flags: 1 - Readonly; 2 - Required; 3 - No export; 13 - textarea; 14 - Password
639
+ $this->formn++;
640
+ if( $align == 'C' ) { $align = '1'; }
641
+ else if( $align == 'R' ) { $align = '2'; }
642
+ else { $align = '0'; }
643
+ if ($maxlen < 1) { $maxlen = false; }
644
+ if (!preg_match('/^[a-zA-Z0-9_:\-]+$/', $name)) {
645
+ $this->mpdf->Error("Field [".$name."] must have a name attribute, which can only contain letters, numbers, colon(:), undersore(_) or hyphen(-)");
646
+ }
647
+ if ($this->mpdf->onlyCoreFonts) {
648
+ $value = $this->Win1252ToPDFDocEncoding($value);
649
+ $default = $this->Win1252ToPDFDocEncoding($default);
650
+ $title = $this->Win1252ToPDFDocEncoding($title);
651
+ }
652
+ else {
653
+ if (isset($this->mpdf->CurrentFont['subset'])) {
654
+ $this->mpdf->UTF8StringToArray($value, true); // Add characters to font subset
655
+ $this->mpdf->UTF8StringToArray($default, true); // Add characters to font subset
656
+ $this->mpdf->UTF8StringToArray($title, true); // Add characters to font subset
657
+ }
658
+ if ($value) $value = $this->mpdf->UTF8ToUTF16BE($value, true);
659
+ if ($default ) $default = $this->mpdf->UTF8ToUTF16BE($default, true);
660
+ $title = $this->mpdf->UTF8ToUTF16BE($title, true);
661
+ }
662
+ if ($background_col) { $bg_c = $this->mpdf->SetColor($background_col, 'CodeOnly'); }
663
+ else { $bg_c = $this->form_background_color; }
664
+ if ($border_col) { $bc_c = $this->mpdf->SetColor($border_col, 'CodeOnly'); }
665
+ else { $bc_c = $this->form_border_color; }
666
+ $f = array( 'n' => $this->formn,
667
+ 'typ' => 'Tx',
668
+ 'page' => $this->mpdf->page,
669
+ 'x' => $this->mpdf->x,
670
+ 'y' => $this->mpdf->y,
671
+ 'w' => $w,
672
+ 'h' => $h,
673
+ 'T' => $name,
674
+ 'FF' => $flags,
675
+ 'V' => $value,
676
+ 'DV' => $default,
677
+ 'TU' => $title,
678
+ 'hidden' => $hidden,
679
+ 'Q' => $align,
680
+ 'maxlen' => $maxlen,
681
+ 'BS_W' => $this->form_border_width,
682
+ 'BS_S' => $this->form_border_style,
683
+ 'BC_C' => $bc_c,
684
+ 'BG_C' => $bg_c,
685
+ 'style' => array(
686
+ 'font' => $this->mpdf->FontFamily,
687
+ 'fontsize' => $this->mpdf->FontSizePt,
688
+ 'fontcolor' => $this->mpdf->TextColor,
689
+ )
690
+ );
691
+ if (is_array($js) && count($js)>0) { $this->SetFormTextJS( $name, $js); } // mPDF 5.3.25
692
+ if ($this->mpdf->keep_block_together) { $this->mpdf->ktForms[]= $f; }
693
+ else if ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { $this->mpdf->HTMLheaderPageForms[]= $f; }
694
+ else {
695
+ if ($this->mpdf->ColActive) {
696
+ $this->mpdf->columnbuffer[] = array('s' => 'ACROFORM', 'col' => $this->mpdf->CurrCol, 'x' => $this->mpdf->x, 'y' => $this->mpdf->y,
697
+ 'h' => $h);
698
+ $this->mpdf->columnForms[$this->mpdf->CurrCol][INTVAL($this->mpdf->x)][INTVAL($this->mpdf->y)] = $this->formn;
699
+ }
700
+ $this->forms[$this->formn] = $f;
701
+ }
702
+ if (!in_array($this->mpdf->FontFamily, $this->form_fonts)) {
703
+ $this->form_fonts[] = $this->mpdf->FontFamily;
704
+ $this->mpdf->fonts[$this->mpdf->FontFamily]['used'] = true;
705
+ }
706
+ if ( !$hidden ) $this->mpdf->x += $w;
707
+
708
+ }
709
+
710
+
711
+ function SetFormChoice( $w, $h, $name, $flags, $array, $align='L', $js = '' ) {
712
+ $this->formn++;
713
+ if( $this->mpdf->blk[$this->mpdf->blklvl]['direction'] == 'rtl' ) { $align = '2'; }
714
+ else { $align = '0'; }
715
+ if (!preg_match('/^[a-zA-Z0-9_:\-]+$/', $name)) {
716
+ $this->mpdf->Error("Field [".$name."] must have a name attribute, which can only contain letters, numbers, colon(:), undersore(_) or hyphen(-)");
717
+ }
718
+ if ($this->mpdf->onlyCoreFonts) {
719
+ for($i=0;$i<count($array['VAL']);$i++) {
720
+ $array['VAL'][$i] = $this->Win1252ToPDFDocEncoding($array['VAL'][$i]);
721
+ $array['OPT'][$i] = $this->Win1252ToPDFDocEncoding($array['OPT'][$i]);
722
+ }
723
+ }
724
+ else {
725
+ for($i=0;$i<count($array['VAL']);$i++) {
726
+ if (isset($this->mpdf->CurrentFont['subset'])) {
727
+ $this->mpdf->UTF8StringToArray($array['VAL'][$i], true); // Add characters to font subset
728
+ $this->mpdf->UTF8StringToArray($array['OPT'][$i], true); // Add characters to font subset
729
+ }
730
+ if ($array['VAL'][$i] ) $array['VAL'][$i] = $this->mpdf->UTF8ToUTF16BE($array['VAL'][$i], true);
731
+ if ($array['OPT'][$i] ) $array['OPT'][$i] = $this->mpdf->UTF8ToUTF16BE($array['OPT'][$i], true);
732
+ }
733
+ }
734
+ $f = array( 'n' => $this->formn,
735
+ 'typ' => 'Ch',
736
+ 'page' => $this->mpdf->page,
737
+ 'x' => $this->mpdf->x,
738
+ 'y' => $this->mpdf->y,
739
+ 'w' => $w,
740
+ 'h' => $h,
741
+ 'T' => $name,
742
+ 'OPT' => $array,
743
+ 'FF' => $flags,
744
+ 'Q' => $align,
745
+ 'BS_W' => $this->form_border_width,
746
+ 'BS_S' => $this->form_border_style,
747
+ 'BC_C' => $this->form_border_color,
748
+ 'BG_C' => $this->form_background_color,
749
+ 'style' => array(
750
+ 'font' => $this->mpdf->FontFamily,
751
+ 'fontsize' => $this->mpdf->FontSizePt,
752
+ 'fontcolor' => $this->mpdf->TextColor,
753
+ )
754
+ );
755
+ if ($js) { $this->SetFormChoiceJS( $name, $js ); }
756
+ if ($this->mpdf->keep_block_together) { $this->mpdf->ktForms[]= $f; }
757
+ else if ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { $this->mpdf->HTMLheaderPageForms[]= $f; }
758
+ else {
759
+ if ($this->mpdf->ColActive) {
760
+ $this->mpdf->columnbuffer[] = array('s' => 'ACROFORM', 'col' => $this->mpdf->CurrCol, 'x' => $this->mpdf->x, 'y' => $this->mpdf->y,
761
+ 'h' => $h);
762
+ $this->mpdf->columnForms[$this->mpdf->CurrCol][INTVAL($this->mpdf->x)][INTVAL($this->mpdf->y)] = $this->formn;
763
+ }
764
+ $this->forms[$this->formn] = $f;
765
+ }
766
+ if (!in_array($this->mpdf->FontFamily, $this->form_fonts)) {
767
+ $this->form_fonts[] = $this->mpdf->FontFamily;
768
+ $this->mpdf->fonts[$this->mpdf->FontFamily]['used'] = true;
769
+ }
770
+ $this->mpdf->x += $w;
771
+ }
772
+
773
+ // CHECKBOX
774
+ function SetCheckBox( $w, $h, $name, $value, $title = '', $checked = false, $flags = array(), $disabled=false ) {
775
+ $this->SetFormButton( $w, $h, $name, $value, 'checkbox', $title, $flags, $checked, $disabled );
776
+ $this->mpdf->x += $w;
777
+ }
778
+
779
+
780
+ // RADIO
781
+ function SetRadio( $w, $h, $name, $value, $title = '', $checked = false, $flags = array(), $disabled=false ) {
782
+ $this->SetFormButton( $w, $h, $name, $value, 'radio', $title, $flags, $checked, $disabled );
783
+ $this->mpdf->x += $w;
784
+ }
785
+
786
+
787
+ function SetFormReset( $w, $h, $name, $value = 'Reset', $title = '', $flags = array(), $background_col=false, $border_col=false, $noprint=false ) {
788
+ if (!$name) { $name = 'Reset'; }
789
+ $this->SetFormButton( $w, $h, $name, $value, 'reset', $title, $flags, false, false, $background_col, $border_col, $noprint);
790
+ $this->mpdf->x += $w;
791
+ }
792
+
793
+
794
+ function SetJSButton( $w, $h, $name, $value, $js, $image_id = 0, $title = '', $flags = array(), $indexed=false , $background_col=false, $border_col=false, $noprint=false ) {
795
+ $this->SetFormButton( $w, $h, $name, $value, 'js_button', $title, $flags, false, false, $background_col, $border_col, $noprint);
796
+ // pos => 1 = no caption, icon only; 0 = caption only
797
+ if ($image_id) {
798
+ $this->form_button_icon[$this->mpdf->_escape($name)] = array(
799
+ 'pos' => 1,
800
+ 'image_id' => $image_id,
801
+ 'Indexed' => $indexed,
802
+ );
803
+ }
804
+ if ($js) { $this->SetFormButtonJS( $name, $js ); }
805
+ $this->mpdf->x += $w;
806
+ }
807
+
808
+
809
+ function SetFormSubmit( $w, $h, $name, $value = 'Submit', $url, $title = '', $typ = 'html', $method = 'POST', $flags = array(), $background_col=false, $border_col=false, $noprint=false) {
810
+ if (!$name) { $name = 'Submit'; }
811
+ $this->SetFormButton( $w, $h, $name, $value, 'submit', $title, $flags, false, false, $background_col, $border_col, $noprint);
812
+ $this->forms[$this->formn]['URL'] = $url;
813
+ $this->forms[$this->formn]['method'] = $method;
814
+ $this->forms[$this->formn]['exporttype'] = $typ;
815
+ $this->mpdf->x += $w;
816
+ }
817
+
818
+
819
+ function SetFormButtonText( $ca, $rc = '', $ac = '' ) {
820
+ if ($this->mpdf->onlyCoreFonts) {
821
+ $ca = $this->Win1252ToPDFDocEncoding($ca);
822
+ if ($rc) $rc = $this->Win1252ToPDFDocEncoding($rc);
823
+ if ($ac) $ac = $this->Win1252ToPDFDocEncoding($ac);
824
+ }
825
+ else {
826
+ if (isset($this->mpdf->CurrentFont['subset'])) {
827
+ $this->mpdf->UTF8StringToArray($ca, true); // Add characters to font subset
828
+ }
829
+ $ca = $this->mpdf->UTF8ToUTF16BE($ca, true);
830
+ if ($rc) {
831
+ if (isset($this->mpdf->CurrentFont['subset'])) { $this->mpdf->UTF8StringToArray($rc, true); }
832
+ $rc = $this->mpdf->UTF8ToUTF16BE($rc, true);
833
+ }
834
+ if ($ac) {
835
+ if (isset($this->mpdf->CurrentFont['subset'])) { $this->mpdf->UTF8StringToArray($ac, true); }
836
+ $ac = $this->mpdf->UTF8ToUTF16BE($ac, true);
837
+ }
838
+ }
839
+ $this->form_button_text = $ca;
840
+ $this->form_button_text_over = $rc ? $rc : $ca;
841
+ $this->form_button_text_click = $ac ? $ac : $ca;
842
+ }
843
+
844
+
845
+ function SetFormButton( $bb, $hh, $name, $value, $type, $title = '', $flags = array(), $checked=false, $disabled=false, $background_col=false, $border_col=false, $noprint=false ) {
846
+ $this->formn++;
847
+ if (!preg_match('/^[a-zA-Z0-9_:\-]+$/', $name)) {
848
+ $this->mpdf->Error("Field [".$name."] must have a name attribute, which can only contain letters, numbers, colon(:), undersore(_) or hyphen(-)");
849
+ }
850
+ if (!$this->mpdf->onlyCoreFonts) {
851
+ if (isset($this->mpdf->CurrentFont['subset'])) {
852
+ $this->mpdf->UTF8StringToArray($title, true); // Add characters to font subset
853
+ $this->mpdf->UTF8StringToArray($value, true); // Add characters to font subset
854
+ }
855
+ $title = $this->mpdf->UTF8ToUTF16BE($title, true);
856
+ if ($type == 'checkbox') {
857
+ $uvalue = $this->mpdf->UTF8ToUTF16BE($value, true);
858
+ }
859
+ else if ($type == 'radio') {
860
+ $uvalue = $this->mpdf->UTF8ToUTF16BE($value, true);
861
+ $value = mb_convert_encoding($value, 'Windows-1252', 'UTF-8');
862
+ }
863
+ else {
864
+ $value = $this->mpdf->UTF8ToUTF16BE($value, true);
865
+ $uvalue = $value;
866
+ }
867
+ }
868
+ else {
869
+ $title = $this->Win1252ToPDFDocEncoding($title);
870
+ $value = $this->Win1252ToPDFDocEncoding($value); //// ??? not needed
871
+ $uvalue = mb_convert_encoding($value, 'UTF-8', 'Windows-1252');
872
+ $uvalue = $this->mpdf->UTF8ToUTF16BE($uvalue, true);
873
+ }
874
+ if ($type == 'radio' || $type == 'checkbox') {
875
+ if (!preg_match('/^[a-zA-Z0-9_:\-\.]+$/', $value)) {
876
+ $this->mpdf->Error("Field '".$name."' must have a value, which can only contain letters, numbers, colon(:), undersore(_), hyphen(-) or period(.)");
877
+ }
878
+ }
879
+ if ($type == 'radio') {
880
+ if (!isset($this->form_radio_groups[$name])) {
881
+ $this->form_radio_groups[$name] = array(
882
+ 'page' => $this->mpdf->page,
883
+ 'kids' => array(),
884
+ );
885
+ }
886
+ $this->form_radio_groups[$name]['kids'][] = array(
887
+ 'n' => $this->formn, 'V'=> $value, 'OPT'=>$uvalue, 'disabled'=>$disabled
888
+ );
889
+ if ( $checked ) { $this->form_radio_groups[$name]['on'] = $value; }
890
+ // Disable the whole radio group if one is disabled, because of inconsistency in PDF readers
891
+ if ( $disabled ) { $this->form_radio_groups[$name]['disabled'] = true; }
892
+ }
893
+ if ($type == 'checkbox') {
894
+ $this->form_checkboxes = true;
895
+ }
896
+ if ( $checked ) { $activ = 1; }
897
+ else { $activ = 0; }
898
+ if ($background_col) { $bg_c = $this->mpdf->SetColor($background_col, 'CodeOnly'); }
899
+ else { $bg_c = $this->form_button_background_color; }
900
+ if ($border_col) { $bc_c = $this->mpdf->SetColor($border_col, 'CodeOnly'); }
901
+ else { $bc_c = $this->form_button_border_color; }
902
+ $f = array( 'n' => $this->formn,
903
+ 'typ' => 'Bt',
904
+ 'page' => $this->mpdf->page,
905
+ 'subtype' => $type,
906
+ 'x' => $this->mpdf->x,
907
+ 'y' => $this->mpdf->y,
908
+ 'w' => $bb,
909
+ 'h' => $hh,
910
+ 'T' => $name,
911
+ 'V' => $value,
912
+ 'OPT' => $uvalue,
913
+ 'TU' => $title,
914
+ 'FF' => $flags,
915
+ 'CA' => $this->form_button_text,
916
+ 'RC' => $this->form_button_text_over,
917
+ 'AC' => $this->form_button_text_click,
918
+ 'BS_W' => $this->form_button_border_width,
919
+ 'BS_S' => $this->form_button_border_style,
920
+ 'BC_C' => $bc_c,
921
+ 'BG_C' => $bg_c,
922
+ 'activ' => $activ,
923
+ 'disabled' => $disabled,
924
+ 'noprint' => $noprint,
925
+ 'style' => array(
926
+ 'font' => $this->mpdf->FontFamily,
927
+ 'fontsize' => $this->mpdf->FontSizePt,
928
+ 'fontcolor' => $this->mpdf->TextColor,
929
+ )
930
+ );
931
+ if ($this->mpdf->keep_block_together) { $this->mpdf->ktForms[]= $f; }
932
+ else if ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { $this->mpdf->HTMLheaderPageForms[]= $f; }
933
+ else {
934
+ if ($this->mpdf->ColActive) {
935
+ $this->mpdf->columnbuffer[] = array('s' => 'ACROFORM', 'col' => $this->mpdf->CurrCol, 'x' => $this->mpdf->x, 'y' => $this->mpdf->y,
936
+ 'h' => $hh);
937
+ $this->mpdf->columnForms[$this->mpdf->CurrCol][INTVAL($this->mpdf->x)][INTVAL($this->mpdf->y)] = $this->formn;
938
+ }
939
+ $this->forms[$this->formn] = $f;
940
+ }
941
+ if (!in_array($this->mpdf->FontFamily, $this->form_fonts)) {
942
+ $this->form_fonts[] = $this->mpdf->FontFamily;
943
+ $this->mpdf->fonts[$this->mpdf->FontFamily]['used'] = true;
944
+ }
945
+
946
+ $this->form_button_text = NULL;
947
+ $this->form_button_text_over = NULL;
948
+ $this->form_button_text_click = NULL;
949
+ }
950
+
951
+
952
+
953
+ function SetFormBorderWidth ( $string ) {
954
+ switch( $string ) {
955
+ case 'S': $this->form_border_width = '1';
956
+ break;
957
+ case 'M': $this->form_border_width = '2';
958
+ break;
959
+ case 'B': $this->form_border_width = '3';
960
+ break;
961
+ case '0': $this->form_border_width = '0';
962
+ break;
963
+ default: $this->form_border_width = '0';
964
+ break;
965
+ }
966
+ }
967
+
968
+
969
+ function SetFormBorderStyle ( $string ) {
970
+ switch( $string ) {
971
+ case 'S': $this->form_border_style = 'S';
972
+ break;
973
+ case 'D': $this->form_border_style = 'D /D [3]';
974
+ break;
975
+ case 'B': $this->form_border_style = 'B';
976
+ break;
977
+ case 'I': $this->form_border_style = 'I';
978
+ break;
979
+ case 'U': $this->form_border_style = 'U';
980
+ break;
981
+ default: $this->form_border_style = 'B';
982
+ break;
983
+ }
984
+ }
985
+
986
+ function SetFormBorderColor ( $r, $g=-1, $b=-1 ) {
987
+ if ( ($r==0 and $g==0 and $b==0) || $g==-1 )
988
+ $this->form_border_color = sprintf('%.3F', $r/255);
989
+ else
990
+ $this->form_border_color = sprintf('%.3F %.3F %.3F', $r/255, $g/255, $b/255);
991
+ }
992
+
993
+ function SetFormBackgroundColor ( $r, $g=-1, $b=-1 ) {
994
+ if ( ($r==0 and $g==0 and $b==0) || $g==-1 )
995
+ $this->form_background_color = sprintf('%.3F', $r/255);
996
+ else
997
+ $this->form_background_color = sprintf('%.3F %.3F %.3F', $r/255, $g/255, $b/255);
998
+ }
999
+
1000
+ function SetFormD ( $W, $S, $BC, $BG ) {
1001
+ $this->SetFormBorderWidth ( $W );
1002
+ $this->SetFormBorderStyle ( $S );
1003
+ $this->SetFormBorderColor ( $BC );
1004
+ $this->SetFormBackgroundColor ( $BG );
1005
+ }
1006
+
1007
+ function _setflag( $array ) {
1008
+ $flag = 0;
1009
+ foreach($array as $val) { $flag += 1 << ($val-1); }
1010
+ return $flag;
1011
+ }
1012
+
1013
+ function _form_rect( $x, $y, $w, $h, $hPt ) {
1014
+ $x = $x * _MPDFK;
1015
+ $y = $hPt - ($y * _MPDFK);
1016
+ $x2 = $x + ($w * _MPDFK);
1017
+ $y2 = $y - ($h * _MPDFK);
1018
+ $rect = sprintf('%.3F %.3F %.3F %.3F', $x, $y2, $x2, $y );
1019
+ return $rect;
1020
+ }
1021
+
1022
+
1023
+ function _put_button_icon( $array , $w, $h ) {
1024
+ if (isset($array['image_id'])) {
1025
+ $info = false;
1026
+ foreach($this->mpdf->images AS $iid=>$img) {
1027
+ if ($img['i'] == $array['image_id']) {
1028
+ $info = $this->mpdf->images[$iid];
1029
+ break;
1030
+ }
1031
+ }
1032
+ }
1033
+ if (!$info) { die("Cannot find Button image"); }
1034
+ $this->mpdf->_newobj();
1035
+ $this->mpdf->_out('<<');
1036
+ $this->mpdf->_out('/Type /XObject');
1037
+ $this->mpdf->_out('/Subtype /Image');
1038
+ $this->mpdf->_out('/BBox [0 0 1 1]');
1039
+ $this->mpdf->_out('/Length '.strlen($info['data']));
1040
+ $this->mpdf->_out('/BitsPerComponent '.$info['bpc']);
1041
+ if ($info['cs']=='Indexed') {
1042
+ $this->mpdf->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->mpdf->n+1).' 0 R]');
1043
+ }
1044
+ else {
1045
+ $this->mpdf->_out('/ColorSpace /'.$info['cs']);
1046
+ if ($info['cs']=='DeviceCMYK')
1047
+ if($info['type']=='jpg') { $this->mpdf->_out('/Decode [1 0 1 0 1 0 1 0]'); }
1048
+ }
1049
+ if ( isset($info['f']) )
1050
+ $this->mpdf->_out('/Filter /'.$info['f']);
1051
+ if ( isset($info['parms']) )
1052
+ $this->mpdf->_out($info['parms']);
1053
+ $this->mpdf->_out('/Width '.$info['w']);
1054
+ $this->mpdf->_out('/Height '.$info['h']);
1055
+ $this->mpdf->_out('>>');
1056
+ $this->mpdf->_putstream($info['data']);
1057
+ $this->mpdf->_out('endobj');
1058
+ unset($array);
1059
+ //Palette
1060
+ if($info['cs']=='Indexed') {
1061
+ $filter=($this->mpdf->compress) ? '/Filter /FlateDecode ' : '';
1062
+ $this->mpdf->_newobj();
1063
+ $pal=($this->mpdf->compress) ? gzcompress($info['pal']) : $info['pal'];
1064
+ $this->mpdf->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
1065
+ $this->mpdf->_putstream($pal);
1066
+ $this->mpdf->_out('endobj');
1067
+ }
1068
+
1069
+ }
1070
+
1071
+
1072
+ function _putform_bt( $form, $hPt ) {
1073
+ $cc = 0;
1074
+ $put_xobject = 0;
1075
+ $put_js = 0;
1076
+ $put_icon = 0;
1077
+ $this->mpdf->_newobj();
1078
+ $n = $this->mpdf->n;
1079
+ if ($form['subtype'] != 'radio') $this->pdf_acro_array .= $n.' 0 R '; // Add to /Field element
1080
+ $this->forms[ $form['n'] ]['obj'] = $n;
1081
+ $this->mpdf->_out('<<');
1082
+ $this->mpdf->_out('/Type /Annot ');
1083
+ $this->mpdf->_out('/Subtype /Widget');
1084
+ $this->mpdf->_out('/NM '.$this->mpdf->_textstring(sprintf('%04u-%04u', $n, (7000 + $form['n']))));
1085
+ $this->mpdf->_out('/M '.$this->mpdf->_textstring('D:'.date('YmdHis')));
1086
+ $this->mpdf->_out('/Rect [ '.$this->_form_rect($form['x'],$form['y'],$form['w'],$form['h'], $hPt).' ]');
1087
+ $form['noprint'] ? $this->mpdf->_out('/F 0 ') : $this->mpdf->_out('/F 4 ');
1088
+ $this->mpdf->_out('/FT /Btn ');
1089
+ $this->mpdf->_out('/H /P ');
1090
+ if ( $form['subtype'] != 'radio' ) // mPDF 5.3.23
1091
+ $this->mpdf->_out('/T '.$this->mpdf->_textstring($form['T']) );
1092
+ $this->mpdf->_out('/TU '.$this->mpdf->_textstring($form['TU']) );
1093
+ if ( isset( $this->form_button_icon[ $form['T'] ] ) ) { $form['BS_W'] = 0; }
1094
+ if ($form['BS_W'] == 0) { $form['BC_C'] = $form['BG_C']; }
1095
+ $bstemp = '';
1096
+ $bstemp .= '/W '.$form['BS_W'].' ';
1097
+ $bstemp .= '/S /'.$form['BS_S'].' ';
1098
+ $temp = '';
1099
+ $temp .= '/BC [ '.$form['BC_C']." ] ";
1100
+ $temp .= '/BG [ '.$form['BG_C']." ] ";
1101
+ if ( $form['subtype'] == 'checkbox' ) {
1102
+ if ($form['disabled']) {
1103
+ $radio_color = '0.5 0.5 0.5';
1104
+ $radio_background_color = '0.9 0.9 0.9';
1105
+ }
1106
+ else {
1107
+ $radio_color = $this->form_radio_color;
1108
+ $radio_background_color = $this->form_radio_background_color;
1109
+ }
1110
+ $temp = '';
1111
+ $temp .= '/BC [ '.$radio_color." ] ";
1112
+ $temp .= '/BG [ '.$radio_background_color." ] ";
1113
+ $this->mpdf->_out("/BS << /W 1 /S /S >>");
1114
+ $this->mpdf->_out("/MK << $temp >>");
1115
+ $this->mpdf->_out('/Ff '.$this->_setflag($form['FF']) );
1116
+ if ( $form['activ'] ) {
1117
+ $this->mpdf->_out('/V /'.$this->mpdf->_escape($form['V']).' ');
1118
+ $this->mpdf->_out('/DV /'.$this->mpdf->_escape($form['V']).' ');
1119
+ $this->mpdf->_out('/AS /'.$this->mpdf->_escape($form['V']).' ');
1120
+ } else {
1121
+ $this->mpdf->_out('/AS /Off ');
1122
+ }
1123
+ if ($this->formUseZapD) {
1124
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts['czapfdingbats']['i'].' 0 Tf '.$radio_color.' rg)');
1125
+ $this->mpdf->_out("/AP << /N << /".$this->mpdf->_escape($form['V'])." ".($this->mpdf->n+1)." 0 R /Off /Off >> >>");
1126
+ }
1127
+ else {
1128
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts[$this->mpdf->CurrentFont['fontkey']]['i'].' 0 Tf '.$radio_color.' rg)');
1129
+ $this->mpdf->_out("/AP << /N << /".$this->mpdf->_escape($form['V'])." ".($this->mpdf->n+1)." 0 R /Off ".($this->mpdf->n+2)." 0 R >> >>");
1130
+ }
1131
+ $this->mpdf->_out('/Opt [ '.$this->mpdf->_textstring($form['OPT']).' '.$this->mpdf->_textstring($form['OPT']).' ]');
1132
+ }
1133
+
1134
+
1135
+ if ( $form['subtype'] == 'radio' ) {
1136
+ if ($form['disabled'] || $this->form_radio_groups[$form['T']]['disabled']) {
1137
+ $radio_color = '0.5 0.5 0.5';
1138
+ $radio_background_color = '0.9 0.9 0.9';
1139
+ }
1140
+ else {
1141
+ $radio_color = $this->form_radio_color;
1142
+ $radio_background_color = $this->form_radio_background_color;
1143
+ }
1144
+ $this->mpdf->_out('/Parent '.$this->form_radio_groups[$form['T']]['obj_id'].' 0 R ');
1145
+ $temp = '';
1146
+ $temp .= '/BC [ '.$radio_color." ] ";
1147
+ $temp .= '/BG [ '.$radio_background_color." ] ";
1148
+ $this->mpdf->_out("/BS << /W 1 /S /S >>");
1149
+ $this->mpdf->_out('/MK << '.$temp.' >> ');
1150
+ $form['FF'][] = 16; // Radiobutton
1151
+ $form['FF'][] = 15; // NoToggleOff - must be same as radio button group setting?
1152
+ $this->mpdf->_out('/Ff '.$this->_setflag($form['FF']) );
1153
+ if ($this->formUseZapD)
1154
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts['czapfdingbats']['i'].' 0 Tf '.$radio_color.' rg)');
1155
+ else
1156
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts[$this->mpdf->CurrentFont['fontkey']]['i'].' 0 Tf '.$radio_color.' rg)');
1157
+ $this->mpdf->_out("/AP << /N << /".$this->mpdf->_escape($form['V'])." ".($this->mpdf->n+1)." 0 R /Off ".($this->mpdf->n+2)." 0 R >> >>");
1158
+ if ( $form['activ'] ) {
1159
+ $this->mpdf->_out('/V /'.$this->mpdf->_escape($form['V']).' ');
1160
+ $this->mpdf->_out('/DV /'.$this->mpdf->_escape($form['V']).' ');
1161
+ $this->mpdf->_out('/AS /'.$this->mpdf->_escape($form['V']).' ');
1162
+ }
1163
+ else {
1164
+ $this->mpdf->_out('/AS /Off ');
1165
+ }
1166
+ $this->mpdf->_out("/AP << /N << /".$this->mpdf->_escape($form['V'])." ".($this->mpdf->n+1)." 0 R /Off ".($this->mpdf->n+2)." 0 R >> >>");
1167
+ // $this->mpdf->_out('/Opt [ '.$this->mpdf->_textstring($form['OPT']).' '.$this->mpdf->_textstring($form['OPT']).' ]');
1168
+ }
1169
+
1170
+ if ( $form['subtype'] == 'reset' ) {
1171
+ $temp .= $form['CA'] ? '/CA '.$this->mpdf->_textstring($form['CA']).' ' : '/CA '.$this->mpdf->_textstring($form['T']).' ';
1172
+ $temp .= $form['RC'] ? '/RC '.$this->mpdf->_textstring($form['RC']).' ' : '/RC '.$this->mpdf->_textstring($form['T']).' ';
1173
+ $temp .= $form['AC'] ? '/AC '.$this->mpdf->_textstring($form['AC']).' ' : '/AC '.$this->mpdf->_textstring($form['T']).' ';
1174
+ $this->mpdf->_out("/BS << $bstemp >>");
1175
+ $this->mpdf->_out('/MK << '.$temp.' >>');
1176
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts[$form['style']['font']]['i'].' '.$form['style']['fontsize'].' Tf '.$form['style']['fontcolor'].')');
1177
+ $this->mpdf->_out('/AA << /D << /S /ResetForm /Flags 1 >> >>');
1178
+ $form['FF'][] = 17;
1179
+ $this->mpdf->_out('/Ff '.$this->_setflag($form['FF']) );
1180
+ }
1181
+
1182
+
1183
+ if ( $form['subtype'] == 'submit' ) {
1184
+ $temp .= $form['CA'] ? '/CA '.$this->mpdf->_textstring($form['CA']).' ' : '/CA '.$this->mpdf->_textstring($form['T']).' ';
1185
+ $temp .= $form['RC'] ? '/RC '.$this->mpdf->_textstring($form['RC']).' ' : '/RC '.$this->mpdf->_textstring($form['T']).' ';
1186
+ $temp .= $form['AC'] ? '/AC '.$this->mpdf->_textstring($form['AC']).' ' : '/AC '.$this->mpdf->_textstring($form['T']).' ';
1187
+ $this->mpdf->_out("/BS << $bstemp >>");
1188
+ $this->mpdf->_out("/MK << $temp >>");
1189
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts[$form['style']['font']]['i'].' '.$form['style']['fontsize'].' Tf '.$form['style']['fontcolor'].')');
1190
+ // Bit 4 (8) = useGETmethod else use POST
1191
+ // Bit 3 (4) = HTML export format (charset chosen by Adobe)--- OR ---
1192
+ // Bit 6 (32) = XFDF export format (form of XML in UTF-8)
1193
+ if ($form['exporttype'] == 'xfdf') { $flag = 32; } // 'xfdf' or 'html'
1194
+ else {
1195
+ if ($form['method'] == 'GET') { $flag = 12; }
1196
+ else { $flag = 4; }
1197
+ }
1198
+ // Bit 2 (2) = IncludeNoValueFields
1199
+ if ($this->formSubmitNoValueFields) $flag += 2;
1200
+ // To submit a value, needs to be in /AP dictionary, AND this object must contain a /Fields entry
1201
+ // listing all fields to output
1202
+ $this->mpdf->_out('/AA << /D << /S /SubmitForm /F ('.$form['URL'].') /Flags '.$flag.' >> >>');
1203
+ $form['FF'][] = 17;
1204
+ $this->mpdf->_out('/Ff '.$this->_setflag($form['FF']) );
1205
+ }
1206
+
1207
+ if ( $form['subtype'] == 'js_button' ) {
1208
+ // Icon / image
1209
+ if ( isset( $this->form_button_icon[ $form['T'] ] ) ) {
1210
+ $cc++;
1211
+ $temp .= '/TP '.$this->form_button_icon[$form['T']]['pos'].' ';
1212
+ $temp .= '/I '.($cc + $this->mpdf->n).' 0 R '; // Normal icon
1213
+ $temp .= '/RI '.($cc + $this->mpdf->n).' 0 R '; // onMouseOver
1214
+ $temp .= '/IX '.($cc + $this->mpdf->n).' 0 R '; // onClick / onMouseDown
1215
+ $temp .= '/IF << /SW /A /S /A /A [0.0 0.0] >> '; // Icon fit dictionary
1216
+ if ($this->form_button_icon[ $form['T'] ]['Indexed']) { $cc++; }
1217
+ $put_icon = 1;
1218
+ }
1219
+ $temp .= $form['CA'] ? '/CA '.$this->mpdf->_textstring($form['CA']).' ' : '/CA '.$this->mpdf->_textstring($form['T']).' ';
1220
+ $temp .= $form['RC'] ? '/RC '.$this->mpdf->_textstring($form['RC']).' ' : '/RC '.$this->mpdf->_textstring($form['T']).' ';
1221
+ $temp .= $form['AC'] ? '/AC '.$this->mpdf->_textstring($form['AC']).' ' : '/AC '.$this->mpdf->_textstring($form['T']).' ';
1222
+ $this->mpdf->_out("/BS << $bstemp >>");
1223
+ $this->mpdf->_out("/MK << $temp >>");
1224
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts[$form['style']['font']]['i'].' '.$form['style']['fontsize'].' Tf '.$form['style']['fontcolor'].')');
1225
+ $form['FF'][] = 17;
1226
+ $this->mpdf->_out('/Ff '.$this->_setflag($form['FF']) );
1227
+ // Javascript
1228
+ if ( isset($this->array_form_button_js[$form['T']]) ) {
1229
+ $cc++;
1230
+ $this->mpdf->_out("/AA << /D ".($cc + $this->mpdf->n)." 0 R >>");
1231
+ $put_js = 1;
1232
+ }
1233
+ }
1234
+
1235
+ $this->mpdf->_out('>>');
1236
+ $this->mpdf->_out('endobj');
1237
+
1238
+ // additional objects
1239
+ // obj icon
1240
+ if ( $put_icon == 1 ) {
1241
+ $this->_put_button_icon( $this->form_button_icon[ $form['T'] ], $form['w'], $form['h'] );
1242
+ $put_icon = NULL;
1243
+ }
1244
+ // obj + 1
1245
+ if ( $put_js == 1 ) {
1246
+ $this->mpdf->_set_object_javascript( $this->array_form_button_js[$form['T']]['js'] );
1247
+ unset( $this->array_form_button_js[$form['T']] );
1248
+ $put_js = NULL;
1249
+ }
1250
+
1251
+ // RADIO and CHECK BOX appearance streams
1252
+ $filter=($this->mpdf->compress) ? '/Filter /FlateDecode ' : '';
1253
+ if ( $form['subtype'] == 'radio' ) {
1254
+ // output 2 appearance streams for radio buttons on/off
1255
+ if ($this->formUseZapD) {
1256
+ $fs = sprintf('%.3F', $form['style']['fontsize']*1.25);
1257
+ $fi = 'czapfdingbats';
1258
+ $r_on = 'q '.$radio_color .' rg BT /F'.$this->mpdf->fonts[$fi]['i'].' '.$fs.' Tf 0 0 Td (4) Tj ET Q';
1259
+ $r_off = 'q '.$radio_color .' rg BT /F'.$this->mpdf->fonts[$fi]['i'].' '.$fs.' Tf 0 0 Td (8) Tj ET Q';
1260
+ }
1261
+ else {
1262
+ $matrix = sprintf('%.3F 0 0 %.3F 0 %.3F', $form['style']['fontsize']*1.33/10, $form['style']['fontsize']*1.25/10, $form['style']['fontsize']);
1263
+ $fill = $radio_background_color.' rg 3.778 -7.410 m 2.800 -7.410 1.947 -7.047 1.225 -6.322 c 0.500 -5.600 0.138 -4.747 0.138 -3.769 c 0.138 -2.788 0.500 -1.938 1.225 -1.213 c 1.947 -0.491 2.800 -0.128 3.778 -0.128 c 4.757 -0.128 5.610 -0.491 6.334 -1.213 c 7.056 -1.938 7.419 -2.788 7.419 -3.769 c 7.419 -4.747 7.056 -5.600 6.334 -6.322 c 5.610 -7.047 4.757 -7.410 3.778 -7.410 c h f ';
1264
+ $circle = '3.778 -6.963 m 4.631 -6.963 5.375 -6.641 6.013 -6.004 c 6.653 -5.366 6.972 -4.619 6.972 -3.769 c 6.972 -2.916 6.653 -2.172 6.013 -1.532 c 5.375 -0.894 4.631 -0.576 3.778 -0.576 c 2.928 -0.576 2.182 -0.894 1.544 -1.532 c 0.904 -2.172 0.585 -2.916 0.585 -3.769 c 0.585 -4.619 0.904 -5.366 1.544 -6.004 c 2.182 -6.641 2.928 -6.963 3.778 -6.963 c h 3.778 -7.410 m 2.800 -7.410 1.947 -7.047 1.225 -6.322 c 0.500 -5.600 0.138 -4.747 0.138 -3.769 c 0.138 -2.788 0.500 -1.938 1.225 -1.213 c 1.947 -0.491 2.800 -0.128 3.778 -0.128 c 4.757 -0.128 5.610 -0.491 6.334 -1.213 c 7.056 -1.938 7.419 -2.788 7.419 -3.769 c 7.419 -4.747 7.056 -5.600 6.334 -6.322 c 5.610 -7.047 4.757 -7.410 3.778 -7.410 c h f ';
1265
+ $r_on = 'q '.$matrix.' cm '.$fill .$radio_color.' rg '.$circle.' '.$radio_color.' rg
1266
+ 5.184 -5.110 m 4.800 -5.494 4.354 -5.685 3.841 -5.685 c 3.331 -5.685 2.885 -5.494 2.501 -5.110 c 2.119 -4.725 1.925 -4.279 1.925 -3.769 c 1.925 -3.257 2.119 -2.810 2.501 -2.429 c 2.885 -2.044 3.331 -1.853 3.841 -1.853 c 4.354 -1.853 4.800 -2.044 5.184 -2.429 c 5.566 -2.810 5.760 -3.257 5.760 -3.769 c 5.760 -4.279 5.566 -4.725 5.184 -5.110 c h
1267
+ f Q ';
1268
+ $r_off = 'q '.$matrix.' cm '.$fill .$radio_color.' rg '.$circle.' Q ';
1269
+ }
1270
+
1271
+ $this->mpdf->_newobj();
1272
+ $p=($this->mpdf->compress) ? gzcompress($r_on) : $r_on;
1273
+ $this->mpdf->_out('<<'.$filter.'/Length '.strlen($p).' /Resources 2 0 R>>');
1274
+ $this->mpdf->_putstream($p);
1275
+ $this->mpdf->_out('endobj');
1276
+
1277
+ $this->mpdf->_newobj();
1278
+ $p=($this->mpdf->compress) ? gzcompress($r_off) : $r_off;
1279
+ $this->mpdf->_out('<<'.$filter.'/Length '.strlen($p).' /Resources 2 0 R>>');
1280
+ $this->mpdf->_putstream($p);
1281
+ $this->mpdf->_out('endobj');
1282
+ }
1283
+ if ( $form['subtype'] == 'checkbox' ) {
1284
+ // First output appearance stream for check box on
1285
+ if ($this->formUseZapD) {
1286
+ $fs = sprintf('%.3F', $form['style']['fontsize']*1.25);
1287
+ $fi = 'czapfdingbats';
1288
+ $cb_on = 'q '.$radio_color .' rg BT /F'.$this->mpdf->fonts[$fi]['i'].' '.$fs.' Tf 0 0 Td (4) Tj ET Q';
1289
+ $cb_off = 'q '.$radio_color .' rg BT /F'.$this->mpdf->fonts[$fi]['i'].' '.$fs.' Tf 0 0 Td (8) Tj ET Q';
1290
+ }
1291
+ else {
1292
+ $matrix = sprintf('%.3F 0 0 %.3F 0 %.3F', $form['style']['fontsize']*1.33/10, $form['style']['fontsize']*1.25/10, $form['style']['fontsize']);
1293
+ $fill = $radio_background_color.' rg 7.395 -0.070 m 7.395 -7.344 l 0.121 -7.344 l 0.121 -0.070 l 7.395 -0.070 l h f ';
1294
+ $square = '0.508 -6.880 m 6.969 -6.880 l 6.969 -0.534 l 0.508 -0.534 l 0.508 -6.880 l h 7.395 -0.070 m 7.395 -7.344 l 0.121 -7.344 l 0.121 -0.070 l 7.395 -0.070 l h ';
1295
+ $cb_on = 'q '.$matrix.' cm '.$fill. $radio_color.' rg '.$square.' f '.$radio_color.' rg
1296
+ 6.321 -1.352 m 5.669 -2.075 5.070 -2.801 4.525 -3.532 c 3.979 -4.262 3.508 -4.967 3.112 -5.649 c 3.080 -5.706 3.039 -5.779 2.993 -5.868 c 2.858 -6.118 2.638 -6.243 2.334 -6.243 c 2.194 -6.243 2.100 -6.231 2.052 -6.205 c 2.003 -6.180 1.954 -6.118 1.904 -6.020 c 1.787 -5.788 1.688 -5.523 1.604 -5.226 c 1.521 -4.930 1.480 -4.721 1.480 -4.600 c 1.480 -4.535 1.491 -4.484 1.512 -4.447 c 1.535 -4.410 1.579 -4.367 1.647 -4.319 c 1.733 -4.259 1.828 -4.210 1.935 -4.172 c 2.040 -4.134 2.131 -4.115 2.205 -4.115 c 2.267 -4.115 2.341 -4.232 2.429 -4.469 c 2.437 -4.494 2.444 -4.511 2.448 -4.522 c 2.451 -4.531 2.456 -4.546 2.465 -4.568 c 2.546 -4.795 2.614 -4.910 2.668 -4.910 c 2.714 -4.910 2.898 -4.652 3.219 -4.136 c 3.539 -3.620 3.866 -3.136 4.197 -2.683 c 4.426 -2.367 4.633 -2.103 4.816 -1.889 c 4.998 -1.676 5.131 -1.544 5.211 -1.493 c 5.329 -1.426 5.483 -1.368 5.670 -1.319 c 5.856 -1.271 6.066 -1.238 6.296 -1.217 c 6.321 -1.352 l h f Q ';
1297
+ $cb_off = 'q '.$matrix.' cm '.$fill. $radio_color.' rg '.$square.' f Q ';
1298
+
1299
+ }
1300
+ $this->mpdf->_newobj();
1301
+ $p=($this->mpdf->compress) ? gzcompress($cb_on) : $cb_on;
1302
+ $this->mpdf->_out('<<'.$filter.'/Length '.strlen($p).' /Resources 2 0 R>>');
1303
+ $this->mpdf->_putstream($p);
1304
+ $this->mpdf->_out('endobj');
1305
+
1306
+ // output appearance stream for check box off (only if not using ZapfDingbats)
1307
+ if (!$this->formUseZapD) {
1308
+ $this->mpdf->_newobj();
1309
+ $p=($this->mpdf->compress) ? gzcompress($cb_off) : $cb_off;
1310
+ $this->mpdf->_out('<<'.$filter.'/Length '.strlen($p).' /Resources 2 0 R>>');
1311
+ $this->mpdf->_putstream($p);
1312
+ $this->mpdf->_out('endobj');
1313
+ }
1314
+
1315
+ }
1316
+ return $n;
1317
+ }
1318
+
1319
+
1320
+ function _putform_ch( $form, $hPt ) {
1321
+ $put_js = 0;
1322
+ $this->mpdf->_newobj();
1323
+ $n = $this->mpdf->n;
1324
+ $this->pdf_acro_array .= $n.' 0 R ';
1325
+ $this->forms[ $form['n'] ]['obj'] = $n;
1326
+
1327
+ $this->mpdf->_out('<<');
1328
+ $this->mpdf->_out('/Type /Annot ');
1329
+ $this->mpdf->_out('/Subtype /Widget');
1330
+ $this->mpdf->_out('/Rect [ '.$this->_form_rect($form['x'],$form['y'],$form['w'],$form['h'], $hPt).' ]');
1331
+ $this->mpdf->_out('/F 4');
1332
+ $this->mpdf->_out('/FT /Ch');
1333
+ if ($form['Q']) $this->mpdf->_out('/Q '.$form['Q'].'');
1334
+ $temp = '';
1335
+ $temp .= '/W '.$form['BS_W'].' ';
1336
+ $temp .= '/S /'.$form['BS_S'].' ';
1337
+ $this->mpdf->_out("/BS << $temp >>");
1338
+
1339
+ $temp = '';
1340
+ $temp .= '/BC [ '.$form['BC_C']." ] ";
1341
+ $temp .= '/BG [ '.$form['BG_C']." ] ";
1342
+ $this->mpdf->_out('/MK << '.$temp.' >>');
1343
+
1344
+ $this->mpdf->_out('/NM '.$this->mpdf->_textstring(sprintf('%04u-%04u', $n, (6000 + $form['n']))));
1345
+ $this->mpdf->_out('/M '.$this->mpdf->_textstring('D:'.date('YmdHis')));
1346
+
1347
+ $this->mpdf->_out('/T '.$this->mpdf->_textstring($form['T']) );
1348
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts[$form['style']['font']]['i'].' '.$form['style']['fontsize'].' Tf '.$form['style']['fontcolor'].')');
1349
+
1350
+ $opt = '';
1351
+ for( $i = 0; $i < count($form['OPT']['VAL']) ; $i++ ) {
1352
+ $opt .= '[ '.$this->mpdf->_textstring($form['OPT']['VAL'][$i]).' '.$this->mpdf->_textstring($form['OPT']['OPT'][$i]).' ] ';
1353
+ }
1354
+ $this->mpdf->_out('/Opt [ '.$opt.']');
1355
+
1356
+ // selected
1357
+ $selectItem = false;
1358
+ $selectIndex = false;
1359
+ foreach ( $form['OPT']['SEL'] as $selectKey => $selectVal ) {
1360
+ $selectName = $this->mpdf->_textstring($form['OPT']['VAL'][$selectVal]);
1361
+ $selectItem .= ' '.$selectName.' ';
1362
+ $selectIndex .= ' '.$selectVal.' ';
1363
+ }
1364
+ if ( $selectItem ) {
1365
+ if (count($form['OPT']['SEL']) < 2) {
1366
+ $this->mpdf->_out('/V '.$selectItem.' ');
1367
+ $this->mpdf->_out('/DV '.$selectItem.' ');
1368
+ }
1369
+ else {
1370
+ $this->mpdf->_out('/V ['.$selectItem.'] ');
1371
+ $this->mpdf->_out('/DV ['.$selectItem.'] ');
1372
+ }
1373
+ $this->mpdf->_out('/I ['.$selectIndex.'] ');
1374
+ }
1375
+
1376
+ if ( is_array($form['FF']) && count($form['FF'])>0 ) {
1377
+ $this->mpdf->_out('/Ff '.$this->_setflag($form['FF']).' ');
1378
+ }
1379
+ // Javascript
1380
+ if ( isset($this->array_form_choice_js[$form['T']]) ) {
1381
+ $this->mpdf->_out("/AA << /V ".($this->mpdf->n+1)." 0 R >>");
1382
+ $put_js = 1;
1383
+ }
1384
+
1385
+ $this->mpdf->_out('>>');
1386
+ $this->mpdf->_out('endobj');
1387
+ // obj + 1
1388
+ if ( $put_js == 1 ) {
1389
+ $this->mpdf->_set_object_javascript( $this->array_form_choice_js[$form['T']]['js'] );
1390
+ unset( $this->array_form_choice_js[$form['T']] );
1391
+ $put_js = NULL;
1392
+ }
1393
+
1394
+ return $n;
1395
+ }
1396
+
1397
+
1398
+ function _putform_tx( $form, $hPt ) {
1399
+ $put_js = 0;
1400
+ $this->mpdf->_newobj();
1401
+ $n = $this->mpdf->n;
1402
+ $this->pdf_acro_array .= $n.' 0 R ';
1403
+ $this->forms[ $form['n'] ]['obj'] = $n;
1404
+
1405
+ $this->mpdf->_out('<<');
1406
+ $this->mpdf->_out('/Type /Annot ');
1407
+ $this->mpdf->_out('/Subtype /Widget ');
1408
+
1409
+ $this->mpdf->_out('/Rect [ '.$this->_form_rect($form['x'],$form['y'],$form['w'],$form['h'], $hPt).' ] ');
1410
+ $form['hidden'] ? $this->mpdf->_out('/F 2 ') : $this->mpdf->_out('/F 4 ');
1411
+ $this->mpdf->_out('/FT /Tx ');
1412
+
1413
+ $this->mpdf->_out('/H /N ');
1414
+ $this->mpdf->_out('/R 0 ');
1415
+
1416
+ if ( is_array($form['FF']) && count($form['FF'])>0 ) {
1417
+ $this->mpdf->_out('/Ff '.$this->_setflag($form['FF']).' ');
1418
+ }
1419
+ if ( isset($form['maxlen']) && $form['maxlen']>0 ) {
1420
+ $this->mpdf->_out('/MaxLen '.$form['maxlen']);
1421
+ }
1422
+
1423
+ $temp = '';
1424
+ $temp .= '/W '.$form['BS_W'].' ';
1425
+ $temp .= '/S /'.$form['BS_S'].' ';
1426
+ $this->mpdf->_out("/BS << $temp >>");
1427
+
1428
+ $temp = '';
1429
+ $temp .= '/BC [ '.$form['BC_C']." ] ";
1430
+ $temp .= '/BG [ '.$form['BG_C']." ] ";
1431
+ $this->mpdf->_out('/MK <<'.$temp.' >>');
1432
+
1433
+ $this->mpdf->_out('/T '.$this->mpdf->_textstring($form['T']) );
1434
+ $this->mpdf->_out('/TU '.$this->mpdf->_textstring($form['TU']) );
1435
+ if ($form['V'] || $form['V']==='0')
1436
+ $this->mpdf->_out('/V '.$this->mpdf->_textstring($form['V']) );
1437
+ $this->mpdf->_out('/DV '.$this->mpdf->_textstring($form['DV']) );
1438
+ $this->mpdf->_out('/DA (/F'.$this->mpdf->fonts[$form['style']['font']]['i'].' '.$form['style']['fontsize'].' Tf '.$form['style']['fontcolor'].')');
1439
+ if ( $form['Q'] ) $this->mpdf->_out('/Q '.$form['Q'].'');
1440
+
1441
+ $this->mpdf->_out('/NM '.$this->mpdf->_textstring(sprintf('%04u-%04u', $n, (5000 + $form['n']))));
1442
+ $this->mpdf->_out('/M '.$this->mpdf->_textstring('D:'.date('YmdHis')));
1443
+
1444
+
1445
+ if ( isset($this->array_form_text_js[$form['T']]) ) {
1446
+ $put_js = 1;
1447
+ $cc = 0;
1448
+ $js_str = '';
1449
+
1450
+ if ( isset($this->array_form_text_js[$form['T']]['F']) ) {
1451
+ $cc++;
1452
+ $js_str .= '/F '.($cc + $this->mpdf->n).' 0 R ';
1453
+ }
1454
+ if ( isset($this->array_form_text_js[$form['T']]['K']) ) {
1455
+ $cc++;
1456
+ $js_str .= '/K '.($cc + $this->mpdf->n).' 0 R ';
1457
+ }
1458
+ if ( isset($this->array_form_text_js[$form['T']]['V']) ) {
1459
+ $cc++;
1460
+ $js_str .= '/V '.($cc + $this->mpdf->n).' 0 R ';
1461
+ }
1462
+ if ( isset($this->array_form_text_js[$form['T']]['C']) ) {
1463
+ $cc++;
1464
+ $js_str .= '/C '.($cc + $this->mpdf->n).' 0 R ';
1465
+ $this->pdf_array_co .= $this->mpdf->n.' 0 R ';
1466
+ }
1467
+ $this->mpdf->_out('/AA << '.$js_str.' >>');
1468
+ }
1469
+
1470
+ $this->mpdf->_out('>>');
1471
+ $this->mpdf->_out('endobj');
1472
+
1473
+ if ( $put_js == 1 ) {
1474
+ if ( isset($this->array_form_text_js[$form['T']]['F']) ) {
1475
+ $this->mpdf->_set_object_javascript( $this->array_form_text_js[$form['T']]['F']['js'] );
1476
+ unset( $this->array_form_text_js[$form['T']]['F'] );
1477
+ }
1478
+ if ( isset($this->array_form_text_js[$form['T']]['K']) ) {
1479
+ $this->mpdf->_set_object_javascript( $this->array_form_text_js[$form['T']]['K']['js'] );
1480
+ unset( $this->array_form_text_js[$form['T']]['K'] );
1481
+ }
1482
+ if ( isset($this->array_form_text_js[$form['T']]['V']) ) {
1483
+ $this->mpdf->_set_object_javascript( $this->array_form_text_js[$form['T']]['V']['js'] );
1484
+ unset( $this->array_form_text_js[$form['T']]['V'] );
1485
+ }
1486
+ if ( isset($this->array_form_text_js[$form['T']]['C']) ) {
1487
+ $this->mpdf->_set_object_javascript( $this->array_form_text_js[$form['T']]['C']['js'] );
1488
+ unset( $this->array_form_text_js[$form['T']]['C'] );
1489
+ }
1490
+ }
1491
+ return $n;
1492
+ }
1493
+
1494
+
1495
+
1496
+ }
1497
+
1498
+ ?>
mPDF/classes/gif.php ADDED
@@ -0,0 +1,700 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
3
+ // 2009-12-22 Adapted for mPDF 4.2
4
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
5
+ // GIF Util - (C) 2003 Yamasoft (S/C)
6
+ // http://www.yamasoft.com
7
+ // All Rights Reserved
8
+ // This file can be freely copied, distributed, modified, updated by anyone under the only
9
+ // condition to leave the original address (Yamasoft, http://www.yamasoft.com) and this header.
10
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
11
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
12
+ // 2009-12-22 Adapted INB
13
+ // Functions calling functionname($x, $len = 0) were not working on PHP5.1.5 as pass by reference
14
+ // All edited to $len = 0; then call function.
15
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
16
+
17
+
18
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
19
+
20
+ class CGIFLZW
21
+ {
22
+ var $MAX_LZW_BITS;
23
+ var $Fresh, $CodeSize, $SetCodeSize, $MaxCode, $MaxCodeSize, $FirstCode, $OldCode;
24
+ var $ClearCode, $EndCode, $Next, $Vals, $Stack, $sp, $Buf, $CurBit, $LastBit, $Done, $LastByte;
25
+
26
+ ///////////////////////////////////////////////////////////////////////////
27
+
28
+ // CONSTRUCTOR
29
+ function CGIFLZW()
30
+ {
31
+ $this->MAX_LZW_BITS = 12;
32
+ unSet($this->Next);
33
+ unSet($this->Vals);
34
+ unSet($this->Stack);
35
+ unSet($this->Buf);
36
+
37
+ $this->Next = range(0, (1 << $this->MAX_LZW_BITS) - 1);
38
+ $this->Vals = range(0, (1 << $this->MAX_LZW_BITS) - 1);
39
+ $this->Stack = range(0, (1 << ($this->MAX_LZW_BITS + 1)) - 1);
40
+ $this->Buf = range(0, 279);
41
+ }
42
+
43
+ ///////////////////////////////////////////////////////////////////////////
44
+
45
+ function deCompress($data, &$datLen)
46
+ {
47
+ $stLen = strlen($data);
48
+ $datLen = 0;
49
+ $ret = "";
50
+ $dp = 0; // data pointer
51
+
52
+ // INITIALIZATION
53
+ $this->LZWCommandInit($data, $dp);
54
+
55
+ while(($iIndex = $this->LZWCommand($data, $dp)) >= 0) {
56
+ $ret .= chr($iIndex);
57
+ }
58
+
59
+ $datLen = $dp;
60
+
61
+ if($iIndex != -2) {
62
+ return false;
63
+ }
64
+
65
+ return $ret;
66
+ }
67
+
68
+ ///////////////////////////////////////////////////////////////////////////
69
+ function LZWCommandInit(&$data, &$dp)
70
+ {
71
+ $this->SetCodeSize = ord($data[0]);
72
+ $dp += 1;
73
+
74
+ $this->CodeSize = $this->SetCodeSize + 1;
75
+ $this->ClearCode = 1 << $this->SetCodeSize;
76
+ $this->EndCode = $this->ClearCode + 1;
77
+ $this->MaxCode = $this->ClearCode + 2;
78
+ $this->MaxCodeSize = $this->ClearCode << 1;
79
+
80
+ $this->GetCodeInit($data, $dp);
81
+
82
+ $this->Fresh = 1;
83
+ for($i = 0; $i < $this->ClearCode; $i++) {
84
+ $this->Next[$i] = 0;
85
+ $this->Vals[$i] = $i;
86
+ }
87
+
88
+ for(; $i < (1 << $this->MAX_LZW_BITS); $i++) {
89
+ $this->Next[$i] = 0;
90
+ $this->Vals[$i] = 0;
91
+ }
92
+
93
+ $this->sp = 0;
94
+ return 1;
95
+ }
96
+
97
+ function LZWCommand(&$data, &$dp)
98
+ {
99
+ if($this->Fresh) {
100
+ $this->Fresh = 0;
101
+ do {
102
+ $this->FirstCode = $this->GetCode($data, $dp);
103
+ $this->OldCode = $this->FirstCode;
104
+ }
105
+ while($this->FirstCode == $this->ClearCode);
106
+
107
+ return $this->FirstCode;
108
+ }
109
+
110
+ if($this->sp > 0) {
111
+ $this->sp--;
112
+ return $this->Stack[$this->sp];
113
+ }
114
+
115
+ while(($Code = $this->GetCode($data, $dp)) >= 0) {
116
+ if($Code == $this->ClearCode) {
117
+ for($i = 0; $i < $this->ClearCode; $i++) {
118
+ $this->Next[$i] = 0;
119
+ $this->Vals[$i] = $i;
120
+ }
121
+
122
+ for(; $i < (1 << $this->MAX_LZW_BITS); $i++) {
123
+ $this->Next[$i] = 0;
124
+ $this->Vals[$i] = 0;
125
+ }
126
+
127
+ $this->CodeSize = $this->SetCodeSize + 1;
128
+ $this->MaxCodeSize = $this->ClearCode << 1;
129
+ $this->MaxCode = $this->ClearCode + 2;
130
+ $this->sp = 0;
131
+ $this->FirstCode = $this->GetCode($data, $dp);
132
+ $this->OldCode = $this->FirstCode;
133
+
134
+ return $this->FirstCode;
135
+ }
136
+
137
+ if($Code == $this->EndCode) {
138
+ return -2;
139
+ }
140
+
141
+ $InCode = $Code;
142
+ if($Code >= $this->MaxCode) {
143
+ $this->Stack[$this->sp++] = $this->FirstCode;
144
+ $Code = $this->OldCode;
145
+ }
146
+
147
+ while($Code >= $this->ClearCode) {
148
+ $this->Stack[$this->sp++] = $this->Vals[$Code];
149
+
150
+ if($Code == $this->Next[$Code]) // Circular table entry, big GIF Error!
151
+ return -1;
152
+
153
+ $Code = $this->Next[$Code];
154
+ }
155
+
156
+ $this->FirstCode = $this->Vals[$Code];
157
+ $this->Stack[$this->sp++] = $this->FirstCode;
158
+
159
+ if(($Code = $this->MaxCode) < (1 << $this->MAX_LZW_BITS)) {
160
+ $this->Next[$Code] = $this->OldCode;
161
+ $this->Vals[$Code] = $this->FirstCode;
162
+ $this->MaxCode++;
163
+
164
+ if(($this->MaxCode >= $this->MaxCodeSize) && ($this->MaxCodeSize < (1 << $this->MAX_LZW_BITS))) {
165
+ $this->MaxCodeSize *= 2;
166
+ $this->CodeSize++;
167
+ }
168
+ }
169
+
170
+ $this->OldCode = $InCode;
171
+ if($this->sp > 0) {
172
+ $this->sp--;
173
+ return $this->Stack[$this->sp];
174
+ }
175
+ }
176
+
177
+ return $Code;
178
+ }
179
+
180
+ ///////////////////////////////////////////////////////////////////////////
181
+
182
+ function GetCodeInit(&$data, &$dp)
183
+ {
184
+ $this->CurBit = 0;
185
+ $this->LastBit = 0;
186
+ $this->Done = 0;
187
+ $this->LastByte = 2;
188
+ return 1;
189
+ }
190
+
191
+ function GetCode(&$data, &$dp)
192
+ {
193
+ if(($this->CurBit + $this->CodeSize) >= $this->LastBit) {
194
+ if($this->Done) {
195
+ if($this->CurBit >= $this->LastBit) {
196
+ // Ran off the end of my bits
197
+ return 0;
198
+ }
199
+ return -1;
200
+ }
201
+
202
+ $this->Buf[0] = $this->Buf[$this->LastByte - 2];
203
+ $this->Buf[1] = $this->Buf[$this->LastByte - 1];
204
+
205
+ $Count = ord($data[$dp]);
206
+ $dp += 1;
207
+
208
+ if($Count) {
209
+ for($i = 0; $i < $Count; $i++) {
210
+ $this->Buf[2 + $i] = ord($data[$dp+$i]);
211
+ }
212
+ $dp += $Count;
213
+ }
214
+ else {
215
+ $this->Done = 1;
216
+ }
217
+
218
+ $this->LastByte = 2 + $Count;
219
+ $this->CurBit = ($this->CurBit - $this->LastBit) + 16;
220
+ $this->LastBit = (2 + $Count) << 3;
221
+ }
222
+
223
+ $iRet = 0;
224
+ for($i = $this->CurBit, $j = 0; $j < $this->CodeSize; $i++, $j++) {
225
+ $iRet |= (($this->Buf[intval($i / 8)] & (1 << ($i % 8))) != 0) << $j;
226
+ }
227
+
228
+ $this->CurBit += $this->CodeSize;
229
+ return $iRet;
230
+ }
231
+ }
232
+
233
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
234
+
235
+ class CGIFCOLORTABLE
236
+ {
237
+ var $m_nColors;
238
+ var $m_arColors;
239
+
240
+ ///////////////////////////////////////////////////////////////////////////
241
+
242
+ // CONSTRUCTOR
243
+ function CGIFCOLORTABLE()
244
+ {
245
+ unSet($this->m_nColors);
246
+ unSet($this->m_arColors);
247
+ }
248
+
249
+ ///////////////////////////////////////////////////////////////////////////
250
+
251
+ function load($lpData, $num)
252
+ {
253
+ $this->m_nColors = 0;
254
+ $this->m_arColors = array();
255
+
256
+ for($i = 0; $i < $num; $i++) {
257
+ $rgb = substr($lpData, $i * 3, 3);
258
+ if(strlen($rgb) < 3) {
259
+ return false;
260
+ }
261
+
262
+ $this->m_arColors[] = (ord($rgb[2]) << 16) + (ord($rgb[1]) << 8) + ord($rgb[0]);
263
+ $this->m_nColors++;
264
+ }
265
+
266
+ return true;
267
+ }
268
+
269
+ ///////////////////////////////////////////////////////////////////////////
270
+
271
+ function toString()
272
+ {
273
+ $ret = "";
274
+
275
+ for($i = 0; $i < $this->m_nColors; $i++) {
276
+ $ret .=
277
+ chr(($this->m_arColors[$i] & 0x000000FF)) . // R
278
+ chr(($this->m_arColors[$i] & 0x0000FF00) >> 8) . // G
279
+ chr(($this->m_arColors[$i] & 0x00FF0000) >> 16); // B
280
+ }
281
+
282
+ return $ret;
283
+ }
284
+
285
+
286
+ ///////////////////////////////////////////////////////////////////////////
287
+
288
+ function colorIndex($rgb)
289
+ {
290
+ $rgb = intval($rgb) & 0xFFFFFF;
291
+ $r1 = ($rgb & 0x0000FF);
292
+ $g1 = ($rgb & 0x00FF00) >> 8;
293
+ $b1 = ($rgb & 0xFF0000) >> 16;
294
+ $idx = -1;
295
+
296
+ for($i = 0; $i < $this->m_nColors; $i++) {
297
+ $r2 = ($this->m_arColors[$i] & 0x000000FF);
298
+ $g2 = ($this->m_arColors[$i] & 0x0000FF00) >> 8;
299
+ $b2 = ($this->m_arColors[$i] & 0x00FF0000) >> 16;
300
+ $d = abs($r2 - $r1) + abs($g2 - $g1) + abs($b2 - $b1);
301
+
302
+ if(($idx == -1) || ($d < $dif)) {
303
+ $idx = $i;
304
+ $dif = $d;
305
+ }
306
+ }
307
+
308
+ return $idx;
309
+ }
310
+ }
311
+
312
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
313
+
314
+ class CGIFFILEHEADER
315
+ {
316
+ var $m_lpVer;
317
+ var $m_nWidth;
318
+ var $m_nHeight;
319
+ var $m_bGlobalClr;
320
+ var $m_nColorRes;
321
+ var $m_bSorted;
322
+ var $m_nTableSize;
323
+ var $m_nBgColor;
324
+ var $m_nPixelRatio;
325
+ var $m_colorTable;
326
+
327
+ ///////////////////////////////////////////////////////////////////////////
328
+
329
+ // CONSTRUCTOR
330
+ function CGIFFILEHEADER()
331
+ {
332
+ unSet($this->m_lpVer);
333
+ unSet($this->m_nWidth);
334
+ unSet($this->m_nHeight);
335
+ unSet($this->m_bGlobalClr);
336
+ unSet($this->m_nColorRes);
337
+ unSet($this->m_bSorted);
338
+ unSet($this->m_nTableSize);
339
+ unSet($this->m_nBgColor);
340
+ unSet($this->m_nPixelRatio);
341
+ unSet($this->m_colorTable);
342
+ }
343
+
344
+ ///////////////////////////////////////////////////////////////////////////
345
+
346
+ function load($lpData, &$hdrLen)
347
+ {
348
+ $hdrLen = 0;
349
+
350
+ $this->m_lpVer = substr($lpData, 0, 6);
351
+ if(($this->m_lpVer <> "GIF87a") && ($this->m_lpVer <> "GIF89a")) {
352
+ return false;
353
+ }
354
+
355
+ $this->m_nWidth = $this->w2i(substr($lpData, 6, 2));
356
+ $this->m_nHeight = $this->w2i(substr($lpData, 8, 2));
357
+ if(!$this->m_nWidth || !$this->m_nHeight) {
358
+ return false;
359
+ }
360
+
361
+ $b = ord(substr($lpData, 10, 1));
362
+ $this->m_bGlobalClr = ($b & 0x80) ? true : false;
363
+ $this->m_nColorRes = ($b & 0x70) >> 4;
364
+ $this->m_bSorted = ($b & 0x08) ? true : false;
365
+ $this->m_nTableSize = 2 << ($b & 0x07);
366
+ $this->m_nBgColor = ord(substr($lpData, 11, 1));
367
+ $this->m_nPixelRatio = ord(substr($lpData, 12, 1));
368
+ $hdrLen = 13;
369
+
370
+ if($this->m_bGlobalClr) {
371
+ $this->m_colorTable = new CGIFCOLORTABLE();
372
+ if(!$this->m_colorTable->load(substr($lpData, $hdrLen), $this->m_nTableSize)) {
373
+ return false;
374
+ }
375
+ $hdrLen += 3 * $this->m_nTableSize;
376
+ }
377
+
378
+ return true;
379
+ }
380
+
381
+ ///////////////////////////////////////////////////////////////////////////
382
+
383
+ function w2i($str)
384
+ {
385
+ return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8);
386
+ }
387
+ }
388
+
389
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
390
+
391
+ class CGIFIMAGEHEADER
392
+ {
393
+ var $m_nLeft;
394
+ var $m_nTop;
395
+ var $m_nWidth;
396
+ var $m_nHeight;
397
+ var $m_bLocalClr;
398
+ var $m_bInterlace;
399
+ var $m_bSorted;
400
+ var $m_nTableSize;
401
+ var $m_colorTable;
402
+
403
+ ///////////////////////////////////////////////////////////////////////////
404
+
405
+ // CONSTRUCTOR
406
+ function CGIFIMAGEHEADER()
407
+ {
408
+ unSet($this->m_nLeft);
409
+ unSet($this->m_nTop);
410
+ unSet($this->m_nWidth);
411
+ unSet($this->m_nHeight);
412
+ unSet($this->m_bLocalClr);
413
+ unSet($this->m_bInterlace);
414
+ unSet($this->m_bSorted);
415
+ unSet($this->m_nTableSize);
416
+ unSet($this->m_colorTable);
417
+ }
418
+
419
+ ///////////////////////////////////////////////////////////////////////////
420
+
421
+ function load($lpData, &$hdrLen)
422
+ {
423
+ $hdrLen = 0;
424
+
425
+ $this->m_nLeft = $this->w2i(substr($lpData, 0, 2));
426
+ $this->m_nTop = $this->w2i(substr($lpData, 2, 2));
427
+ $this->m_nWidth = $this->w2i(substr($lpData, 4, 2));
428
+ $this->m_nHeight = $this->w2i(substr($lpData, 6, 2));
429
+
430
+ if(!$this->m_nWidth || !$this->m_nHeight) {
431
+ return false;
432
+ }
433
+
434
+ $b = ord($lpData{8});
435
+ $this->m_bLocalClr = ($b & 0x80) ? true : false;
436
+ $this->m_bInterlace = ($b & 0x40) ? true : false;
437
+ $this->m_bSorted = ($b & 0x20) ? true : false;
438
+ $this->m_nTableSize = 2 << ($b & 0x07);
439
+ $hdrLen = 9;
440
+
441
+ if($this->m_bLocalClr) {
442
+ $this->m_colorTable = new CGIFCOLORTABLE();
443
+ if(!$this->m_colorTable->load(substr($lpData, $hdrLen), $this->m_nTableSize)) {
444
+ return false;
445
+ }
446
+ $hdrLen += 3 * $this->m_nTableSize;
447
+ }
448
+
449
+ return true;
450
+ }
451
+
452
+ ///////////////////////////////////////////////////////////////////////////
453
+
454
+ function w2i($str)
455
+ {
456
+ return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8);
457
+ }
458
+ }
459
+
460
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
461
+
462
+ class CGIFIMAGE
463
+ {
464
+ var $m_disp;
465
+ var $m_bUser;
466
+ var $m_bTrans;
467
+ var $m_nDelay;
468
+ var $m_nTrans;
469
+ var $m_lpComm;
470
+ var $m_gih;
471
+ var $m_data;
472
+ var $m_lzw;
473
+
474
+ ///////////////////////////////////////////////////////////////////////////
475
+
476
+ function CGIFIMAGE()
477
+ {
478
+ unSet($this->m_disp);
479
+ unSet($this->m_bUser);
480
+ unSet($this->m_bTrans);
481
+ unSet($this->m_nDelay);
482
+ unSet($this->m_nTrans);
483
+ unSet($this->m_lpComm);
484
+ unSet($this->m_data);
485
+ $this->m_gih = new CGIFIMAGEHEADER();
486
+ $this->m_lzw = new CGIFLZW();
487
+ }
488
+
489
+ ///////////////////////////////////////////////////////////////////////////
490
+
491
+ function load($data, &$datLen)
492
+ {
493
+ $datLen = 0;
494
+
495
+ while(true) {
496
+ $b = ord($data[0]);
497
+ $data = substr($data, 1);
498
+ $datLen++;
499
+
500
+ switch($b) {
501
+ case 0x21: // Extension
502
+ $len = 0;
503
+ if(!$this->skipExt($data, $len)) {
504
+ return false;
505
+ }
506
+ $datLen += $len;
507
+ break;
508
+
509
+ case 0x2C: // Image
510
+ // LOAD HEADER & COLOR TABLE
511
+ $len = 0;
512
+ if(!$this->m_gih->load($data, $len)) {
513
+ return false;
514
+ }
515
+ $data = substr($data, $len);
516
+ $datLen += $len;
517
+
518
+ // ALLOC BUFFER
519
+ $len = 0;
520
+
521
+ if(!($this->m_data = $this->m_lzw->deCompress($data, $len))) {
522
+ return false;
523
+ }
524
+
525
+ $data = substr($data, $len);
526
+ $datLen += $len;
527
+
528
+ if($this->m_gih->m_bInterlace) {
529
+ $this->deInterlace();
530
+ }
531
+
532
+ return true;
533
+
534
+ case 0x3B: // EOF
535
+ default:
536
+ return false;
537
+ }
538
+ }
539
+ return false;
540
+ }
541
+
542
+ ///////////////////////////////////////////////////////////////////////////
543
+
544
+ function skipExt(&$data, &$extLen)
545
+ {
546
+ $extLen = 0;
547
+
548
+ $b = ord($data[0]);
549
+ $data = substr($data, 1);
550
+ $extLen++;
551
+
552
+ switch($b) {
553
+ case 0xF9: // Graphic Control
554
+ $b = ord($data[1]);
555
+ $this->m_disp = ($b & 0x1C) >> 2;
556
+ $this->m_bUser = ($b & 0x02) ? true : false;
557
+ $this->m_bTrans = ($b & 0x01) ? true : false;
558
+ $this->m_nDelay = $this->w2i(substr($data, 2, 2));
559
+ $this->m_nTrans = ord($data[4]);
560
+ break;
561
+
562
+ case 0xFE: // Comment
563
+ $this->m_lpComm = substr($data, 1, ord($data[0]));
564
+ break;
565
+
566
+ case 0x01: // Plain text
567
+ break;
568
+
569
+ case 0xFF: // Application
570
+ break;
571
+ }
572
+
573
+ // SKIP DEFAULT AS DEFS MAY CHANGE
574
+ $b = ord($data[0]);
575
+ $data = substr($data, 1);
576
+ $extLen++;
577
+ while($b > 0) {
578
+ $data = substr($data, $b);
579
+ $extLen += $b;
580
+ $b = ord($data[0]);
581
+ $data = substr($data, 1);
582
+ $extLen++;
583
+ }
584
+ return true;
585
+ }
586
+
587
+ ///////////////////////////////////////////////////////////////////////////
588
+
589
+ function w2i($str)
590
+ {
591
+ return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8);
592
+ }
593
+
594
+ ///////////////////////////////////////////////////////////////////////////
595
+
596
+ function deInterlace()
597
+ {
598
+ $data = $this->m_data;
599
+
600
+ for($i = 0; $i < 4; $i++) {
601
+ switch($i) {
602
+ case 0:
603
+ $s = 8;
604
+ $y = 0;
605
+ break;
606
+
607
+ case 1:
608
+ $s = 8;
609
+ $y = 4;
610
+ break;
611
+
612
+ case 2:
613
+ $s = 4;
614
+ $y = 2;
615
+ break;
616
+
617
+ case 3:
618
+ $s = 2;
619
+ $y = 1;
620
+ break;
621
+ }
622
+
623
+ for(; $y < $this->m_gih->m_nHeight; $y += $s) {
624
+ $lne = substr($this->m_data, 0, $this->m_gih->m_nWidth);
625
+ $this->m_data = substr($this->m_data, $this->m_gih->m_nWidth);
626
+
627
+ $data =
628
+ substr($data, 0, $y * $this->m_gih->m_nWidth) .
629
+ $lne .
630
+ substr($data, ($y + 1) * $this->m_gih->m_nWidth);
631
+ }
632
+ }
633
+
634
+ $this->m_data = $data;
635
+ }
636
+ }
637
+
638
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
639
+
640
+ class CGIF
641
+ {
642
+ var $m_gfh;
643
+ var $m_lpData;
644
+ var $m_img;
645
+ var $m_bLoaded;
646
+
647
+ ///////////////////////////////////////////////////////////////////////////
648
+
649
+ // CONSTRUCTOR
650
+ function CGIF()
651
+ {
652
+ $this->m_gfh = new CGIFFILEHEADER();
653
+ $this->m_img = new CGIFIMAGE();
654
+ $this->m_lpData = "";
655
+ $this->m_bLoaded = false;
656
+ }
657
+
658
+ ///////////////////////////////////////////////////////////////////////////
659
+ function ClearData() {
660
+ $this->m_lpData = '';
661
+ unSet($this->m_img->m_data);
662
+ unSet($this->m_img->m_lzw->Next);
663
+ unSet($this->m_img->m_lzw->Vals);
664
+ unSet($this->m_img->m_lzw->Stack);
665
+ unSet($this->m_img->m_lzw->Buf);
666
+ }
667
+
668
+ function loadFile(&$data, $iIndex)
669
+ {
670
+ if($iIndex < 0) {
671
+ return false;
672
+ }
673
+ $this->m_lpData = $data;
674
+
675
+ // GET FILE HEADER
676
+ $len = 0;
677
+ if(!$this->m_gfh->load($this->m_lpData, $len)) {
678
+ return false;
679
+ }
680
+
681
+ $this->m_lpData = substr($this->m_lpData, $len);
682
+
683
+ do {
684
+ $imgLen = 0;
685
+ if(!$this->m_img->load($this->m_lpData, $imgLen)) {
686
+ return false;
687
+ }
688
+ $this->m_lpData = substr($this->m_lpData, $imgLen);
689
+ }
690
+ while($iIndex-- > 0);
691
+
692
+ $this->m_bLoaded = true;
693
+ return true;
694
+ }
695
+
696
+ }
697
+
698
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
699
+
700
+ ?>
mPDF/classes/grad.php ADDED
@@ -0,0 +1,723 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class grad {
4
+
5
+ var $mpdf = null;
6
+
7
+ function grad(&$mpdf) {
8
+ $this->mpdf = $mpdf;
9
+ }
10
+
11
+ // mPDF 5.3.A1
12
+ function CoonsPatchMesh($x, $y, $w, $h, $patch_array=array(), $x_min=0, $x_max=1, $y_min=0, $y_max=1, $colspace='RGB', $return=false){
13
+ $s=' q ';
14
+ $s.=sprintf(' %.3F %.3F %.3F %.3F re W n ', $x*_MPDFK, ($this->mpdf->h-$y)*_MPDFK, $w*_MPDFK, -$h*_MPDFK);
15
+ $s.=sprintf(' %.3F 0 0 %.3F %.3F %.3F cm ', $w*_MPDFK, $h*_MPDFK, $x*_MPDFK, ($this->mpdf->h-($y+$h))*_MPDFK);
16
+ $n = count($this->mpdf->gradients)+1;
17
+ $this->mpdf->gradients[$n]['type'] = 6; //coons patch mesh
18
+ $this->mpdf->gradients[$n]['colorspace'] = $colspace; //coons patch mesh
19
+ $bpcd=65535; //16 BitsPerCoordinate
20
+ $trans = false;
21
+ $this->mpdf->gradients[$n]['stream']='';
22
+ for($i=0;$i<count($patch_array);$i++){
23
+ $this->mpdf->gradients[$n]['stream'].=chr($patch_array[$i]['f']); //start with the edge flag as 8 bit
24
+ for($j=0;$j<count($patch_array[$i]['points']);$j++){
25
+ //each point as 16 bit
26
+ if (($j % 2) == 1) { // Y coordinate (adjusted as input is From top left)
27
+ $patch_array[$i]['points'][$j]=(($patch_array[$i]['points'][$j]-$y_min)/($y_max-$y_min))*$bpcd;
28
+ $patch_array[$i]['points'][$j]=$bpcd-$patch_array[$i]['points'][$j];
29
+ }
30
+ else {
31
+ $patch_array[$i]['points'][$j]=(($patch_array[$i]['points'][$j]-$x_min)/($x_max-$x_min))*$bpcd;
32
+ }
33
+ if($patch_array[$i]['points'][$j]<0) $patch_array[$i]['points'][$j]=0;
34
+ if($patch_array[$i]['points'][$j]>$bpcd) $patch_array[$i]['points'][$j]=$bpcd;
35
+ $this->mpdf->gradients[$n]['stream'].=chr(floor($patch_array[$i]['points'][$j]/256));
36
+ $this->mpdf->gradients[$n]['stream'].=chr(floor($patch_array[$i]['points'][$j]%256));
37
+ }
38
+ for($j=0;$j<count($patch_array[$i]['colors']);$j++){
39
+ //each color component as 8 bit
40
+ if ($colspace=='RGB') {
41
+ $this->mpdf->gradients[$n]['stream'].=($patch_array[$i]['colors'][$j][1]);
42
+ $this->mpdf->gradients[$n]['stream'].=($patch_array[$i]['colors'][$j][2]);
43
+ $this->mpdf->gradients[$n]['stream'].=($patch_array[$i]['colors'][$j][3]);
44
+ if (isset($patch_array[$i]['colors'][$j][4]) && ord($patch_array[$i]['colors'][$j][4])<100) { $trans = true; }
45
+ }
46
+ else if ($colspace=='CMYK') {
47
+ $this->mpdf->gradients[$n]['stream'].=chr(ord($patch_array[$i]['colors'][$j][1])*2.55);
48
+ $this->mpdf->gradients[$n]['stream'].=chr(ord($patch_array[$i]['colors'][$j][2])*2.55);
49
+ $this->mpdf->gradients[$n]['stream'].=chr(ord($patch_array[$i]['colors'][$j][3])*2.55);
50
+ $this->mpdf->gradients[$n]['stream'].=chr(ord($patch_array[$i]['colors'][$j][4])*2.55);
51
+ if (isset($patch_array[$i]['colors'][$j][5]) && ord($patch_array[$i]['colors'][$j][5])<100) { $trans = true; }
52
+ }
53
+ else if ($colspace=='Gray') {
54
+ $this->mpdf->gradients[$n]['stream'].=($patch_array[$i]['colors'][$j][1]);
55
+ if ($patch_array[$i]['colors'][$j][2]==1) { $trans = true; } // transparency converted from rgba or cmyka()
56
+ }
57
+ }
58
+ }
59
+ // TRANSPARENCY
60
+ if ($trans) {
61
+ $this->mpdf->gradients[$n]['stream_trans']='';
62
+ for($i=0;$i<count($patch_array);$i++){
63
+ $this->mpdf->gradients[$n]['stream_trans'].=chr($patch_array[$i]['f']);
64
+ for($j=0;$j<count($patch_array[$i]['points']);$j++){
65
+ //each point as 16 bit
66
+ $this->mpdf->gradients[$n]['stream_trans'].=chr(floor($patch_array[$i]['points'][$j]/256));
67
+ $this->mpdf->gradients[$n]['stream_trans'].=chr(floor($patch_array[$i]['points'][$j]%256));
68
+ }
69
+ for($j=0;$j<count($patch_array[$i]['colors']);$j++){
70
+ //each color component as 8 bit // OPACITY
71
+ if ($colspace=='RGB') {
72
+ $this->mpdf->gradients[$n]['stream_trans'].=chr(intval(ord($patch_array[$i]['colors'][$j][4])*2.55));
73
+ }
74
+ else if ($colspace=='CMYK') {
75
+ $this->mpdf->gradients[$n]['stream_trans'].=chr(intval(ord($patch_array[$i]['colors'][$j][5])*2.55));
76
+ }
77
+ else if ($colspace=='Gray') {
78
+ $this->mpdf->gradients[$n]['stream_trans'].=chr(intval(ord($patch_array[$i]['colors'][$j][3])*2.55));
79
+ }
80
+ }
81
+ }
82
+ $this->mpdf->gradients[$n]['trans'] = true;
83
+ $s .= ' /TGS'.$n.' gs ';
84
+ }
85
+ //paint the gradient
86
+ $s .= '/Sh'.$n.' sh'."\n";
87
+ //restore previous Graphic State
88
+ $s .= 'Q'."\n";
89
+ if ($return) { return $s; }
90
+ else { $this->mpdf->_out($s); }
91
+ }
92
+
93
+
94
+ // type = linear:2; radial: 3;
95
+ // Linear: $coords - array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg).
96
+ // The default value is from left to right (x1=0, y1=0, x2=1, y2=0).
97
+ // Radial: $coords - array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1,
98
+ // (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg).
99
+ // (fx, fy) should be inside the circle, otherwise some areas will not be defined
100
+ // $col = array(R,G,B/255); or array(G/255); or array(C,M,Y,K/100)
101
+ // $stops = array('col'=>$col [, 'opacity'=>0-1] [, 'offset'=>0-1])
102
+ function Gradient($x, $y, $w, $h, $type, $stops=array(), $colorspace='RGB', $coords='', $extend='', $return=false, $is_mask=false) {
103
+ if (strtoupper(substr($type,0,1)) == 'L') { $type = 2; } // linear
104
+ else if (strtoupper(substr($type,0,1)) == 'R') { $type = 3; } // radial
105
+ if ($colorspace != 'CMYK' && $colorspace != 'Gray') {
106
+ $colorspace = 'RGB';
107
+ }
108
+ $bboxw = $w;
109
+ $bboxh = $h;
110
+ $usex = $x;
111
+ $usey = $y;
112
+ $usew = $bboxw;
113
+ $useh = $bboxh;
114
+ if ($type < 1) { $type = 2; }
115
+ if ($coords[0]!==false && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$coords[0],$m)) {
116
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
117
+ if ($tmp) { $coords[0] = $tmp/$w; }
118
+ }
119
+ if ($coords[1]!==false && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$coords[1],$m)) {
120
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
121
+ if ($tmp) { $coords[1] = 1-($tmp/$h); }
122
+ }
123
+ // LINEAR
124
+ if ($type == 2) {
125
+ $angle = $coords[4];
126
+ $repeat = $coords[5];
127
+ // ALL POINTS SET (default for custom mPDF linear gradient) - no -moz
128
+ if ($coords[0]!==false && $coords[1]!==false && $coords[2]!==false && $coords[3]!==false) {
129
+ // do nothing - coords used as they are
130
+ }
131
+
132
+ // If both a <point> and <angle> are defined, the gradient axis starts from the point and runs along the angle. The end point is
133
+ // defined as before - in this case start points may not be in corners, and axis may not correctly fall in the right quadrant.
134
+ // NO end points (Angle defined & Start points)
135
+ else if ($angle!==false && $coords[0]!==false && $coords[1]!==false && $coords[2]===false && $coords[3]===false) {
136
+ if ($angle==0 || $angle==360) { $coords[3]=$coords[1]; if ($coords[0]==1) $coords[2]=2; else $coords[2]=1; }
137
+ else if ($angle==90) { $coords[2]=$coords[0]; $coords[3]=1; if ($coords[1]==1) $coords[3]=2; else $coords[3]=1; }
138
+ else if ($angle==180) { if ($coords[4]==0) $coords[2]=-1; else $coords[2]=0; $coords[3]=$coords[1]; }
139
+ else if ($angle==270) { $coords[2]=$coords[0]; if ($coords[1]==0) $coords[3]=-1; else $coords[3]=0; }
140
+ else {
141
+ $endx=1; $endy=1;
142
+ if ($angle <=90) {
143
+ if ($angle <=45) { $endy=tan(deg2rad($angle)); }
144
+ else { $endx=tan(deg2rad(90-$angle)); }
145
+ $b = atan2(($endy*$bboxh), ($endx*$bboxw));
146
+ $ny = 1 - $coords[1] - (tan($b) * (1-$coords[0]));
147
+ $tx = sin($b) * cos($b) * $ny;
148
+ $ty = cos($b) * cos($b) * $ny;
149
+ $coords[2] = 1+$tx; $coords[3] = 1-$ty;
150
+ }
151
+ else if ($angle <=180) {
152
+ if ($angle <=135) { $endx=tan(deg2rad($angle-90)); }
153
+ else { $endy=tan(deg2rad(180-$angle)); }
154
+ $b = atan2(($endy*$bboxh), ($endx*$bboxw));
155
+ $ny = 1 - $coords[1] - (tan($b) * ($coords[0]));
156
+ $tx = sin($b) * cos($b) * $ny;
157
+ $ty = cos($b) * cos($b) * $ny;
158
+ $coords[2] = -$tx; $coords[3] = 1-$ty;
159
+ }
160
+ else if ($angle <=270) {
161
+ if ($angle <=225) { $endy=tan(deg2rad($angle-180)); }
162
+ else { $endx=tan(deg2rad(270-$angle)); }
163
+ $b = atan2(($endy*$bboxh), ($endx*$bboxw));
164
+ $ny = $coords[1] - (tan($b) * ($coords[0]));
165
+ $tx = sin($b) * cos($b) * $ny;
166
+ $ty = cos($b) * cos($b) * $ny;
167
+ $coords[2] = -$tx; $coords[3] = $ty;
168
+ }
169
+ else {
170
+ if ($angle <=315) { $endx=tan(deg2rad($angle-270)); }
171
+ else { $endy=tan(deg2rad(360-$angle)); }
172
+ $b = atan2(($endy*$bboxh), ($endx*$bboxw));
173
+ $ny = $coords[1] - (tan($b) * (1-$coords[0]));
174
+ $tx = sin($b) * cos($b) * $ny;
175
+ $ty = cos($b) * cos($b) * $ny;
176
+ $coords[2] = 1+$tx; $coords[3] = $ty;
177
+
178
+ }
179
+ }
180
+ }
181
+
182
+ // -moz If the first parameter is only an <angle>, the gradient axis starts from the box's corner that would ensure the
183
+ // axis goes through the box. The axis runs along the specified angle. The end point of the axis is defined such that the
184
+ // farthest corner of the box from the starting point is perpendicular to the gradient axis at that point.
185
+ // NO end points or Start points (Angle defined)
186
+ else if ($angle!==false && $coords[0]===false && $coords[1]===false) {
187
+ if ($angle==0 || $angle==360) { $coords[0]=0; $coords[1]=0; $coords[2]=1; $coords[3]=0; }
188
+ else if ($angle==90) { $coords[0]=0; $coords[1]=0; $coords[2]=0; $coords[3]=1; }
189
+ else if ($angle==180) { $coords[0]=1; $coords[1]=0; $coords[2]=0; $coords[3]=0; }
190
+ else if ($angle==270) { $coords[0]=0; $coords[1]=1; $coords[2]=0; $coords[3]=0; }
191
+ else {
192
+ if ($angle <=90) {
193
+ $coords[0]=0; $coords[1]=0;
194
+ if ($angle <=45) { $endx=1; $endy=tan(deg2rad($angle)); }
195
+ else { $endx=tan(deg2rad(90-$angle)); $endy=1; }
196
+ }
197
+ else if ($angle <=180) {
198
+ $coords[0]=1; $coords[1]=0;
199
+ if ($angle <=135) { $endx=tan(deg2rad($angle-90)); $endy=1; }
200
+ else { $endx=1; $endy=tan(deg2rad(180-$angle)); }
201
+ }
202
+ else if ($angle <=270) {
203
+ $coords[0]=1; $coords[1]=1;
204
+ if ($angle <=225) { $endx=1; $endy=tan(deg2rad($angle-180)); }
205
+ else { $endx=tan(deg2rad(270-$angle)); $endy=1; }
206
+ }
207
+ else {
208
+ $coords[0]=0; $coords[1]=1;
209
+ if ($angle <=315) { $endx=tan(deg2rad($angle-270)); $endy=1; }
210
+ else { $endx=1; $endy=tan(deg2rad(360-$angle)); }
211
+ }
212
+ $b = atan2(($endy*$bboxh), ($endx*$bboxw));
213
+ $h2 = $bboxh - ($bboxh * tan($b));
214
+ $px = $bboxh + ($h2 * sin($b) * cos($b));
215
+ $py = ($bboxh * tan($b)) + ($h2 * sin($b) * sin($b));
216
+ $x1 = $px / $bboxh;
217
+ $y1 = $py / $bboxh;
218
+ if ($angle <=90) { $coords[2] = $x1; $coords[3] = $y1; }
219
+ else if ($angle <=180) { $coords[2] = 1-$x1; $coords[3] = $y1; }
220
+ else if ($angle <=270) { $coords[2] = 1-$x1; $coords[3] = 1-$y1; }
221
+ else { $coords[2] = $x1; $coords[3] = 1-$y1; }
222
+ }
223
+ }
224
+ // -moz If the first parameter to the gradient function is only a <point>, the gradient axis starts from the specified point,
225
+ // and ends at the point you would get if you rotated the starting point by 180 degrees about the center of the box that the
226
+ // gradient is to be applied to.
227
+ // NO angle and NO end points (Start points defined)
228
+ else if ((!isset($angle) || $angle===false) && $coords[0]!==false && $coords[1]!==false) { // should have start and end defined
229
+ $coords[2] = 1-$coords[0]; $coords[3] = 1-$coords[1];
230
+ $angle = rad2deg(atan2($coords[3]-$coords[1],$coords[2]-$coords[0]));
231
+ if ($angle < 0) { $angle += 360; }
232
+ else if ($angle > 360) { $angle -= 360; }
233
+ if ($angle!=0 && $angle!=360 && $angle!=90 && $angle!=180 && $angle!=270) {
234
+ if ($w >= $h) {
235
+ $coords[1] *= $h/$w ;
236
+ $coords[3] *= $h/$w ;
237
+ $usew = $useh = $bboxw;
238
+ $usey -= ($w-$h);
239
+ }
240
+ else {
241
+ $coords[0] *= $w/$h ;
242
+ $coords[2] *= $w/$h ;
243
+ $usew = $useh = $bboxh;
244
+ }
245
+ }
246
+ }
247
+
248
+ // -moz If neither a <point> or <angle> is specified, i.e. the entire function consists of only <stop> values, the gradient
249
+ // axis starts from the top of the box and runs vertically downwards, ending at the bottom of the box.
250
+ else { // default values T2B
251
+ // All values are set in parseMozGradient - so won't appear here
252
+ $coords = array(0,0,1,0); // default for original linear gradient (L2R)
253
+ }
254
+ $s = ' q';
255
+ $s .= sprintf(' %.3F %.3F %.3F %.3F re W n', $x*_MPDFK, ($this->mpdf->h-$y)*_MPDFK, $w*_MPDFK, -$h*_MPDFK)."\n";
256
+ $s .= sprintf(' %.3F 0 0 %.3F %.3F %.3F cm', $usew*_MPDFK, $useh*_MPDFK, $usex*_MPDFK, ($this->mpdf->h-($usey+$useh))*_MPDFK)."\n";
257
+ }
258
+
259
+ // RADIAL
260
+ else if ($type == 3) {
261
+ $radius = $coords[4];
262
+ $angle = $coords[5]; // ?? no effect
263
+ $shape = $coords[6];
264
+ $size = $coords[7];
265
+ $repeat = $coords[8];
266
+ // ALL POINTS AND RADIUS SET (default for custom mPDF radial gradient) - no -moz
267
+ if ($coords[0]!==false && $coords[1]!==false && $coords[2]!==false && $coords[3]!==false && $coords[4]!==false) {
268
+ // do nothing - coords used as they are
269
+ }
270
+ // If a <point> is defined
271
+ else if ($shape!==false && $size!==false) {
272
+ if ($coords[2]==false) { $coords[2] = $coords[0]; }
273
+ if ($coords[3]==false) { $coords[3] = $coords[1]; }
274
+ // ELLIPSE
275
+ if ($shape=='ellipse') {
276
+ $corner1 = sqrt(pow($coords[0],2) + pow($coords[1],2));
277
+ $corner2 = sqrt(pow($coords[0],2) + pow((1-$coords[1]),2));
278
+ $corner3 = sqrt(pow((1-$coords[0]),2) + pow($coords[1],2));
279
+ $corner4 = sqrt(pow((1-$coords[0]),2) + pow((1-$coords[1]),2));
280
+ if ($size=='closest-side') { $radius = min($coords[0], $coords[1], (1-$coords[0]), (1-$coords[1])); }
281
+ else if ($size=='closest-corner') { $radius = min($corner1, $corner2, $corner3, $corner4); }
282
+ else if ($size=='farthest-side') { $radius = max($coords[0], $coords[1], (1-$coords[0]), (1-$coords[1])); }
283
+ else { $radius = max($corner1, $corner2, $corner3, $corner4); } // farthest corner (default)
284
+ }
285
+ // CIRCLE
286
+ else if ($shape=='circle') {
287
+ if ($w >= $h) {
288
+ $coords[1] = $coords[3] = ($coords[1] * $h/$w) ;
289
+ $corner1 = sqrt(pow($coords[0],2) + pow($coords[1],2));
290
+ $corner2 = sqrt(pow($coords[0],2) + pow((($h/$w)-$coords[1]),2));
291
+ $corner3 = sqrt(pow((1-$coords[0]),2) + pow($coords[1],2));
292
+ $corner4 = sqrt(pow((1-$coords[0]),2) + pow((($h/$w)-$coords[1]),2));
293
+ if ($size=='closest-side') { $radius = min($coords[0], $coords[1], (1-$coords[0]), (($h/$w)-$coords[1])); }
294
+ else if ($size=='closest-corner') { $radius = min($corner1, $corner2, $corner3, $corner4); }
295
+ else if ($size=='farthest-side') { $radius = max($coords[0], $coords[1], (1-$coords[0]), (($h/$w)-$coords[1])); }
296
+ else if ($size=='farthest-corner') { $radius = max($corner1, $corner2, $corner3, $corner4); } // farthest corner (default)
297
+ $usew = $useh = $bboxw;
298
+ $usey -= ($w-$h);
299
+ }
300
+ else {
301
+ $coords[0] = $coords[2] = ($coords[0] * $w/$h) ;
302
+ $corner1 = sqrt(pow($coords[0],2) + pow($coords[1],2));
303
+ $corner2 = sqrt(pow($coords[0],2) + pow((1-$coords[1]),2));
304
+ $corner3 = sqrt(pow((($w/$h)-$coords[0]),2) + pow($coords[1],2));
305
+ $corner4 = sqrt(pow((($w/$h)-$coords[0]),2) + pow((1-$coords[1]),2));
306
+ if ($size=='closest-side') { $radius = min($coords[0], $coords[1], (($w/$h)-$coords[0]), (1-$coords[1])); }
307
+ else if ($size=='closest-corner') { $radius = min($corner1, $corner2, $corner3, $corner4); }
308
+ else if ($size=='farthest-side') { $radius = max($coords[0], $coords[1], (($w/$h)-$coords[0]), (1-$coords[1])); }
309
+ else if ($size=='farthest-corner') { $radius = max($corner1, $corner2, $corner3, $corner4); } // farthest corner (default)
310
+ $usew = $useh = $bboxh;
311
+ }
312
+ }
313
+ if ($radius==0) { $radius=0.001; } // to prevent error
314
+ $coords[4] = $radius;
315
+ }
316
+
317
+ // -moz If entire function consists of only <stop> values
318
+ else { // default values
319
+ // All values are set in parseMozGradient - so won't appear here
320
+ $coords = array(0.5,0.5,0.5,0.5); // default for radial gradient (centred)
321
+ }
322
+ $s = ' q';
323
+ $s .= sprintf(' %.3F %.3F %.3F %.3F re W n', $x*_MPDFK, ($this->mpdf->h-$y)*_MPDFK, $w*_MPDFK, -$h*_MPDFK)."\n";
324
+ $s .= sprintf(' %.3F 0 0 %.3F %.3F %.3F cm', $usew*_MPDFK, $useh*_MPDFK, $usex*_MPDFK, ($this->mpdf->h-($usey+$useh))*_MPDFK)."\n";
325
+ }
326
+
327
+ $n = count($this->mpdf->gradients) + 1;
328
+ $this->mpdf->gradients[$n]['type'] = $type;
329
+ $this->mpdf->gradients[$n]['colorspace'] = $colorspace;
330
+ $trans = false;
331
+ $this->mpdf->gradients[$n]['is_mask'] = $is_mask;
332
+ if ($is_mask) { $trans = true; }
333
+ if (count($stops) == 1) { $stops[1] = $stops[0]; }
334
+ if (!isset($stops[0]['offset'])) { $stops[0]['offset'] = 0; }
335
+ if (!isset($stops[(count($stops)-1)]['offset'])) { $stops[(count($stops)-1)]['offset'] = 1; }
336
+
337
+ // Fix stop-offsets set as absolute lengths
338
+ if ($type==2) {
339
+ $axisx = ($coords[2]-$coords[0])*$usew;
340
+ $axisy = ($coords[3]-$coords[1])*$useh;
341
+ $axis_length = sqrt(pow($axisx,2) + pow($axisy,2));
342
+ }
343
+ else { $axis_length = $coords[4]*$usew; } // Absolute lengths are meaningless for an ellipse - Firefox uses Width as reference
344
+
345
+ for($i=0;$i<count($stops);$i++) {
346
+ if (isset($stops[$i]['offset']) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$stops[$i]['offset'],$m)) {
347
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
348
+ $stops[$i]['offset'] = $tmp/$axis_length;
349
+ }
350
+ }
351
+
352
+
353
+ if (isset($stops[0]['offset']) && $stops[0]['offset']>0) {
354
+ $firststop = $stops[0];
355
+ $firststop['offset'] = 0;
356
+ array_unshift($stops, $firststop);
357
+ }
358
+ if (!$repeat && isset($stops[(count($stops)-1)]['offset']) && $stops[(count($stops)-1)]['offset']<1) {
359
+ $endstop = $stops[(count($stops)-1)];
360
+ $endstop['offset'] = 1;
361
+ $stops[] = $endstop;
362
+ }
363
+ if ($stops[0]['offset'] > $stops[(count($stops)-1)]['offset']) {
364
+ $stops[0]['offset'] = 0;
365
+ $stops[(count($stops)-1)]['offset'] = 1;
366
+ }
367
+
368
+ for($i=0;$i<count($stops);$i++) {
369
+ // mPDF 5.3.74
370
+ if ($colorspace == 'CMYK') {
371
+ $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F %.3F', (ord($stops[$i]['col']{1})/100), (ord($stops[$i]['col']{2})/100), (ord($stops[$i]['col']{3})/100), (ord($stops[$i]['col']{4})/100));
372
+ }
373
+ else if ($colorspace == 'Gray') {
374
+ $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F', (ord($stops[$i]['col']{1})/255));
375
+ }
376
+ else {
377
+ $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F', (ord($stops[$i]['col']{1})/255), (ord($stops[$i]['col']{2})/255), (ord($stops[$i]['col']{3})/255));
378
+ }
379
+ if (!isset($stops[$i]['opacity'])) { $stops[$i]['opacity'] = 1; }
380
+ else if ($stops[$i]['opacity'] > 1 || $stops[$i]['opacity'] < 0) { $stops[$i]['opacity'] = 1; }
381
+ else if ($stops[$i]['opacity'] < 1) {
382
+ $trans = true;
383
+ }
384
+ $this->mpdf->gradients[$n]['stops'][$i]['opacity'] = $stops[$i]['opacity'];
385
+ // OFFSET
386
+ if ($i>0 && $i<(count($stops)-1)) {
387
+ if (!isset($stops[$i]['offset']) || (isset($stops[$i+1]['offset']) && $stops[$i]['offset']>$stops[$i+1]['offset']) || $stops[$i]['offset']<$stops[$i-1]['offset']) {
388
+ if (isset($stops[$i-1]['offset']) && isset($stops[$i+1]['offset'])) {
389
+ $stops[$i]['offset'] = ($stops[$i-1]['offset']+$stops[$i+1]['offset'])/2;
390
+ }
391
+ else {
392
+ for($j=($i+1);$j<count($stops);$j++) {
393
+ if(isset($stops[$j]['offset'])) { break; }
394
+ }
395
+ $int = ($stops[$j]['offset'] - $stops[($i-1)]['offset'])/($j-$i+1);
396
+ for($f=0;$f<($j-$i-1);$f++) {
397
+ $stops[($i+$f)]['offset'] = $stops[($i+$f-1)]['offset'] + ($int);
398
+ }
399
+ }
400
+ }
401
+ }
402
+ $this->mpdf->gradients[$n]['stops'][$i]['offset'] = $stops[$i]['offset'];
403
+ $this->mpdf->gradients[$n]['stops'][$i]['offset'] = $stops[$i]['offset'];
404
+ }
405
+
406
+ if ($repeat) {
407
+ $ns = count($this->mpdf->gradients[$n]['stops']);
408
+ $offs = array();
409
+ for($i=0;$i<$ns;$i++) {
410
+ $offs[$i] = $this->mpdf->gradients[$n]['stops'][$i]['offset'];
411
+ }
412
+ $gp = 0;
413
+ $inside=true;
414
+ while($inside) {
415
+ $gp++;
416
+ for($i=0;$i<$ns;$i++) {
417
+ $this->mpdf->gradients[$n]['stops'][(($ns*$gp)+$i)] = $this->mpdf->gradients[$n]['stops'][(($ns*($gp-1))+$i)];
418
+ $tmp = $this->mpdf->gradients[$n]['stops'][(($ns*($gp-1))+($ns-1))]['offset']+$offs[$i] ;
419
+ if ($tmp < 1) { $this->mpdf->gradients[$n]['stops'][(($ns*$gp)+$i)]['offset'] = $tmp; }
420
+ else {
421
+ $this->mpdf->gradients[$n]['stops'][(($ns*$gp)+$i)]['offset'] = 1;
422
+ $inside = false;
423
+ break(2);
424
+ }
425
+ }
426
+ }
427
+ }
428
+
429
+ if ($trans) {
430
+ $this->mpdf->gradients[$n]['trans'] = true;
431
+ $s .= ' /TGS'.$n.' gs ';
432
+ }
433
+ if (!is_array($extend) || count($extend) <1) {
434
+ $extend=array('true', 'true'); // These are supposed to be quoted - appear in PDF file as text
435
+ }
436
+ $this->mpdf->gradients[$n]['coords'] = $coords;
437
+ $this->mpdf->gradients[$n]['extend'] = $extend;
438
+ //paint the gradient
439
+ $s .= '/Sh'.$n.' sh '."\n";
440
+ //restore previous Graphic State
441
+ $s .= ' Q '."\n";
442
+ if ($return) { return $s; }
443
+ else { $this->mpdf->_out($s); }
444
+ }
445
+
446
+
447
+ function parseMozGradient($bg) {
448
+ // background[-image]: -moz-linear-gradient(left, #c7Fdde 20%, #FF0000 );
449
+ // background[-image]: linear-gradient(left, #c7Fdde 20%, #FF0000 ); // CSS3
450
+ if (preg_match('/repeating-/',$bg)) { $repeat = true; }
451
+ else { $repeat = false; }
452
+ if (preg_match('/linear-gradient\((.*)\)/',$bg,$m)) {
453
+ $g = array();
454
+ $g['type'] = 2;
455
+ $g['colorspace'] = 'RGB';
456
+ $g['extend'] = array('true','true');
457
+ $v = trim($m[1]);
458
+ // Change commas inside e.g. rgb(x,x,x)
459
+ while(preg_match('/(\([^\)]*?),/',$v)) { $v = preg_replace('/(\([^\)]*?),/','\\1@',$v); }
460
+ // Remove spaces inside e.g. rgb(x, x, x)
461
+ while(preg_match('/(\([^\)]*?)[ ]/',$v)) { $v = preg_replace('/(\([^\)]*?)[ ]/','\\1',$v); }
462
+ $bgr = preg_split('/\s*,\s*/',$v);
463
+ for($i=0;$i<count($bgr);$i++) { $bgr[$i] = preg_replace('/@/', ',', $bgr[$i]); }
464
+ // Is first part $bgr[0] a valid point/angle?
465
+ $first = preg_split('/\s+/',trim($bgr[0]));
466
+ if (preg_match('/(left|center|right|bottom|top|deg|grad|rad)/i',$bgr[0]) && !preg_match('/(<#|rgb|rgba|hsl|hsla)/i',$bgr[0])) {
467
+ $startStops = 1;
468
+ }
469
+ else if (trim($first[(count($first)-1)]) === "0") {
470
+ $startStops = 1;
471
+ }
472
+ else {
473
+ $check = $this->mpdf->ConvertColor($first[0]);
474
+ if ($check) $startStops = 0;
475
+ else $startStops = 1;
476
+ }
477
+ // first part a valid point/angle?
478
+ if ($startStops == 1) { // default values
479
+ // [<point> || <angle>,] = [<% em px left center right bottom top> || <deg grad rad 0>,]
480
+ if (preg_match('/([\-]*[0-9\.]+)(deg|grad|rad)/i',$bgr[0],$m)) {
481
+ $angle = $m[1] + 0;
482
+ if (strtolower($m[2])=='deg') { $angle = $angle; }
483
+ else if (strtolower($m[2])=='grad') { $angle *= (360/400); }
484
+ else if (strtolower($m[2])=='rad') { $angle = rad2deg($angle); }
485
+ while($angle < 0) { $angle += 360; }
486
+ $angle = ($angle % 360);
487
+ }
488
+ else if (trim($first[(count($first)-1)]) === "0") { $angle = 0; }
489
+ if (preg_match('/left/i',$bgr[0])) { $startx = 0; }
490
+ else if (preg_match('/right/i',$bgr[0])) { $startx = 1; }
491
+ if (preg_match('/top/i',$bgr[0])) { $starty = 1; }
492
+ else if (preg_match('/bottom/i',$bgr[0])) { $starty = 0; }
493
+ // Check for %? ?% or %%
494
+ if (preg_match('/(\d+)[%]/i',$first[0],$m)) { $startx = $m[1]/100; }
495
+ else if (!isset($startx) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$first[0],$m)) {
496
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
497
+ if ($tmp) { $startx = $m[1]; }
498
+ }
499
+ if (isset($first[1]) && preg_match('/(\d+)[%]/i',$first[1],$m)) { $starty = 1 - ($m[1]/100); }
500
+ else if (!isset($starty) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$first[1],$m)) {
501
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
502
+ if ($tmp) { $starty = $m[1]; }
503
+ }
504
+ if (isset($startx) && !isset($starty)) { $starty = 0.5; }
505
+ if (!isset($startx) && isset($starty)) { $startx = 0.5; }
506
+
507
+ }
508
+ // If neither a <point> or <angle> is specified, i.e. the entire function consists of only <stop> values, the gradient axis starts from the top of the box and runs vertically downwards, ending at the bottom of the box.
509
+ else { // default values T2B
510
+ $starty = 1; $startx = 0.5;
511
+ $endy = 0; $endx = 0.5;
512
+ }
513
+ $coords = array();
514
+ if (!isset($startx)) { $startx = false; }
515
+ if (!isset($starty)) { $starty = false; }
516
+ if (!isset($endx)) { $endx = false; }
517
+ if (!isset($endy)) { $endy = false; }
518
+ if (!isset($angle)) { $angle = false; }
519
+ $g['coords'] = array($startx ,$starty ,$endx ,$endy, $angle, $repeat );
520
+ $g['stops'] = array();
521
+ for($i=$startStops;$i<count($bgr);$i++) {
522
+ $stop = array();
523
+ // parse stops
524
+ $el = preg_split('/\s+/',trim($bgr[$i]));
525
+ // mPDF 5.3.74
526
+ $col = $this->mpdf->ConvertColor($el[0]);
527
+ if ($col) { $stop['col'] = $col; }
528
+ else { $stop['col'] = $col = $this->mpdf->ConvertColor(255); }
529
+ if ($col{0}==1) $g['colorspace'] = 'Gray';
530
+ else if ($col{0}==4 || $col{0}==6) $g['colorspace'] = 'CMYK';
531
+ if ($col{0}==5) { $stop['opacity'] = ord($col{4})/100; } // transparency from rgba()
532
+ else if ($col{0}==6) { $stop['opacity'] = ord($col{5})/100; } // transparency from cmyka()
533
+ else if ($col{0}==1 && $col{2}==1) { $stop['opacity'] = ord($col{3})/100; } // transparency converted from rgba or cmyka()
534
+
535
+ if (isset($el[1]) && preg_match('/(\d+)[%]/',$el[1],$m)) {
536
+ $stop['offset'] = $m[1]/100;
537
+ if ($stop['offset']>1) { unset($stop['offset']); }
538
+ }
539
+ else if (isset($el[1]) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$el[1],$m)) {
540
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
541
+ if ($tmp) { $stop['offset'] = $m[1]; }
542
+ }
543
+ $g['stops'][] = $stop;
544
+ }
545
+ if (count($g['stops'] )) { return $g; }
546
+ }
547
+ else if (preg_match('/radial-gradient\((.*)\)/',$bg,$m)) {
548
+ $g = array();
549
+ $g['type'] = 3;
550
+ $g['colorspace'] = 'RGB';
551
+ $g['extend'] = array('true','true');
552
+ $v = trim($m[1]);
553
+ // Change commas inside e.g. rgb(x,x,x)
554
+ while(preg_match('/(\([^\)]*?),/',$v)) { $v = preg_replace('/(\([^\)]*?),/','\\1@',$v); }
555
+ // Remove spaces inside e.g. rgb(x, x, x)
556
+ while(preg_match('/(\([^\)]*?)[ ]/',$v)) { $v = preg_replace('/(\([^\)]*?)[ ]/','\\1',$v); }
557
+ $bgr = preg_split('/\s*,\s*/',$v);
558
+ for($i=0;$i<count($bgr);$i++) { $bgr[$i] = preg_replace('/@/', ',', $bgr[$i]); }
559
+
560
+ // Is first part $bgr[0] a valid point/angle?
561
+ $startStops = 0;
562
+ $pos_angle = false;
563
+ $shape_size = false;
564
+ $first = preg_split('/\s+/',trim($bgr[0]));
565
+ $checkCol = $this->mpdf->ConvertColor($first[0]);
566
+ if (preg_match('/(left|center|right|bottom|top|deg|grad|rad)/i',$bgr[0]) && !preg_match('/(<#|rgb|rgba|hsl|hsla)/i',$bgr[0])) {
567
+ $startStops=1;
568
+ $pos_angle = $bgr[0];
569
+ }
570
+ else if (trim($first[(count($first)-1)]) === "0") {
571
+ $startStops=1;
572
+ $pos_angle = $bgr[0];
573
+ }
574
+ else if (preg_match('/(circle|ellipse|closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/i',$bgr[0])) {
575
+ $startStops=1;
576
+ $shape_size = $bgr[0];
577
+ }
578
+ else if (!$checkCol) {
579
+ $startStops=1;
580
+ $pos_angle = $bgr[0];
581
+ }
582
+ if (preg_match('/(circle|ellipse|closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/i',$bgr[1])) {
583
+ $startStops=2;
584
+ $shape_size = $bgr[1];
585
+ }
586
+
587
+ // If valid point/angle?
588
+ if ($pos_angle) { // default values
589
+ // [<point> || <angle>,] = [<% em px left center right bottom top> || <deg grad rad 0>,]
590
+ if (preg_match('/left/i',$pos_angle)) { $startx = 0; }
591
+ else if (preg_match('/right/i',$pos_angle)) { $startx = 1; }
592
+ if (preg_match('/top/i',$pos_angle)) { $starty = 1; }
593
+ else if (preg_match('/bottom/i',$pos_angle)) { $starty = 0; }
594
+ // Check for %? ?% or %%
595
+ if (preg_match('/(\d+)[%]/i',$first[0],$m)) { $startx = $m[1]/100; }
596
+ else if (!isset($startx) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$first[0],$m)) {
597
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
598
+ if ($tmp) { $startx = $m[1]; }
599
+ }
600
+ if (isset($first[1]) && preg_match('/(\d+)[%]/i',$first[1],$m)) { $starty = 1 - ($m[1]/100); }
601
+ else if (!isset($starty) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$first[1],$m)) {
602
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
603
+ if ($tmp) { $starty = $m[1]; }
604
+ }
605
+
606
+ /*
607
+ // ?? Angle has no effect in radial gradient (does not exist in CSS3 spec.)
608
+ if (preg_match('/([\-]*[0-9\.]+)(deg|grad|rad)/i',$pos_angle,$m)) {
609
+ $angle = $m[1] + 0;
610
+ if (strtolower($m[2])=='deg') { $angle = $angle; }
611
+ else if (strtolower($m[2])=='grad') { $angle *= (360/400); }
612
+ else if (strtolower($m[2])=='rad') { $angle = rad2deg($angle); }
613
+ while($angle < 0) { $angle += 360; }
614
+ $angle = ($angle % 360);
615
+ }
616
+ */
617
+ if (!isset($starty)) { $starty = 0.5; }
618
+ if (!isset($startx)) { $startx = 0.5; }
619
+
620
+ }
621
+ // If neither a <point> or <angle> is specified, i.e. the entire function consists of only <stop> values, the gradient axis starts from the top of the box and runs vertically downwards, ending at the bottom of the box.
622
+ else { // default values Center
623
+ $starty = 0.5; $startx = 0.5;
624
+ $endy = 0.5; $endx = 0.5;
625
+ }
626
+
627
+ // If valid shape/size?
628
+ $shape = 'ellipse'; // default
629
+ $size = 'farthest-corner'; // default
630
+ if ($shape_size) { // default values
631
+ if (preg_match('/(circle|ellipse)/i',$shape_size, $m)) {
632
+ $shape = $m[1];
633
+ }
634
+ if (preg_match('/(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/i',$shape_size, $m)) {
635
+ $size = $m[1];
636
+ if ($size=='contain') { $size = 'closest-side'; }
637
+ else if ($size=='cover') { $size = 'farthest-corner'; }
638
+ }
639
+ }
640
+
641
+ $coords = array();
642
+ if (!isset($startx)) { $startx = false; }
643
+ if (!isset($starty)) { $starty = false; }
644
+ if (!isset($endx)) { $endx = false; }
645
+ if (!isset($endy)) { $endy = false; }
646
+ if (!isset($radius)) { $radius = false; }
647
+ if (!isset($angle)) { $angle = 0; }
648
+ $g['coords'] = array($startx ,$starty ,$endx ,$endy, $radius, $angle, $shape, $size, $repeat );
649
+
650
+ $g['stops'] = array();
651
+ for($i=$startStops;$i<count($bgr);$i++) {
652
+ $stop = array();
653
+ // parse stops
654
+ $el = preg_split('/\s+/',trim($bgr[$i]));
655
+ // mPDF 5.3.74
656
+ $col = $this->mpdf->ConvertColor($el[0]);
657
+ if ($col) { $stop['col'] = $col; }
658
+ else { $stop['col'] = $col = $this->mpdf->ConvertColor(255); }
659
+ if ($col{0}==1) $g['colorspace'] = 'Gray';
660
+ else if ($col{0}==4 || $col{0}==6) $g['colorspace'] = 'CMYK';
661
+ if ($col{0}==5) { $stop['opacity'] = ord($col{4})/100; } // transparency from rgba()
662
+ else if ($col{0}==6) { $stop['opacity'] = ord($col{5})/100; } // transparency from cmyka()
663
+ else if ($col{0}==1 && $col{2}==1) { $stop['opacity'] = ord($col{3})/100; } // transparency converted from rgba or cmyka()
664
+
665
+ if (isset($el[1]) && preg_match('/(\d+)[%]/',$el[1],$m)) {
666
+ $stop['offset'] = $m[1]/100;
667
+ if ($stop['offset']>1) { unset($stop['offset']); }
668
+ }
669
+ else if (isset($el[1]) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i',$el[1],$m)) {
670
+ $tmp = $this->mpdf->ConvertSize($m[1],$this->mpdf->w,$this->mpdf->FontSize,false);
671
+ $stop['offset'] = $el[1];
672
+ }
673
+ $g['stops'][] = $stop;
674
+ }
675
+ if (count($g['stops'] )) { return $g; }
676
+ }
677
+ return array();
678
+ }
679
+
680
+ function parseBackgroundGradient($bg) {
681
+ // background-gradient: linear #00FFFF #FFFF00 0 0.5 1 0.5; or
682
+ // background-gradient: radial #00FFFF #FFFF00 0.5 0.5 1 1 1.2;
683
+
684
+ $v = trim($bg);
685
+ $bgr = preg_split('/\s+/',$v);
686
+ $g = array();
687
+ if (count($bgr)> 6) {
688
+ if (strtoupper(substr($bgr[0],0,1)) == 'L' && count($bgr)==7) { // linear
689
+ $g['type'] = 2;
690
+ //$coords = array(0,0,1,1 ); // 0 0 1 0 or 0 1 1 1 is L 2 R; 1,1,0,1 is R2L; 1,1,1,0 is T2B; 1,0,1,1 is B2T
691
+ // Linear: $coords - array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg).
692
+ // The default value is from left to right (x1=0, y1=0, x2=1, y2=0).
693
+ $g['coords'] = array($bgr[3], $bgr[4], $bgr[5], $bgr[6]);
694
+ }
695
+ else if (count($bgr)==8) { // radial
696
+ $g['type'] = 3;
697
+ // Radial: $coords - array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1,
698
+ // (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg).
699
+ // (fx, fy) should be inside the circle, otherwise some areas will not be defined
700
+ $g['coords'] = array($bgr[3], $bgr[4], $bgr[5], $bgr[6], $bgr[7]);
701
+ }
702
+ $g['colorspace'] = 'RGB';
703
+ // mPDF 5.3.74
704
+ $cor = $this->mpdf->ConvertColor($bgr[1]);
705
+ if ($cor{0}==1) $g['colorspace'] = 'Gray';
706
+ else if ($cor{0}==4 || $cor{0}==6) $g['colorspace'] = 'CMYK';
707
+ if ($cor) { $g['col'] = $cor; }
708
+ else { $g['col'] = $this->mpdf->ConvertColor(255); }
709
+ $cor = $this->mpdf->ConvertColor($bgr[2]);
710
+ if ($cor) { $g['col2'] = $cor; }
711
+ else { $g['col2'] = $this->mpdf->ConvertColor(255); }
712
+ $g['extend'] = array('true','true');
713
+ $g['stops'] = array(array('col'=>$g['col'], 'opacity'=>1, 'offset'=>0), array('col'=>$g['col2'], 'opacity'=>1, 'offset'=>1));
714
+ return $g;
715
+ }
716
+ return false;
717
+ }
718
+
719
+
720
+
721
+ }
722
+
723
+ ?>
mPDF/classes/indic.php ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class indic {
4
+
5
+ function indic() {
6
+
7
+ }
8
+
9
+
10
+ function substituteIndic($earr, $lang, $font) {
11
+ global $voltdata;
12
+
13
+ if (!isset($voltdata[$font])) {
14
+ include_once(_MPDF_PATH.'includes/'.$font.'.volt.php');
15
+ $voltdata[$font] = $volt;
16
+ }
17
+
18
+ foreach($earr as $eid=>$char) {
19
+ $earr[$eid] = sprintf("%04s", strtoupper(dechex($char)));
20
+ }
21
+ $vstr = "0020 ".implode(" ",$earr)." 0020";
22
+ //============================
23
+ // Common Indic Punctuation marks
24
+ // If NOT devanagari
25
+ if ($lang!='hi') {
26
+ $vstr = str_replace('0964','007C', $vstr); // U+0964 replace with "|"
27
+ $vstr = str_replace('0965','007C 007C', $vstr); // U+0964 replace with "|"
28
+ }
29
+ //============================
30
+ // Tamil numeral for Zero missing Added mPDF 4.2
31
+ if ($lang=='ta') {
32
+ $vstr = str_replace('0BE6','0030', $vstr); // U+0BEB replace with "0"
33
+ }
34
+
35
+ //============================
36
+ // Re-order vowels
37
+
38
+ // DEVANAGARI vowel sign matraI[093F] before consonant
39
+ if ($lang=='hi') {
40
+ $prebasedvowels = "(093F)";
41
+ $nukta = "093C";
42
+ $halant = "094D";
43
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.'/','\\2 \\1', $vstr); // vowel sign pre-based shift left
44
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.' '.$nukta.'/','\\2 \\1 '.$nukta, $vstr); // before NUKTA
45
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$prebasedvowels.'/','\\2 \\1 '.$halant, $vstr); // before CHAR HALANT == VIRAMA
46
+ }
47
+
48
+ // BENGALI vowels [09BF 09C7 09C8]
49
+ else if ($lang=='bn') {
50
+
51
+ // Khanda Ta 09CE not in font -> replace with 09A4|09CD
52
+ $vstr = preg_replace('/09CE/','09A4 09CD 200D', $vstr); // mPDF 5.3.09
53
+
54
+ // BENGALI double-part vowels [09CB 09C7 09BE][09CC 09C7 09D7]
55
+ $vstr = str_replace('09CB','09C7 09BE', $vstr); // convert to 2 parts
56
+ $vstr = str_replace('09CC','09C7 09D7', $vstr); // 09C7 pre-based is then shifted below
57
+ $prebasedvowels = "(09BF|09C7|09C8)";
58
+ $nukta = "09BC";
59
+ $halant = "09CD";
60
+ // mPDF 5.0.044
61
+ $bnfullcons = "0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF";
62
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.'/','\\2 \\1', $vstr); // vowel sign pre-based shift left
63
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.' '.$nukta.'/','\\2 \\1 '.$nukta, $vstr); // before NUKTA
64
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$prebasedvowels.'/','\\2 \\1 '.$halant, $vstr); // before CHAR HALANT
65
+ // mPDF 5.0.044
66
+ // .. and shifting left-based vowel further to the left in case 3 consonants together.
67
+ $vstr = preg_replace('/('.$bnfullcons.') '.$halant.' '.$prebasedvowels.'/','\\2 \\1 '.$halant, $vstr);
68
+
69
+ // mPDF 5.0.044
70
+ // If left-based vowel has now been shifted to left of RA/Halant (09B0/09CD)
71
+ // Convert here to above-line form (E068) as it would get missed later
72
+ // e.g. 09B0 09CD 09AD 09C7 would be changed above =>
73
+ // e.g. 09C7 09B0 09CD 09AD. The 09B0 09CD should => E068
74
+ // ??? need to add 09BF as well (09BF|09C7|09C8)
75
+ $vstr = preg_replace('/(09C7|09C8) 09B0 09CD/', '\\1 E068', $vstr);
76
+
77
+ }
78
+
79
+ // GUJARATI pre-based vowel [0ABF]
80
+ else if ($lang=='gu') {
81
+ $prebasedvowels = "(0ABF)";
82
+ $nukta = "0ABC";
83
+ $halant = "0ACD";
84
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.'/','\\2 \\1', $vstr); // vowel sign pre-based shift left
85
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.' '.$nukta.'/','\\2 \\1 '.$nukta, $vstr); // before NUKTA
86
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$prebasedvowels.'/','\\2 \\1 '.$halant, $vstr); // before CHAR HALANT
87
+ }
88
+
89
+ // GURMUKHI/PUNJABI pre-based vowel [0ABF]
90
+ else if ($lang=='pa') {
91
+ $prebasedvowels = "(0A3F)";
92
+ $nukta = "0A3C";
93
+ $halant = "0A4D";
94
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.'/','\\2 \\1', $vstr); // vowel sign pre-based shift left
95
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.' '.$nukta.'/','\\2 \\1 '.$nukta, $vstr); // before NUKTA
96
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$prebasedvowels.'/','\\2 \\1 '.$halant, $vstr); // before CHAR HALANT
97
+ }
98
+
99
+ // TAMIL pre-based vowel [0ABF]
100
+ else if ($lang=='ta') {
101
+ // Shrii (Shree)
102
+ $vstr = preg_replace('/0BB6 0BCD 0BB0 0BC0/','E04B', $vstr);
103
+
104
+ // TAMIL double-part vowels [0BCA 0BC6 0BBE][0BCB 0BC7 0BBE][0BCC 0BC6 0BD7]
105
+ $vstr = preg_replace('/0BCA/','0BC6 0BBE', $vstr); // convert to 2 parts
106
+ $vstr = preg_replace('/0BCB/','0BC7 0BBE', $vstr); // pre-based is then shifted below
107
+ $vstr = preg_replace('/0BCC/','0BC6 0BD7', $vstr);
108
+ $prebasedvowels = "(0BC6|0BC7|0BC8)";
109
+ // No nukta
110
+ $halant = "0BCD"; // Doesn't seem to move most in front of halanted consonants
111
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$prebasedvowels.'/','\\2 \\1', $vstr); // vowel sign pre-based shift left
112
+ // ? Only for special case KSS (already moved to left of 0BB7)
113
+ $vstr = preg_replace('/0B95 '.$halant.' '.$prebasedvowels.' 0BB7/','\\1 0B95 '.$halant.' 0BB7', $vstr);
114
+ }
115
+
116
+ // ORIYA
117
+ else if ($lang=='or') {
118
+ // ORIYA double-part vowels []
119
+ $vstr = str_replace('0B48','0B47 0B56', $vstr); // 2-part Vowel
120
+ $vstr = str_replace('0B4B','0B47 0B3E', $vstr); // 2-part Vowel
121
+ $vstr = str_replace('0B4C','0B47 0B57', $vstr); // 2-part Vowel
122
+ $orprebasedvowels = "(0B47)";
123
+ // No nukta
124
+ $halant = "0B4D";
125
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$orprebasedvowels.'/','\\2 \\1', $vstr); // vowel sign pre-based shift left
126
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$orprebasedvowels.'/','\\2 \\1 '.$halant, $vstr); // before CHAR HALANT
127
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$orprebasedvowels.'/','\\2 \\1 '.$halant, $vstr); // before CHAR HALANT
128
+ }
129
+
130
+ // MALAYALAM
131
+ else if ($lang=='ml') {
132
+ // Chillus - old forms - remove ZWNJ after
133
+ // This font Volt rules recognises e.g. "Na Halant(Virama)" as ChilluN
134
+ $vstr = preg_replace('/(0D23 0D4D|0D28 0D4D|0D30 0D4D|0D32 0D4D|0D33 0D4D) 200D/','\\1', $vstr);
135
+ // See Chillus in Unicode [http://en.wikipedia.org/wiki/Malayalam_script]
136
+ $vstr = str_replace('0D7A','0D23 0D4D', $vstr); // [mlymChilluNn]
137
+ $vstr = str_replace('0D7B','0D28 0D4D', $vstr); // [mlymChilluN]
138
+ $vstr = str_replace('0D7C','0D30 0D4D', $vstr); // [mlymChilluR]
139
+ $vstr = str_replace('0D7D','0D32 0D4D', $vstr); // [mlymChilluL]
140
+ $vstr = str_replace('0D7E','0D33 0D4D', $vstr); // [mlymChilluLl]
141
+ /*
142
+ // Chillus - 0D7A-0D7E not in font directly, but as E005-E009
143
+ $vstr = preg_replace('/0D23 0D4D 200D/','0D7A', $vstr);
144
+ $vstr = preg_replace('/0D28 0D4D 200D/','0D7B', $vstr);
145
+ $vstr = preg_replace('/0D30 0D4D 200D/','0D7C', $vstr);
146
+ $vstr = preg_replace('/0D32 0D4D 200D/','0D7D', $vstr);
147
+ $vstr = preg_replace('/0D33 0D4D 200D/','0D7E', $vstr);
148
+
149
+ $vstr = preg_replace('/0D7F/','E004', $vstr); // [mlymChilluK]
150
+ $vstr = preg_replace('/0D7A/','E005', $vstr); // [mlymChilluNn]
151
+ $vstr = preg_replace('/0D7B/','E006', $vstr); // [mlymChilluN]
152
+ $vstr = preg_replace('/0D7C/','E007', $vstr); // [mlymChilluR]
153
+ $vstr = preg_replace('/0D7D/','E008', $vstr); // [mlymChilluL]
154
+ $vstr = preg_replace('/0D7E/','E009', $vstr); // [mlymChilluLl]
155
+ */
156
+
157
+ // MALAYALAM double-part vowels []
158
+ $vstr = str_replace('0D4A','0D46 0D3E', $vstr); // 2-part Vowel
159
+ $vstr = str_replace('0D4B','0D47 0D3E', $vstr); // 2-part Vowel
160
+ $vstr = str_replace('0D4C','0D46 0D57', $vstr); // 2-part Vowel
161
+ $mlprebasedvowels = "(0D46|0D47|0D48)";
162
+ // No nukta
163
+ $halant = "0D4D";
164
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$mlprebasedvowels.'/','\\2 \\1', $vstr); // vowel sign pre-based shift left
165
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$mlprebasedvowels.'/','\\2 \\1 '.$halant, $vstr); // before CHAR HALANT
166
+ }
167
+
168
+ // TELUGU
169
+ else if ($lang=='te') {
170
+ // TELUGU double-part vowels [0C48 -> 0C46 0C56]
171
+ $vstr = str_replace('0C48','0C46 0C56', $vstr); // 2-part Vowel
172
+ $prebasedvowels = "(0C46)";
173
+ $abvvowels = "(0C3E|0C3F|0C40|0C46|0C47|0C4A|0C4B|0C4C|0C55)";
174
+ // No nukta
175
+ $halant = "0C4D";
176
+ $tefullforms = "0C15|0C17|0C18|0C1A|0C1B|0C1C|0C1D|0C20|0C21|0C22|0C24|0C25|0C26|0C27|0C28|0C2A|0C2B|0C2D|0C2E|0C2F|0C30|0C33|0C35|0C36|0C37|0C38|0C39|E028|E029|E02A|E02B|E078|E07A|E07B";
177
+ $vstr = preg_replace('/('.$tefullforms .') '.$halant.' ('.$tefullforms .') '.$abvvowels .'/','\\1 \\3 '.$halant.' \\2', $vstr); // before HALANT
178
+ }
179
+
180
+
181
+ // KANNADA
182
+ else if ($lang=='kn') {
183
+ // KANNADA double-part vowels [0CC8 -> 0CC6 0CD6]
184
+ $vstr = str_replace('0CC0','0CBF 0CD5', $vstr); // 2-part Vowel
185
+ $vstr = str_replace('0CC7','0CC6 0CD5', $vstr); // 2-part Vowel
186
+ $vstr = str_replace('0CC8','0CC6 0CD6', $vstr); // 2-part Vowel AI - no glyph for single
187
+ $vstr = str_replace('0CCA','0CC6 0CC2', $vstr); // 2-part Vowel
188
+ $vstr = str_replace('0CCB','0CC6 0CC2 0CD5', $vstr); // 2-part Vowel
189
+ $prebasedvowels = "(0CBF|0CC6)";
190
+ $halant = "0CCD";
191
+ }
192
+
193
+
194
+ //============================
195
+
196
+ // SPECIALS
197
+
198
+ // DEVANAGARI Ra Halant Ra
199
+ if ($lang=='hi') {
200
+ $vstr = str_replace('0930 094D 0930','E05D 0930', $vstr); // Ra Halant Ra => halfRa FullRa
201
+ }
202
+
203
+ // GUJARATI
204
+ if ($lang=='gu') {
205
+ $vstr = str_replace('0AB0 0AC2','E02E', $vstr); // Ra VowelUu => SpecialForm RaUu
206
+ }
207
+
208
+ // TELUGU Ra Halant <Consonant> Halant => halfRa Halant<Consonant> Halant
209
+ if ($lang=='te') {
210
+ $vstr = preg_replace('/0C30 0C4D ([A-F0-9]{4}) 0C4D/','E021 0C4D \\1 0C4D', $vstr);
211
+ }
212
+
213
+ // KANNADA
214
+ // Reph at end of word becomes E0CC instead of E00B
215
+ if ($lang=='kn') {
216
+ $vstr = str_replace('0CB0 0CCD 0020','E0CC 0020', $vstr); // mPDF 5.3.87
217
+ }
218
+
219
+
220
+ //============================
221
+ // MAIN BIT FROM VOLT RULES
222
+ foreach($voltdata[$font] AS $rid=>$reps) {
223
+ //echo $rid . ': ' . $vstr.'<br />';
224
+ $vstr = preg_replace('/'.$reps['match'].'/',$reps['replace'], $vstr);
225
+ }
226
+ //echo $vstr.'<br />'; exit;
227
+
228
+
229
+ //============================
230
+
231
+ // SPECIALS
232
+
233
+ // KANNADA
234
+ // <Base> <BelowBase1> [<BelowBase2> ] MatraI -> <Base/MatraI ligature> <Belowbase1> etc
235
+ if ($lang=='kn') {
236
+ $matraI = "0CBF";
237
+ $knbase = preg_split('/\|/', "0C95|0C96|0C97|0C98|0C9A|0C9B|0C9C|0C9D|0CA0|0CA1|0CA2|0CA3|0CA4|0CA5|0CA6|0CA7|0CA8|0CAA|0CAB|0CAC|0CAD|0CAE|0CAF|0CB0|0CB2|0CB3|0CB5|0CB6|0CB7|0CB8|0CB9|E0A3|E07D|E07E");
238
+ $knmatraIligature = preg_split('/\|/', "E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A4|E0A1|E0A2");
239
+ $belowbase1 = "E02E|E02F|E030|E031|E032|E033|E034|E035|E036|E037|E038|E039|E03A|E03B|E03C|E03D|E03E|E03F|E040|E041|E042|E043|E044|E045|E046|E047|E048|E049|E04A|E04B|E04C|E04D|E04E|E04F|E050|E081";
240
+ $belowbase2 = "E052|E053|E054|E055|E056|E057|E058|E059|E05A|E05B|E05C|E05D|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E081";
241
+ for ($i=0; $i<count($knbase);$i++) {
242
+ $vstr = preg_replace('/'.$knbase[$i].' ('.$belowbase1.') ('.$belowbase2.') '.$matraI.'/', $knmatraIligature[$i].' \\1 \\2', $vstr);
243
+ $vstr = preg_replace('/'.$knbase[$i].' ('.$belowbase1.') '.$matraI.'/', $knmatraIligature[$i].' \\1', $vstr);
244
+ }
245
+ }
246
+
247
+ // KANNADA
248
+ // [KanTtaFull] [matraI] => [KanTtaPartial] [matraI]
249
+ if ($lang=='kn') {
250
+ $vstr = preg_replace('/0C9F '.$matraI.'/', 'E015 '.$matraI, $vstr);
251
+ }
252
+
253
+ // ORIYA
254
+ if ($lang=='or') {
255
+ // SpecialCase Ra[0B30] Halant still left before [oryaFullNnNna] => E00F
256
+ $vstr = preg_replace('/0B30 '.$halant.' E00F/','E00F E069', $vstr); // convert to Reph
257
+ }
258
+
259
+ //============================
260
+ // SHIFT REPH
261
+
262
+ // DEVANAGARI Shift Reph [E015]
263
+ if ($lang=='hi') {
264
+ // FIRSTLY - halfRa = E05D - Change this to Reph [E015]
265
+ $himatchhalfforms = "E043|E044|E045|E046|E047|E048|E049|E04A|E04B|E04C|E04D|E04E|E04F|E050|E051|E052|E053|E054|E055|E056|E057|E058|E059|E05A|E05B|E05C|E05D|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E0D3|E0D4|E0D5|E0D6|E0D7|E0D8|E0D9|E0DA|E0DB|E0DC|E0DD|E0DE|E0DF|E0E0|E0E1|E0E2|E0E3|E0E4|E0E5|E0E6|E0E7|E0E8|E0E9|E0EA|E0EB|E0EC|E0ED|E0EE|E0EF|E0F0|E0F1|E0F2|E0F3|E0F4|E0F5|E0F6|E0F7|E0F8|E0F9|E0FA|E0FB|E0FC|E0FD|E0FE|E0FF|E100|E101|E102|E103|E104|E105|E106|E107|E108|E109|E10A|E10B|E10C|E10D|E10E|E10F|E110|E111|E112|E113|E114|E115|E116|E117|E118|E119|E11A|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145";
266
+ $himatchfullforms = "0915|0916|0917|0918|0919|091A|091B|091C|091D|091E|091F|0920|0921|0922|0923|0924|0925|0926|0927|0928|092A|092B|092C|092D|092E|092F|0930|0932|0933|0935|0936|0937|0938|0939|E028|E029|0958|0959|095A|E02A|E02B|E02C|E02D|095B|E02E|E02F|E030|E031|095C|095D|E032|E033|E034|E035|E036|0929|E037|095E|E038|E039|E03A|095F|0931|E03B|0934|E03C|E03D|E03E|E03F|E040|E041|E042|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF|E0B0|E0B1|E0B2|E0B3|E0B4|E0B5|E0B6|E0B7|E0B8|E0B9|E0BA|E0BB|E0BC|E0BD|E0BE|E0BF|E0C0|E0C1|E0C2|E0C3|E0C4|E0C5|E0C6|E0C7|E0C8|E0C9|E0CA|E0CB|E0CC|E0CD|E0CE|E0CF|E0D0|E0D1|E0D2|E11E|E11F|E120|E121|E122|E123|E124|E125|E126|E127|E128|E129|E12A|E12B|E12C|E12D|E12E|E12F|E130|E131|E132|E133";
267
+ $vstr = preg_replace('/E05D ('.$himatchhalfforms.'|'.$himatchfullforms.')/', 'E015 \\1', $vstr);
268
+
269
+ // Reph = E015 - Shift Right to just after end of syllable
270
+ // FullAllForms + HalfAllForms + 093E matraA
271
+ while(preg_match('/E015 ('.$himatchhalfforms.')/', $vstr)) {
272
+ $vstr = preg_replace('/E015 ('.$himatchhalfforms.')/', '\\1 E015', $vstr);
273
+ }
274
+ $vstr = preg_replace('/E015 ('.$himatchfullforms.')/', '\\1 E015', $vstr);
275
+
276
+ // Now shift it beyond post-based vowels // ??? Need to add others e.g. 0949,094A,094B,094C + presentation forms like E198
277
+ $vstr = str_replace('E015 093E', '093E E015', $vstr);
278
+ $vstr = preg_replace('/E015 (0940|E194|E195|E196|E197|E198)/', '\\1 E014', $vstr); // (Small) reph [E014] to Right of matraI
279
+ $vstr = str_replace('E015 0947', '0947 E014', $vstr); // (Small) reph [E014] to Right of matraI
280
+ }
281
+
282
+ // BENGALI Shift Reph [E068]
283
+ else if ($lang=='bn') {
284
+ $bnfullconjuncts = "E002|E003|E004|E041|E042|E043|E044|E045|E046|E047|E048|E049|E04A|E04B|E04C|E04D|E04E|E04F|E050|E051|E052|E053|E054|E055|E056|E057|E058|E059|E05A|E05B|E05C|E05D|E05E|E05F|E060|E061|E062|E063|E064|E065|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF|E0B0|E0B1|E0B2|E0B3|E0B4|E0B5|E0B6|E0B7|E0B8|E0B9|E0BA|E0BB|E0BC|E0BD|E0BE|E0BF|E0C0|E0C1|E0C2|E0C3|E0C4|E0C5|E0C6|E0C7|E0C8|E0C9|E0CA|E0CB|E0CC|E0CD|E0CE|E0CF|E0D0|E0D1|E0D2|E0D3|E0D4|E0D5|E0D6|E0D7|E0D8|E0D9|E0DA|E0DB|E0DC|E0DD|E0DE|E0DF|E0E0|E0E1|E0E2|E0E3|E0E4|E0E5|E0E6|E0E7|E0E8|E0E9|E0EA|E0EB|E0EC|E0ED|E0EE|E0EF|E0F0|E0F1|E0F2|E0F3|E0F4|E0F5|E0F6|E0F7|E0F8|E0F9|E0FA|E0FB|E0FC|E0FD|E0FE|E0FF|E100|E101|E102|E103|E104|E105|E106|E107|E108|E109|E10A|E10B|E10C|E10D|E10E|E10F|E110|E111|E112|E113|E114|E115|E116|E117|E118|E119|E11A|E11B|E11C|E11D|E11E|E11F|E120|E121|E122|E123|E124|E125|E126|E127|E128|E129|E12A|E12B|E12C|E12D|E12E|E12F|E130|E131|E132|E133|E134|E135|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E|E15F|E160|E161|E162|E163|E164|E165|E166|E167|E168|E169|E16A|E16B|E16C|E16D|E16E|E16F|E170|E171|E172|E173|E174|E175|E176|E177|E178|E179|E17A|E17B|E17C|E17D|E17E|E17F|E180|E181|E182|E183|E184|E185|E186|E187|E188|E189|E18A|E18B|E18C|E18D|E18E|E18F|E190|E191|E192|E193|E194|E195|E196|E197|E198|E199|E19A";
285
+ // $bnfullcons - set above;
286
+ $vstr = preg_replace('/E068 ('.$bnfullconjuncts.'|'.$bnfullcons.')/', '\\1 E068', $vstr);
287
+ // ? Need to shift it beyond post-base vowels 09BE, 09C0, 09D7 haven't found so can't test??
288
+ $vstr = preg_replace('/E068 (09BE|09C0|09D7)/', '\\1 E068', $vstr);
289
+ }
290
+
291
+ // GUJARATI Shift Reph [E032]
292
+ else if ($lang=='gu') {
293
+ $gufullforms = "0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5";
294
+ $vstr = preg_replace('/E032 ('.$gufullforms.')/', '\\1 E032', $vstr);
295
+ // Now shift it beyond post-based vowels // ??? Need to add others e.g. 0949,094A,094B,094C + presentation forms like E198
296
+ // ? Need to shift it beyond post-base vowels 0ABE, 0AC0 haven't found so can't test??
297
+ $vstr = preg_replace('/E032 (0ABE|0AC0)/', '\\1 E032', $vstr);
298
+ }
299
+
300
+
301
+ // TELUGU Shift Reph to LEFT [E046|E069|E077] [TelRaSmallOne] => E046 [TelRaSmallTwo] => E069 [TelRaSmallThree] => E077
302
+ else if ($lang=='te') {
303
+ // tefullforms defined earlier
304
+ $tepartialforms = "E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E07C|E07D|E07E";
305
+ $matraligs = "E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF";
306
+ $tevowels = "0C3E|0C3F|0C40|0C46|0C47|0C56|0C4A|0C4B|0C4C"
307
+ ."|0C41|0C42|0C43|0C44"; // post matras
308
+ $vstr = preg_replace('/('.$tevowels.') (E046|E069|E077)/', '\\2 \\1', $vstr);
309
+ while(preg_match('/('.$tepartialforms.') (E046|E069|E077)/', $vstr)) {
310
+ $vstr = preg_replace('/('.$tepartialforms.') (E046|E069|E077)/', '\\2 \\1', $vstr);
311
+ }
312
+ $vstr = preg_replace('/('.$tefullforms .'|'.$matraligs.') (E046|E069|E077)/', '\\2 \\1', $vstr);
313
+ }
314
+
315
+
316
+ // KANNADA Shift Reph to RIGHT [E00B]
317
+ else if ($lang=='kn') {
318
+ $knfullforms = "0C95|0C96|0C97|0C98|0C99|0C9A|0C9B|0C9C|0C9D|0C9E|0C9F|0CA0|0CA1|0CA2|0CA3|0CA4|0CA5|0CA6|0CA7|0CA8|0CAA|0CAB|0CAC|0CAD|0CAE|0CAF|0CB0|0CB1|0CB2|0CB3|0CB5|0CB6|0CB7|0CB8|0CB9|E07D|E07E|E0A3";
319
+ $knpartialforms = "E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|0C9E|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E028|E029|E02A|E02B|E02C|E02D|E07F";
320
+ while(preg_match('/E00B ('.$knpartialforms.')/', $vstr)) {
321
+ $vstr = preg_replace('/E00B ('.$knpartialforms.')/', '\\1 E00B', $vstr);
322
+ }
323
+ // mPDF 5.3.47 Also move Reph to right of matraIligatures
324
+ $knfullforms .= "|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A4|E0A1|E0A2";
325
+ $vstr = preg_replace('/E00B ('.$knfullforms.')/', '\\1 E00B', $vstr);
326
+
327
+ // ? Need to shift it beyond base or below-base forms - haven't found so can't test??
328
+ // mPDF 5.3.87
329
+ // E004 added to list (which is a transformed version of 0CBE)
330
+ $knvowels = "0CBE|0CC0|0CC1|0CC2|0CC3|0CC4|0CC7|0CC8|0CCA|0CCB|0CD5|0CD6|E004";
331
+ $vstr = preg_replace('/E00B ('.$knvowels.')/', '\\1 E00B', $vstr);
332
+ }
333
+
334
+
335
+ // ORIYA Shift Reph to RIGHT [E069|E06A|E06B|E06C]
336
+ else if ($lang=='or') {
337
+ $orrephs = "E069|E06A|E06B|E06C";
338
+ $orfullforms = "0B15|0B16|0B17|0B18|0B19|0B1A|0B1B|0B1C|0B1D|0B1E|0B1F|0B20|0B21|0B22|0B23|0B24|0B25|0B26|0B27|0B28|0B29|0B2A|0B2B|0B2C|0B2D|0B2E|0B2F|0B30|0B31|0B32|0B33|0B34|0B35|0B36|0B37|0B38|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E028|E029|E02A|E02B|E02C|E02D|E02E|E02F|E030|E031|E032|E033|E034|E035|E036|E037";
339
+ // E123 - E147 FullHalant forms ? add to FullForms
340
+ $orpartialforms = "E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF|E0B0|E0B1|E0B2|E0B3|E0B4|E0B5|E0B6|E0B7|E0B8|E0B9|E0BA|E0BB|E0BC|E0BD|E0BE|E0BF|E0C0|E0C1|E0C2|E0C3|E0C4|E0C5|E0C6|E0C7|E0C8|E0C9|E0CA|E0CB|E0CC|E0CD|E0CE|E0CF|E0D0|E0D1|E0D2|E0D3|E0D4|E0D5|E0D6|E0D7|E0D8|E0D9|E0DA|E0DB|E0DC|E0DD|E0DE|E0DF|E0E0|E0E1|E0E2|E0E3|E0E4|E0E5|E0E6|E0E7|E0E8|E0E9|E0EA|E0EB|E0EC|E0ED|E0EE|E0EF|E0F0|E0F1|E0F2|E0F3|E0F4|E0F5";
341
+
342
+ // Combined MatraIReph[E06D] split [0B3F & E069] to allow reph to be shifted forwards
343
+ $vstr = preg_replace('/('.$orfullforms.') E06D ('.$orfullforms.') 0B3E/', '\\1 0B3F E069 \\2 0B3E', $vstr);
344
+
345
+
346
+ while(preg_match('/('.$orrephs.') ('.$orpartialforms.')/', $vstr)) {
347
+ $vstr = preg_replace('/('.$orrephs.') ('.$orpartialforms.')/', '\\2 \\1', $vstr);
348
+ }
349
+ $vstr = preg_replace('/('.$orrephs.') ('.$orfullforms.')/', '\\2 \\1', $vstr);
350
+
351
+
352
+ // Combine Reph and MatraI
353
+ $vstr = str_replace('E069 0B3F', 'E06D', $vstr); // Reph and MatraI -> MatraIReph
354
+ $vstr = str_replace('E06A 0B3F', 'E06E', $vstr); // Reph and MatraI -> MatraIReph
355
+ $vstr = str_replace('E06B 0B3F', 'E06F', $vstr); // Reph and MatraI -> MatraIReph
356
+ }
357
+
358
+
359
+ // MALAYALAM Shift Reph to LEFT [E00E] (mlylmRaVattu)
360
+ else if ($lang=='ml') {
361
+ $halant = "0D4D";
362
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' 0D30/','E00E \\1', $vstr); // 0D30 = Ra
363
+ $vstr = preg_replace('/([A-F0-9]{4}) '.$halant.' '.$mlprebasedvowels .' 0D30/','\\2 E00E \\1', $vstr); // 0D30 = Ra
364
+
365
+ $mlfullforms = "0D15|0D16|0D17|0D18|0D19|0D1A|0D1B|0D1C|0D1D|0D1E|0D1F|0D20|0D21|0D22|0D23|0D24|0D25|0D26|0D27|0D28|0D2A|0D2B|0D2C|0D2D|0D2E|0D2F|0D30|0D31|0D32|0D33|0D34|0D35|0D36|0D37|0D38|0D39"
366
+ ."|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E028|E029|E02A|E02B|E02C|E02D|E02E|E02F|E030|E031|E032|E033|E034|E035|E036|E037|E038|E039|E03A|E03B|E03C|E03D|E03E|E03F|E040|E041|E042|E043|E044|E045|E046|E047|E048|E049|E04A|E04B|E04C|E04D|E04E|E04F|E050|E051|E052|E053|E054|E055|E056|E057|E058|E059|E05A|E05B|E05C|E05D|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D";
367
+ // = FullConsonants + FullConjuncts
368
+
369
+ // = Add Chillu characters // mPDF 5.0.024
370
+ $mlfullforms .= "|E004|E005|E006|E007|E008|E009";
371
+ while(preg_match('/('.$mlfullforms.') E00E/', $vstr))
372
+ $vstr = preg_replace('/('.$mlfullforms.') E00E/', 'E00E \\1', $vstr);
373
+ }
374
+
375
+ //============================
376
+
377
+ // SHIFT post-based vowels to Left of SmallForms (NOT to left of full forms)
378
+
379
+ // TELUGU Shift
380
+ if ($lang=='te') {
381
+ // NB $tevowels defined above
382
+ // NB $tefullforms defined above
383
+ $tebelowbase1 = "E02C|E02D|E02E|E02F|E030|E031|E032|E033|E034|E035|E036|E037|E038|E039|E03A|E03B|E03C|E03D|E03E|E03F|E040|E041|E042|E043|E044|E045|E046|E047|E048|E049|E04A|E04B|E04C|E04D|E04E"; //'Small1KaToHa'
384
+ $tebelowbase2 = "E04F|E050|E051|E052|E053|E054|E055|E056|E057|E058|E059|E05A|E05B|E05C|E05D|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071"; // 'Small2KaToHa'
385
+ $vstr = preg_replace('/('.$tebelowbase2.') ('.$tevowels.')/', '\\2 \\1', $vstr);
386
+ $vstr = preg_replace('/('.$tebelowbase1.') ('.$tevowels.')/', '\\2 \\1', $vstr);
387
+ }
388
+
389
+
390
+ // KANNADA Shift
391
+ else if ($lang=='kn') {
392
+ $knvowels = "0CBE|0CC0|0CC1|0CC2|0CC3|0CC4|0CC7|0CC8|0CCA|0CCB|0CD5|0CD6"
393
+ // mPDF 5.3.87 Shouldn't swop E082 and E047 (belowbase1) below
394
+ // E082 is a matraIligature
395
+ // ."|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB"
396
+ ."|E004|E007|E008|E009|E00A";
397
+
398
+
399
+ // NB $knvowels defined above
400
+ // NB $fullforms defined above
401
+ // $belowbase1/2 defined above
402
+ $vstr = preg_replace('/('.$belowbase2.') ('.$knvowels.')/', '\\2 \\1', $vstr);
403
+ // mPDF 5.3.87
404
+ $vstr = preg_replace('/('.$belowbase1.') ('.$knvowels.')/', '\\2 \\1', $vstr);
405
+
406
+ //$vstr = preg_replace('/('.$fullforms.') ('.$knvowels.')/', '\\2 \\1', $vstr);
407
+ }
408
+
409
+ //============================
410
+ // Clear unwanted ZWJ, ZWNJ
411
+ // MALAYALAM
412
+ if ($lang=='ml') {
413
+ $vstr = preg_replace('/(200C|200D) /','', $vstr);
414
+ }
415
+
416
+ //============================
417
+ // END & PUT IT BACK TOGETHER
418
+ $vstr = preg_replace('/^0020 (.*) 0020$/', '\\1', $vstr);
419
+
420
+ $varr = explode(" ",$vstr);
421
+ $e = '';
422
+ foreach($varr AS $v) {
423
+ $e.=code2utf(hexdec($v));
424
+ }
425
+ //============================
426
+
427
+ return $e;
428
+ }
429
+
430
+
431
+ }
432
+
433
+ ?>
mPDF/classes/meter.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class meter {
4
+
5
+
6
+ function __construct() {
7
+
8
+ }
9
+
10
+ function makeSVG($tag, $type, $value, $max, $min, $optimum, $low, $high) {
11
+ $svg = '';
12
+ if ($tag == 'meter') {
13
+
14
+ if ($type=='2') {
15
+ /////////////////////////////////////////////////////////////////////////////////////
16
+ ///////// CUSTOM <meter type="2">
17
+ /////////////////////////////////////////////////////////////////////////////////////
18
+ $h = 10;
19
+ $w = 160;
20
+ $border_radius = 0.143; // Factor of Height
21
+
22
+ $svg = '<?xml version="1.0" encoding="UTF-8"?>
23
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
24
+ <svg width="'.$w.'px" height="'.$h.'px" viewBox="0 0 '.$w.' '.$h.'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ><g>
25
+
26
+
27
+ <defs>
28
+ <linearGradient id="GrGRAY" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
29
+ <stop offset="0%" stop-color="rgb(222, 222, 222)" />
30
+ <stop offset="20%" stop-color="rgb(232, 232, 232)" />
31
+ <stop offset="25%" stop-color="rgb(232, 232, 232)" />
32
+ <stop offset="100%" stop-color="rgb(182, 182, 182)" />
33
+ </linearGradient>
34
+
35
+ </defs>
36
+ ';
37
+ $svg .= '<rect x="0" y="0" width="'.$w.'" height="'.$h.'" fill="#f4f4f4" stroke="none" />';
38
+
39
+ // LOW to HIGH region
40
+ //if ($low && $high && ($low != $min || $high != $max)) {
41
+ if ($low && $high) {
42
+ $barx = (($low-$min) / ($max-$min) ) * $w;
43
+ $barw = (($high-$low) / ($max-$min) ) * $w;
44
+ $svg .= '<rect x="'.$barx.'" y="0" width="'.$barw.'" height="'.$h.'" fill="url(#GrGRAY)" stroke="#888888" stroke-width="0.5px" />';
45
+ }
46
+
47
+ // OPTIMUM Marker (? AVERAGE)
48
+ if ($optimum) {
49
+ $barx = (($optimum-$min) / ($max-$min) ) * $w;
50
+ $barw = $h/2;
51
+ $barcol = '#888888';
52
+ $svg .= '<rect x="'.$barx.'" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$barw.'" height="'.$h.'" fill="'.$barcol.'" stroke="none" />';
53
+ }
54
+
55
+ // VALUE Marker
56
+ if ($value) {
57
+ if ($min != $low && $value < $low) { $col = 'orange'; }
58
+ else if ($max != $high && $value > $high) { $col = 'orange'; }
59
+ else { $col = '#008800'; }
60
+ $cx = (($value-$min) / ($max-$min) ) * $w;
61
+ $cy = $h/2;
62
+ $rx = $h/3.5;
63
+ $ry = $h/2.2;
64
+ $svg .= '<ellipse fill="'.$col.'" stroke="#000000" stroke-width="0.5px" cx="'.$cx.'" cy="'.$cy.'" rx="'.$rx.'" ry="'.$ry.'"/>';
65
+ }
66
+
67
+ // BoRDER
68
+ $svg .= '<rect x="0" y="0" width="'.$w.'" height="'.$h.'" fill="none" stroke="#888888" stroke-width="0.5px" />';
69
+
70
+ $svg .= '</g></svg>';
71
+ }
72
+ else {
73
+ /////////////////////////////////////////////////////////////////////////////////////
74
+ ///////// DEFAULT <meter>
75
+ /////////////////////////////////////////////////////////////////////////////////////
76
+ $h = 10;
77
+ $w = 50;
78
+ $border_radius = 0.143; // Factor of Height
79
+
80
+ $svg = '<?xml version="1.0" encoding="UTF-8"?>
81
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
82
+ <svg width="'.$w.'px" height="'.$h.'px" viewBox="0 0 '.$w.' '.$h.'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ><g>
83
+
84
+ <defs>
85
+ <linearGradient id="GrGRAY" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
86
+ <stop offset="0%" stop-color="rgb(222, 222, 222)" />
87
+ <stop offset="20%" stop-color="rgb(232, 232, 232)" />
88
+ <stop offset="25%" stop-color="rgb(232, 232, 232)" />
89
+ <stop offset="100%" stop-color="rgb(182, 182, 182)" />
90
+ </linearGradient>
91
+
92
+ <linearGradient id="GrRED" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
93
+ <stop offset="0%" stop-color="rgb(255, 162, 162)" />
94
+ <stop offset="20%" stop-color="rgb(255, 218, 218)" />
95
+ <stop offset="25%" stop-color="rgb(255, 218, 218)" />
96
+ <stop offset="100%" stop-color="rgb(255, 0, 0)" />
97
+ </linearGradient>
98
+
99
+ <linearGradient id="GrGREEN" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
100
+ <stop offset="0%" stop-color="rgb(102, 230, 102)" />
101
+ <stop offset="20%" stop-color="rgb(218, 255, 218)" />
102
+ <stop offset="25%" stop-color="rgb(218, 255, 218)" />
103
+ <stop offset="100%" stop-color="rgb(0, 148, 0)" />
104
+ </linearGradient>
105
+
106
+ <linearGradient id="GrBLUE" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
107
+ <stop offset="0%" stop-color="rgb(102, 102, 230)" />
108
+ <stop offset="20%" stop-color="rgb(238, 238, 238)" />
109
+ <stop offset="25%" stop-color="rgb(238, 238, 238)" />
110
+ <stop offset="100%" stop-color="rgb(0, 0, 128)" />
111
+ </linearGradient>
112
+
113
+ <linearGradient id="GrORANGE" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
114
+ <stop offset="0%" stop-color="rgb(255, 186, 0)" />
115
+ <stop offset="20%" stop-color="rgb(255, 238, 168)" />
116
+ <stop offset="25%" stop-color="rgb(255, 238, 168)" />
117
+ <stop offset="100%" stop-color="rgb(255, 155, 0)" />
118
+ </linearGradient>
119
+ </defs>
120
+
121
+ <rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$w.'" height="'.$h.'" fill="url(#GrGRAY)" stroke="none" />
122
+ ';
123
+
124
+ if ($value) {
125
+ $barw = (($value-$min) / ($max-$min) ) * $w;
126
+ if ($optimum < $low) {
127
+ if ($value < $low) { $barcol = 'url(#GrGREEN)'; }
128
+ else if ($value > $high) { $barcol = 'url(#GrRED)'; }
129
+ else { $barcol = 'url(#GrORANGE)'; }
130
+ }
131
+ else if ($optimum > $high) {
132
+ if ($value < $low) { $barcol = 'url(#GrRED)'; }
133
+ else if ($value > $high) { $barcol = 'url(#GrGREEN)'; }
134
+ else { $barcol = 'url(#GrORANGE)'; }
135
+ }
136
+ else {
137
+ if ($value < $low) { $barcol = 'url(#GrORANGE)'; }
138
+ else if ($value > $high) { $barcol = 'url(#GrORANGE)'; }
139
+ else { $barcol = 'url(#GrGREEN)'; }
140
+ }
141
+ $svg .= '<rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$barw.'" height="'.$h.'" fill="'.$barcol.'" stroke="none" />';
142
+ }
143
+
144
+
145
+ // Borders
146
+ //$svg .= '<rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$w.'" height="'.$h.'" fill="none" stroke="#888888" stroke-width="0.5px" />';
147
+ if ($value) {
148
+ // $svg .= '<rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$barw.'" height="'.$h.'" fill="none" stroke="#888888" stroke-width="0.5px" />';
149
+ }
150
+
151
+
152
+ $svg .= '</g></svg>';
153
+ }
154
+ }
155
+ else { // $tag == 'progress'
156
+
157
+ if ($type=='2') {
158
+ /////////////////////////////////////////////////////////////////////////////////////
159
+ ///////// CUSTOM <progress type="2">
160
+ /////////////////////////////////////////////////////////////////////////////////////
161
+ }
162
+ else {
163
+ /////////////////////////////////////////////////////////////////////////////////////
164
+ ///////// DEFAULT <progress>
165
+ /////////////////////////////////////////////////////////////////////////////////////
166
+ $h = 10;
167
+ $w = 100;
168
+ $border_radius = 0.143; // Factor of Height
169
+
170
+ if ($value or $value==='0') {
171
+ $fill = 'url(#GrGRAY)';
172
+ }
173
+ else {
174
+ $fill = '#f8f8f8';
175
+ }
176
+
177
+ $svg = '<svg width="'.$w.'px" height="'.$h.'px" viewBox="0 0 '.$w.' '.$h.'"><g>
178
+
179
+ <defs>
180
+ <linearGradient id="GrGRAY" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
181
+ <stop offset="0%" stop-color="rgb(222, 222, 222)" />
182
+ <stop offset="20%" stop-color="rgb(232, 232, 232)" />
183
+ <stop offset="25%" stop-color="rgb(232, 232, 232)" />
184
+ <stop offset="100%" stop-color="rgb(182, 182, 182)" />
185
+ </linearGradient>
186
+
187
+ <linearGradient id="GrGREEN" x1="0" y1="0" x2="0" y2="1" gradientUnits="boundingBox">
188
+ <stop offset="0%" stop-color="rgb(102, 230, 102)" />
189
+ <stop offset="20%" stop-color="rgb(218, 255, 218)" />
190
+ <stop offset="25%" stop-color="rgb(218, 255, 218)" />
191
+ <stop offset="100%" stop-color="rgb(0, 148, 0)" />
192
+ </linearGradient>
193
+
194
+ </defs>
195
+
196
+ <rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$w.'" height="'.$h.'" fill="'.$fill.'" stroke="none" />
197
+ ';
198
+
199
+ if ($value) {
200
+ $barw = (($value-$min) / ($max-$min) ) * $w;
201
+ $barcol = 'url(#GrGREEN)';
202
+ $svg .= '<rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$barw.'" height="'.$h.'" fill="'.$barcol.'" stroke="none" />';
203
+ }
204
+
205
+
206
+ // Borders
207
+ $svg .= '<rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$w.'" height="'.$h.'" fill="none" stroke="#888888" stroke-width="0.5px" />';
208
+ if ($value) {
209
+ // $svg .= '<rect x="0" y="0" rx="'.($h*$border_radius).'px" ry="'.($h*$border_radius).'px" width="'.$barw.'" height="'.$h.'" fill="none" stroke="#888888" stroke-width="0.5px" />';
210
+ }
211
+
212
+
213
+ $svg .= '</g></svg>';
214
+
215
+ }
216
+ }
217
+
218
+ return $svg;
219
+ }
220
+
221
+
222
+ } // end of class
223
+
224
+ ?>
mPDF/classes/svg.php ADDED
@@ -0,0 +1,2600 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // svg class modified for mPDF version 4.4.003 by Ian Back: based on -
3
+ // svg2pdf fpdf class
4
+ // sylvain briand (syb@godisaduck.com), modified by rick trevino (rtrevino1@yahoo.com)
5
+ // http://www.godisaduck.com/svg2pdf_with_fpdf
6
+ // http://rhodopsin.blogspot.com
7
+ //
8
+ // cette class etendue est open source, toute modification devra cependant etre repertori�e~
9
+
10
+
11
+ // NB UNITS - Works in pixels as main units - converting to PDF units when outputing to PDF string
12
+ // and on returning size
13
+
14
+ class SVG {
15
+
16
+ var $svg_gradient; // array - contient les infos sur les gradient fill du svg class� par id du svg
17
+ var $svg_shadinglist; // array - contient les ids des objet shading
18
+ var $svg_info; // array contenant les infos du svg voulue par l'utilisateur
19
+ var $svg_attribs; // array - holds all attributes of root <svg> tag
20
+ var $svg_style; // array contenant les style de groupes du svg
21
+ var $svg_string; // String contenant le tracage du svg en lui m�me.
22
+ var $txt_data; // array - holds string info to write txt to image
23
+ var $txt_style; // array - current text style
24
+ var $mpdf_ref;
25
+ var $xbase; // mPDF 4.4.003
26
+ var $ybase; // mPDF 4.4.003
27
+ var $svg_error; // mPDF 4.4.003
28
+ var $subPathInit; // mPDF 4.4.003
29
+ var $spxstart; // mPDF 4.4.003
30
+ var $spystart; // mPDF 4.4.003
31
+ var $kp; // mPDF 4.4.003 convert pixels to PDF units
32
+ var $pathBBox; // mPDF 5.0.039
33
+
34
+ function SVG(&$mpdf){
35
+ $this->svg_gradient = array();
36
+ $this->svg_shadinglist = array();
37
+ $this->txt_data = array();
38
+ $this->svg_string = '';
39
+ $this->svg_info = array();
40
+ $this->svg_attribs = array();
41
+ $this->xbase = 0;
42
+ $this->ybase = 0;
43
+ $this->svg_error = false;
44
+ $this->subPathInit = false; // mPDF 4.4.003
45
+ $this->dashesUsed = false; // mPDF 5.0
46
+ $this->mpdf_ref =& $mpdf;
47
+
48
+ $this->kp = 72 / $mpdf->img_dpi; // mPDF 4.4.003 constant To convert pixels to pts/PDF units
49
+ $this->kf = 1; // mPDF 5.0.039 constant To convert font size if re-mapped
50
+ $this->pathBBox = array(); // mPDF 5.0.039
51
+
52
+ $this->svg_style = array(
53
+ array(
54
+ 'fill' => 'black', // mPDF 4.4.008
55
+ 'fill-opacity' => 1, // remplissage opaque par defaut
56
+ 'fill-rule' => 'nonzero', // mode de remplissage par defaut
57
+ 'stroke' => 'none', // pas de trait par defaut
58
+ 'stroke-linecap' => 'butt', // style de langle par defaut
59
+ 'stroke-linejoin' => 'miter', //
60
+ 'stroke-miterlimit' => 4, // limite de langle par defaut
61
+ 'stroke-opacity' => 1, // trait opaque par defaut
62
+ 'stroke-width' => 1, // mPDF 4.4.011
63
+ 'stroke-dasharray' => 0, // mPDF 4.4.003
64
+ 'stroke-dashoffset' => 0, // mPDF 4.4.003
65
+ 'color' => '' // mPDF 4.4.005
66
+ )
67
+ );
68
+
69
+ $this->txt_style = array(
70
+ array(
71
+ 'fill' => 'black', // pas de remplissage par defaut
72
+ 'font-family' => $mpdf->default_font,
73
+ 'font-size' => $mpdf->default_font_size, // ****** this is pts
74
+ 'font-weight' => 'normal', // normal | bold
75
+ 'font-style' => 'normal', // italic | normal
76
+ 'text-anchor' => 'start', // alignment: start, middle, end
77
+ /* mPDF 5.0.041 */
78
+ 'fill-opacity' => 1, // remplissage opaque par defaut
79
+ 'fill-rule' => 'nonzero', // mode de remplissage par defaut
80
+ 'stroke' => 'none', // pas de trait par defaut
81
+ 'stroke-opacity' => 1, // trait opaque par defaut
82
+ 'stroke-width' => 1, // mPDF 4.4.011
83
+ 'color' => '' // mPDF 4.4.005
84
+ )
85
+ );
86
+
87
+
88
+
89
+ }
90
+
91
+ function svgGradient($gradient_info, $attribs, $element){
92
+ $n = count($this->mpdf_ref->gradients)+1;
93
+
94
+ // Get bounding dimensions of element
95
+ $w = 100;
96
+ $h = 100;
97
+ $x_offset = 0;
98
+ $y_offset = 0;
99
+ if ($element=='rect') {
100
+ $w = $attribs['width'];
101
+ $h = $attribs['height'];
102
+ $x_offset = $attribs['x'];
103
+ $y_offset = $attribs['y'];
104
+ }
105
+ else if ($element=='ellipse') {
106
+ $w = $attribs['rx']*2;
107
+ $h = $attribs['ry']*2;
108
+ $x_offset = $attribs['cx']-$attribs['rx'];
109
+ $y_offset = $attribs['cy']-$attribs['ry'];
110
+ }
111
+ else if ($element=='circle') {
112
+ $w = $attribs['r']*2;
113
+ $h = $attribs['r']*2;
114
+ $x_offset = $attribs['cx']-$attribs['r'];
115
+ $y_offset = $attribs['cy']-$attribs['r'];
116
+ }
117
+ else if ($element=='polygon') {
118
+ $pts = preg_split('/[ ,]+/', trim($attribs['points']));
119
+ $maxr=$maxb=0;
120
+ $minl=$mint=999999;
121
+ for ($i=0;$i<count($pts); $i++) {
122
+ if ($i % 2 == 0) { // x values
123
+ $minl = min($minl,$pts[$i]);
124
+ $maxr = max($maxr,$pts[$i]);
125
+ }
126
+ else { // y values
127
+ $mint = min($mint,$pts[$i]);
128
+ $maxb = max($maxb,$pts[$i]);
129
+ }
130
+ }
131
+ $w = $maxr-$minl;
132
+ $h = $maxb-$mint;
133
+ $x_offset = $minl;
134
+ $y_offset = $mint;
135
+ }
136
+ else if ($element=='path') {
137
+ // mPDF 5.0.039
138
+ if (is_array($this->pathBBox) && $this->pathBBox[2]>0) {
139
+ $w = $this->pathBBox[2];
140
+ $h = $this->pathBBox[3];
141
+ $x_offset = $this->pathBBox[0];
142
+ $y_offset = $this->pathBBox[1];
143
+ }
144
+ else {
145
+ preg_match_all('/([a-z]|[A-Z])([ ,\-.\d]+)*/', $attribs['d'], $commands, PREG_SET_ORDER);
146
+ $maxr=$maxb=0;
147
+ $minl=$mint=999999;
148
+ foreach($commands as $c){
149
+ if(count($c)==3){
150
+ list($tmp, $cmd, $arg) = $c;
151
+ if ($cmd=='M' || $cmd=='L' || $cmd=='C' || $cmd=='S' || $cmd=='Q' || $cmd=='T') {
152
+ $pts = preg_split('/[ ,]+/', trim($arg));
153
+ for ($i=0;$i<count($pts); $i++) {
154
+ if ($i % 2 == 0) { // x values
155
+ $minl = min($minl,$pts[$i]);
156
+ $maxr = max($maxr,$pts[$i]);
157
+ }
158
+ else { // y values
159
+ $mint = min($mint,$pts[$i]);
160
+ $maxb = max($maxb,$pts[$i]);
161
+ }
162
+ }
163
+ }
164
+ if ($cmd=='H') { // sets new x
165
+ $minl = min($minl,$arg);
166
+ $maxr = max($maxr,$arg);
167
+ }
168
+ if ($cmd=='V') { // sets new y
169
+ $mint = min($mint,$arg);
170
+ $maxb = max($maxb,$arg);
171
+ }
172
+ }
173
+ }
174
+ $w = $maxr-$minl;
175
+ $h = $maxb-$mint;
176
+ $x_offset = $minl;
177
+ $y_offset = $mint;
178
+ }
179
+ }
180
+ if (!$w || $w==-999999) { $w = 100; }
181
+ if (!$h || $h==-999999) { $h = 100; }
182
+ if ($x_offset==999999) { $x_offset = 0; }
183
+ if ($y_offset==999999) { $y_offset = 0; }
184
+
185
+ // mPDF 4.5.010
186
+ // TRANSFORMATIONS
187
+ $transformations = '';
188
+ if (isset($gradient_info['transform'])){
189
+ preg_match_all('/(matrix|translate|scale|rotate|skewX|skewY)\((.*?)\)/is',$gradient_info['transform'],$m);
190
+ if (count($m[0])) {
191
+ for($i=0; $i<count($m[0]); $i++) {
192
+ $c = strtolower($m[1][$i]);
193
+ $v = trim($m[2][$i]);
194
+ $vv = preg_split('/[ ,]+/',$v);
195
+ if ($c=='matrix' && count($vv)==6) {
196
+ // mPDF 5.0.039
197
+ // Note angle of rotation is reversed (from SVG to PDF), so vv[1] and vv[2] are negated
198
+ // cf svgDefineStyle()
199
+ $transformations .= sprintf(' %.3F %.3F %.3F %.3F %.3F %.3F cm ', $vv[0], -$vv[1], -$vv[2], $vv[3], $vv[4]*$this->kp, -$vv[5]*$this->kp);
200
+ }
201
+ else if ($c=='translate' && count($vv)) {
202
+ $tm[4] = $vv[0];
203
+ if (count($vv)==2) { $t_y = -$vv[1]; }
204
+ else { $t_y = 0; }
205
+ $tm[5] = $t_y;
206
+ $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', $tm[4]*$this->kp, $tm[5]*$this->kp);
207
+ }
208
+ else if ($c=='scale' && count($vv)) {
209
+ if (count($vv)==2) { $s_y = $vv[1]; }
210
+ else { $s_y = $vv[0]; }
211
+ $tm[0] = $vv[0];
212
+ $tm[3] = $s_y;
213
+ $transformations .= sprintf(' %.3F 0 0 %.3F 0 0 cm ', $tm[0], $tm[3]);
214
+ }
215
+ else if ($c=='rotate' && count($vv)) {
216
+ $tm[0] = cos(deg2rad(-$vv[0]));
217
+ $tm[1] = sin(deg2rad(-$vv[0]));
218
+ $tm[2] = -$tm[1];
219
+ $tm[3] = $tm[0];
220
+ if (count($vv)==3) {
221
+ $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', $vv[1]*$this->kp, -$vv[2]*$this->kp);
222
+ }
223
+ $transformations .= sprintf(' %.3F %.3F %.3F %.3F 0 0 cm ', $tm[0], $tm[1], $tm[2], $tm[3]);
224
+ if (count($vv)==3) {
225
+ $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', -$vv[1]*$this->kp, $vv[2]*$this->kp);
226
+ }
227
+ }
228
+ else if ($c=='skewx' && count($vv)) {
229
+ $tm[2] = tan(deg2rad(-$vv[0]));
230
+ $transformations .= sprintf(' 1 0 %.3F 1 0 0 cm ', $tm[2]);
231
+ }
232
+ else if ($c=='skewy' && count($vv)) {
233
+ $tm[1] = tan(deg2rad(-$vv[0]));
234
+ $transformations .= sprintf(' 1 %.3F 0 1 0 0 cm ', $tm[1]);
235
+ }
236
+
237
+ }
238
+ }
239
+ }
240
+
241
+
242
+ $return = "";
243
+
244
+ // mPDF 5.0.039
245
+ if (isset($gradient_info['units']) && strtolower($gradient_info['units'])=='userspaceonuse') {
246
+ if ($transformations) { $return .= $transformations; }
247
+ }
248
+ // mPDF 5.0.040
249
+ $spread = 'P'; // pad
250
+ if (isset($gradient_info['spread'])) {
251
+ if (strtolower($gradient_info['spread'])=='reflect') { $spread = 'F'; } // reflect
252
+ else if (strtolower($gradient_info['spread'])=='repeat') { $spread = 'R'; } // repeat
253
+ }
254
+
255
+
256
+ for ($i=0; $i<(count($gradient_info['color'])); $i++) {
257
+ if (stristr($gradient_info['color'][$i]['offset'], '%')!== false) { $gradient_info['color'][$i]['offset'] = ($gradient_info['color'][$i]['offset']+0)/100; }
258
+ if (stristr($gradient_info['color'][($i+1)]['offset'], '%')!== false) { $gradient_info['color'][($i+1)]['offset'] = ($gradient_info['color'][($i+1)]['offset']+0)/100; }
259
+ if ($gradient_info['color'][$i]['offset']<0) { $gradient_info['color'][$i]['offset'] = 0; }
260
+ if ($gradient_info['color'][$i]['offset']>1) { $gradient_info['color'][$i]['offset'] = 1; }
261
+ if ($i>0) {
262
+ if ($gradient_info['color'][$i]['offset']<$gradient_info['color'][($i-1)]['offset']) {
263
+ $gradient_info['color'][$i]['offset']=$gradient_info['color'][($i-1)]['offset'];
264
+ }
265
+ }
266
+ }
267
+
268
+ if ($gradient_info['color'][0]['offset']>0) {
269
+ array_unshift($gradient_info['color'], $gradient_info['color'][0]);
270
+ $gradient_info['color'][0]['offset'] = 0;
271
+ }
272
+ $ns = count($gradient_info['color']);
273
+ if ($gradient_info['color'][($ns-1)]['offset']<1) {
274
+ $gradient_info['color'][] = $gradient_info['color'][($ns-1)];
275
+ $gradient_info['color'][($ns)]['offset'] = 1;
276
+ }
277
+ $ns = count($gradient_info['color']);
278
+
279
+
280
+
281
+
282
+ if ($gradient_info['type'] == 'linear'){
283
+ // mPDF 4.4.003
284
+ if (isset($gradient_info['units']) && strtolower($gradient_info['units'])=='userspaceonuse') {
285
+ if (isset($gradient_info['info']['x1'])) { $gradient_info['info']['x1'] = ($gradient_info['info']['x1']-$x_offset) / $w; }
286
+ if (isset($gradient_info['info']['y1'])) { $gradient_info['info']['y1'] = ($gradient_info['info']['y1']-$y_offset) / $h; }
287
+ if (isset($gradient_info['info']['x2'])) { $gradient_info['info']['x2'] = ($gradient_info['info']['x2']-$x_offset) / $w; }
288
+ if (isset($gradient_info['info']['y2'])) { $gradient_info['info']['y2'] = ($gradient_info['info']['y2']-$y_offset) / $h; }
289
+ }
290
+ if (isset($gradient_info['info']['x1'])) { $x1 = $gradient_info['info']['x1']; }
291
+ else { $x1 = 0; }
292
+ if (isset($gradient_info['info']['y1'])) { $y1 = $gradient_info['info']['y1']; }
293
+ else { $y1 = 0; }
294
+ if (isset($gradient_info['info']['x2'])) { $x2 = $gradient_info['info']['x2']; }
295
+ else { $x2 = 1; }
296
+ if (isset($gradient_info['info']['y2'])) { $y2 = $gradient_info['info']['y2']; }
297
+ else { $y2 = 0; }
298
+
299
+ if (stristr($x1, '%')!== false) { $x1 = ($x1+0)/100; }
300
+ if (stristr($x2, '%')!== false) { $x2 = ($x2+0)/100; }
301
+ if (stristr($y1, '%')!== false) { $y1 = ($y1+0)/100; }
302
+ if (stristr($y2, '%')!== false) { $y2 = ($y2+0)/100; }
303
+
304
+ // mPDF 5.0.042
305
+ $bboxw = $w;
306
+ $bboxh = $h;
307
+ $usex = $x_offset;
308
+ $usey = $y_offset;
309
+ $usew = $bboxw;
310
+ $useh = $bboxh;
311
+ if (isset($gradient_info['units']) && strtolower($gradient_info['units'])=='userspaceonuse') {
312
+ $angle = rad2deg(atan2(($gradient_info['info']['y2']-$gradient_info['info']['y1']), ($gradient_info['info']['x2']-$gradient_info['info']['x1'])));
313
+ if ($angle < 0) { $angle += 360; }
314
+ else if ($angle > 360) { $angle -= 360; }
315
+ if ($angle!=0 && $angle!=360 && $angle!=90 && $angle!=180 && $angle!=270) {
316
+ if ($w >= $h) {
317
+ $y1 *= $h/$w ;
318
+ $y2 *= $h/$w ;
319
+ $usew = $useh = $bboxw;
320
+ }
321
+ else {
322
+ $x1 *= $w/$h ;
323
+ $x2 *= $w/$h ;
324
+ $usew = $useh = $bboxh;
325
+ }
326
+ }
327
+ }
328
+ $a = $usew; // width
329
+ $d = -$useh; // height
330
+ $e = $usex; // x- offset
331
+ $f = -$usey; // -y-offset
332
+
333
+ $return .= sprintf('%.3F 0 0 %.3F %.3F %.3F cm ', $a*$this->kp, $d*$this->kp, $e*$this->kp, $f*$this->kp);
334
+
335
+ // mPDF 5.0.039
336
+ if (isset($gradient_info['units']) && strtolower($gradient_info['units'])=='objectboundingbox') {
337
+ if ($transformations) { $return .= $transformations; }
338
+ }
339
+
340
+ // mPDF 5.0.020
341
+ $trans = false;
342
+
343
+ // mPDF 5.0.040
344
+ if ($spread=='R' || $spread=='F') { // Repeat / Reflect
345
+ $offs = array();
346
+ for($i=0;$i<$ns;$i++) {
347
+ $offs[$i] = $gradient_info['color'][$i]['offset'];
348
+ }
349
+ $gp = 0;
350
+ $inside=true;
351
+ while($inside) {
352
+ $gp++;
353
+ for($i=0;$i<$ns;$i++) {
354
+ if ($spread=='F' && ($gp % 2) == 1) { // Reflect
355
+ $gradient_info['color'][(($ns*$gp)+$i)] = $gradient_info['color'][(($ns*($gp-1))+($ns-$i-1))];
356
+ $tmp = $gp+(1-$offs[($ns-$i-1)]) ;
357
+ $gradient_info['color'][(($ns*$gp)+$i)]['offset'] = $tmp;
358
+ }
359
+ else { // Reflect
360
+ $gradient_info['color'][(($ns*$gp)+$i)] = $gradient_info['color'][$i];
361
+ $tmp = $gp+$offs[$i] ;
362
+ $gradient_info['color'][(($ns*$gp)+$i)]['offset'] = $tmp;
363
+ }
364
+ // IF STILL INSIDE BOX OR STILL VALID
365
+ // Point on axis to test
366
+ $px1 = $x1 + ($x2-$x1)*$tmp;
367
+ $py1 = $y1 + ($y2-$y1)*$tmp;
368
+ // Get perpendicular axis
369
+ $alpha = atan2($y2-$y1, $x2-$x1);
370
+ $alpha += M_PI/2; // rotate 90 degrees
371
+ // Get arbitrary point to define line perpendicular to axis
372
+ $px2 = $px1+cos($alpha);
373
+ $py2 = $py1+sin($alpha);
374
+
375
+ $res1 = _testIntersect($px1, $py1, $px2, $py2, 0, 0, 0, 1); // $x=0 vert axis
376
+ $res2 = _testIntersect($px1, $py1, $px2, $py2, 1, 0, 1, 1); // $x=1 vert axis
377
+ $res3 = _testIntersect($px1, $py1, $px2, $py2, 0, 0, 1, 0); // $y=0 horiz axis
378
+ $res4 = _testIntersect($px1, $py1, $px2, $py2, 0, 1, 1, 1); // $y=1 horiz axis
379
+ if (!$res1 && !$res2 && !$res3 && !$res4) { $inside = false; }
380
+ }
381
+ }
382
+
383
+ $inside=true;
384
+ $gp = 0;
385
+ while($inside) {
386
+ $gp++;
387
+ $newarr = array();
388
+ for($i=0;$i<$ns;$i++) {
389
+ if ($spread=='F') { // Reflect
390
+ $newarr[$i] = $gradient_info['color'][($ns-$i-1)];
391
+ if (($gp % 2) == 1) {
392
+ $tmp = -$gp+(1-$offs[($ns-$i-1)]);
393
+ $newarr[$i]['offset'] = $tmp;
394
+ }
395
+ else {
396
+ $tmp = -$gp+$offs[$i];
397
+ $newarr[$i]['offset'] = $tmp;
398
+ }
399
+ }
400
+ else { // Reflect
401
+ $newarr[$i] = $gradient_info['color'][$i];
402
+ $tmp = -$gp+$offs[$i];
403
+ $newarr[$i]['offset'] = $tmp;
404
+ }
405
+
406
+ // IF STILL INSIDE BOX OR STILL VALID
407
+ // Point on axis to test
408
+ $px1 = $x1 + ($x2-$x1)*$tmp;
409
+ $py1 = $y1 + ($y2-$y1)*$tmp;
410
+ // Get perpendicular axis
411
+ $alpha = atan2($y2-$y1, $x2-$x1);
412
+ $alpha += M_PI/2; // rotate 90 degrees
413
+ // Get arbitrary point to define line perpendicular to axis
414
+ $px2 = $px1+cos($alpha);
415
+ $py2 = $py1+sin($alpha);
416
+
417
+ $res1 = _testIntersect($px1, $py1, $px2, $py2, 0, 0, 0, 1); // $x=0 vert axis
418
+ $res2 = _testIntersect($px1, $py1, $px2, $py2, 1, 0, 1, 1); // $x=1 vert axis
419
+ $res3 = _testIntersect($px1, $py1, $px2, $py2, 0, 0, 1, 0); // $y=0 horiz axis
420
+ $res4 = _testIntersect($px1, $py1, $px2, $py2, 0, 1, 1, 1); // $y=1 horiz axis
421
+ if (!$res1 && !$res2 && !$res3 && !$res4) { $inside = false; }
422
+ }
423
+ for($i=($ns-1);$i>=0;$i--) {
424
+ if (isset($newarr[$i]['offset'])) array_unshift($gradient_info['color'], $newarr[$i]);
425
+ }
426
+ }
427
+ }
428
+
429
+ // mPDF 4.4.007 Gradient STOPs
430
+ $stops = count($gradient_info['color']);
431
+ if ($stops < 2) { return ''; }
432
+
433
+ // mPDF 5.0.042
434
+ $range = $gradient_info['color'][count($gradient_info['color'])-1]['offset']-$gradient_info['color'][0]['offset'];
435
+ $min = $gradient_info['color'][0]['offset'];
436
+
437
+ for ($i=0; $i<($stops); $i++) {
438
+ // mPDF 5.0.051
439
+ if (!$gradient_info['color'][$i]['color']) {
440
+ if ($gradient_info['colorspace']=='RGB') $gradient_info['color'][$i]['color'] = '0 0 0';
441
+ else if ($gradient_info['colorspace']=='Gray') $gradient_info['color'][$i]['color'] = '0';
442
+ else if ($gradient_info['colorspace']=='CMYK') $gradient_info['color'][$i]['color'] = '1 1 1 1';
443
+ }
444
+ $offset = ($gradient_info['color'][$i]['offset'] - $min)/$range;
445
+ $this->mpdf_ref->gradients[$n]['stops'][] = array(
446
+ 'col' => $gradient_info['color'][$i]['color'],
447
+ 'opacity' => $gradient_info['color'][$i]['opacity'],
448
+ 'offset' => $offset);
449
+ if ($gradient_info['color'][$i]['opacity']<1) { $trans = true; }
450
+ }
451
+ $grx1 = $x1 + ($x2-$x1)*$gradient_info['color'][0]['offset'];
452
+ $gry1 = $y1 + ($y2-$y1)*$gradient_info['color'][0]['offset'];
453
+ $grx2 = $x1 + ($x2-$x1)*$gradient_info['color'][count($gradient_info['color'])-1]['offset'];
454
+ $gry2 = $y1 + ($y2-$y1)*$gradient_info['color'][count($gradient_info['color'])-1]['offset'];
455
+
456
+ $this->mpdf_ref->gradients[$n]['coords']=array($grx1, $gry1, $grx2, $gry2);
457
+
458
+ $this->mpdf_ref->gradients[$n]['colorspace'] = $gradient_info['colorspace']; // mPDF 5.0.051
459
+
460
+ $this->mpdf_ref->gradients[$n]['type'] = 2;
461
+ $this->mpdf_ref->gradients[$n]['fo'] = true;
462
+
463
+ $this->mpdf_ref->gradients[$n]['extend']=array('true','true');
464
+ if ($trans) {
465
+ $this->mpdf_ref->gradients[$n]['trans'] = true;
466
+ $return .= ' /TGS'.($n).' gs ';
467
+ }
468
+ $return .= ' /Sh'.($n).' sh ';
469
+ $return .= " Q\n";
470
+ }
471
+ else if ($gradient_info['type'] == 'radial'){
472
+ // mPDF 4.4.003
473
+ if (isset($gradient_info['units']) && strtolower($gradient_info['units'])=='userspaceonuse') {
474
+ if ($w > $h) { $h = $w; }
475
+ else { $w = $h; }
476
+ if (isset($gradient_info['info']['x0'])) { $gradient_info['info']['x0'] = ($gradient_info['info']['x0']-$x_offset) / $w; }
477
+ if (isset($gradient_info['info']['y0'])) { $gradient_info['info']['y0'] = ($gradient_info['info']['y0']-$y_offset) / $h; }
478
+ if (isset($gradient_info['info']['x1'])) { $gradient_info['info']['x1'] = ($gradient_info['info']['x1']-$x_offset) / $w; }
479
+ if (isset($gradient_info['info']['y1'])) { $gradient_info['info']['y1'] = ($gradient_info['info']['y1']-$y_offset) / $h; }
480
+ if (isset($gradient_info['info']['r'])) { $gradient_info['info']['rx'] = $gradient_info['info']['r'] / $w; }
481
+ if (isset($gradient_info['info']['r'])) { $gradient_info['info']['ry'] = $gradient_info['info']['r'] / $h; }
482
+ }
483
+
484
+ if ($gradient_info['info']['x0'] || $gradient_info['info']['x0']===0) { $x0 = $gradient_info['info']['x0']; }
485
+ else { $x0 = 0.5; }
486
+ if ($gradient_info['info']['y0'] || $gradient_info['info']['y0']===0) { $y0 = $gradient_info['info']['y0']; }
487
+ else { $y0 = 0.5; }
488
+ if ($gradient_info['info']['rx'] || $gradient_info['info']['rx']===0) { $rx = $gradient_info['info']['rx']; }
489
+ else if ($gradient_info['info']['r'] || $gradient_info['info']['r']===0) { $rx = $gradient_info['info']['r']; }
490
+ else { $rx = 0.5; }
491
+ if ($gradient_info['info']['ry'] || $gradient_info['info']['ry']===0) { $ry = $gradient_info['info']['ry']; }
492
+ else if ($gradient_info['info']['r'] || $gradient_info['info']['r']===0) { $ry = $gradient_info['info']['r']; }
493
+ else { $ry = 0.5; }
494
+ if ($gradient_info['info']['x1'] || $gradient_info['info']['x1']===0) { $x1 = $gradient_info['info']['x1']; }
495
+ else { $x1 = $x0; }
496
+ if ($gradient_info['info']['y1'] || $gradient_info['info']['y1']===0) { $y1 = $gradient_info['info']['y1']; }
497
+ else { $y1 = $y0; }
498
+
499
+ if (stristr($x1, '%')!== false) { $x1 = ($x1+0)/100; }
500
+ if (stristr($x0, '%')!== false) { $x0 = ($x0+0)/100; }
501
+ if (stristr($y1, '%')!== false) { $y1 = ($y1+0)/100; }
502
+ if (stristr($y0, '%')!== false) { $y0 = ($y0+0)/100; }
503
+ if (stristr($rx, '%')!== false) { $rx = ($rx+0)/100; }
504
+ if (stristr($ry, '%')!== false) { $ry = ($ry+0)/100; }
505
+
506
+ // mPDF 5.0.043
507
+ $bboxw = $w;
508
+ $bboxh = $h;
509
+ $usex = $x_offset;
510
+ $usey = $y_offset;
511
+ $usew = $bboxw;
512
+ $useh = $bboxh;
513
+ if (isset($gradient_info['units']) && strtolower($gradient_info['units'])=='userspaceonuse') {
514
+ $angle = rad2deg(atan2(($gradient_info['info']['y0']-$gradient_info['info']['y1']), ($gradient_info['info']['x0']-$gradient_info['info']['x1'])));
515
+ if ($angle < 0) { $angle += 360; }
516
+ else if ($angle > 360) { $angle -= 360; }
517
+ if ($angle!=0 && $angle!=360 && $angle!=90 && $angle!=180 && $angle!=270) {
518
+ if ($w >= $h) {
519
+ $y1 *= $h/$w ;
520
+ $y0 *= $h/$w ;
521
+ $rx *= $h/$w ;
522
+ $ry *= $h/$w ;
523
+ $usew = $useh = $bboxw;
524
+ }
525
+ else {
526
+ $x1 *= $w/$h ;
527
+ $x0 *= $w/$h ;
528
+ $rx *= $w/$h ;
529
+ $ry *= $w/$h ;
530
+ $usew = $useh = $bboxh;
531
+ }
532
+ }
533
+ }
534
+ $a = $usew; // width
535
+ $d = -$useh; // height
536
+ $e = $usex; // x- offset
537
+ $f = -$usey; // -y-offset
538
+
539
+ $r = $rx;
540
+
541
+
542
+ $return .= sprintf('%.3F 0 0 %.3F %.3F %.3F cm ', $a*$this->kp, $d*$this->kp, $e*$this->kp, $f*$this->kp);
543
+
544
+ // mPDF 5.0.039
545
+ if (isset($gradient_info['units']) && strtolower($gradient_info['units'])=='objectboundingbox') {
546
+ if ($transformations) { $return .= $transformations; }
547
+ }
548
+
549
+ // x1 and y1 (fx, fy) should be inside the circle defined by x0 y0 and r else error in mPDF
550
+ while (pow(($x1-$x0),2) + pow(($y1 - $y0),2) >= pow($r,2)) { $r += 0.05; }
551
+
552
+ // mPDF 5.0.040
553
+ if ($spread=='R' || $spread=='F') { // Repeat / Reflect
554
+ $offs = array();
555
+ for($i=0;$i<$ns;$i++) {
556
+ $offs[$i] = $gradient_info['color'][$i]['offset'];
557
+ }
558
+ $gp = 0;
559
+ $inside=true;
560
+ while($inside) {
561
+ $gp++;
562
+ for($i=0;$i<$ns;$i++) {
563
+ if ($spread=='F' && ($gp % 2) == 1) { // Reflect
564
+ $gradient_info['color'][(($ns*$gp)+$i)] = $gradient_info['color'][(($ns*($gp-1))+($ns-$i-1))];
565
+ $tmp = $gp+(1-$offs[($ns-$i-1)]) ;
566
+ $gradient_info['color'][(($ns*$gp)+$i)]['offset'] = $tmp;
567
+ }
568
+ else { // Reflect
569
+ $gradient_info['color'][(($ns*$gp)+$i)] = $gradient_info['color'][$i];
570
+ $tmp = $gp+$offs[$i] ;
571
+ $gradient_info['color'][(($ns*$gp)+$i)]['offset'] = $tmp;
572
+ }
573
+ // IF STILL INSIDE BOX OR STILL VALID
574
+ // TEST IF circle (perimeter) intersects with
575
+ // or is enclosed
576
+ // Point on axis to test
577
+ $px = $x1 + ($x0-$x1)*$tmp;
578
+ $py = $y1 + ($y0-$y1)*$tmp;
579
+ $pr = $r*$tmp;
580
+ $res = _testIntersectCircle($px, $py, $pr);
581
+ if (!$res) { $inside = false; }
582
+ }
583
+ }
584
+ }
585
+
586
+ // mPDF 4.4.007 Gradient STOPs
587
+ $stops = count($gradient_info['color']);
588
+ if ($stops < 2) { return ''; }
589
+
590
+ // mPDF 5.0.043
591
+ $range = $gradient_info['color'][count($gradient_info['color'])-1]['offset']-$gradient_info['color'][0]['offset'];
592
+ $min = $gradient_info['color'][0]['offset'];
593
+
594
+ for ($i=0; $i<($stops); $i++) {
595
+ // mPDF 5.0.051
596
+ if (!$gradient_info['color'][$i]['color']) {
597
+ if ($gradient_info['colorspace']=='RGB') $gradient_info['color'][$i]['color'] = '0 0 0';
598
+ else if ($gradient_info['colorspace']=='Gray') $gradient_info['color'][$i]['color'] = '0';
599
+ else if ($gradient_info['colorspace']=='CMYK') $gradient_info['color'][$i]['color'] = '1 1 1 1';
600
+ }
601
+ $offset = ($gradient_info['color'][$i]['offset'] - $min)/$range;
602
+ $this->mpdf_ref->gradients[$n]['stops'][] = array(
603
+ 'col' => $gradient_info['color'][$i]['color'],
604
+ 'opacity' => $gradient_info['color'][$i]['opacity'],
605
+ 'offset' => $offset);
606
+ if ($gradient_info['color'][$i]['opacity']<1) { $trans = true; }
607
+ }
608
+ $grx1 = $x1 + ($x0-$x1)*$gradient_info['color'][0]['offset'];
609
+ $gry1 = $y1 + ($y0-$y1)*$gradient_info['color'][0]['offset'];
610
+ $grx2 = $x1 + ($x0-$x1)*$gradient_info['color'][count($gradient_info['color'])-1]['offset'];
611
+ $gry2 = $y1 + ($y0-$y1)*$gradient_info['color'][count($gradient_info['color'])-1]['offset'];
612
+ $grir = $r*$gradient_info['color'][0]['offset'];
613
+ $grr = $r*$gradient_info['color'][count($gradient_info['color'])-1]['offset'];
614
+
615
+ $this->mpdf_ref->gradients[$n]['coords']=array($grx1, $gry1, $grx2, $gry2, abs($grr), abs($grir) );
616
+
617
+ $grx1 = $x1 + ($x0-$x1)*$first_stop;
618
+ $gry1 = $y1 + ($y0-$y1)*$first_stop;
619
+ $grx2 = $x1 + ($x0-$x1)*$last_stop;
620
+ $gry2 = $y1 + ($y0-$y1)*$last_stop;
621
+ $grir = $r*$first_stop;
622
+ $grr = $r*$last_stop;
623
+ $this->mpdf_ref->gradients[$n]['colorspace'] = $gradient_info['colorspace']; // mPDF 5.0.051
624
+
625
+ $this->mpdf_ref->gradients[$n]['type'] = 3;
626
+ $this->mpdf_ref->gradients[$n]['fo'] = true;
627
+
628
+ $this->mpdf_ref->gradients[$n]['extend']=array('true','true');
629
+ if ($trans) {
630
+ $this->mpdf_ref->gradients[$n]['trans'] = true;
631
+ $return .= ' /TGS'.($n).' gs ';
632
+ }
633
+ $return .= ' /Sh'.($n).' sh ';
634
+ $return .= " Q\n";
635
+
636
+
637
+ }
638
+
639
+ return $return;
640
+ }
641
+
642
+
643
+ function svgOffset ($attribs){
644
+ // save all <svg> tag attributes
645
+ $this->svg_attribs = $attribs;
646
+ if(isset($this->svg_attribs['viewBox'])) {
647
+ $vb = preg_split('/\s+/is', trim($this->svg_attribs['viewBox']));
648
+ if (count($vb)==4) {
649
+ $this->svg_info['x'] = $vb[0];
650
+ $this->svg_info['y'] = $vb[1];
651
+ $this->svg_info['w'] = $vb[2];
652
+ $this->svg_info['h'] = $vb[3];
653
+ // return; // mPDF 5.0.005
654
+ }
655
+ }
656
+
657
+ $svg_w = $this->mpdf_ref->ConvertSize($attribs['width']); // mm (interprets numbers as pixels)
658
+ $svg_h = $this->mpdf_ref->ConvertSize($attribs['height']); // mm
659
+
660
+ ///*
661
+ // mPDF 5.0.005
662
+ if ($this->svg_info['w']) { // if 'w' set by viewBox
663
+ if ($svg_w) { // if width also set, use these values to determine to set size of "pixel"
664
+ $this->kp *= ($svg_w/0.2645) / $this->svg_info['w'];
665
+ $this->kf = ($svg_w/0.2645) / $this->svg_info['w']; // mPDF 5.0.039
666
+ }
667
+ else if ($svg_h) {
668
+ $this->kp *= ($svg_h/0.2645) / $this->svg_info['h'];
669
+ $this->kf = ($svg_h/0.2645) / $this->svg_info['h']; // mPDF 5.0.039
670
+ }
671
+ return;
672
+ }
673
+ //*/
674
+
675
+ // Added to handle file without height or width specified
676
+ if (!$svg_w && !$svg_h) { $svg_w = $svg_h = $this->mpdf_ref->blk[$this->mpdf_ref->blklvl]['inner_width'] ; } // DEFAULT
677
+ if (!$svg_w) { $svg_w = $svg_h; }
678
+ if (!$svg_h) { $svg_h = $svg_w; }
679
+
680
+ $this->svg_info['x'] = 0;
681
+ $this->svg_info['y'] = 0;
682
+ $this->svg_info['w'] = $svg_w/0.2645; // mm->pixels
683
+ $this->svg_info['h'] = $svg_h/0.2645; // mm->pixels
684
+
685
+ }
686
+
687
+
688
+ //
689
+ // check if points are within svg, if not, set to max
690
+ function svg_overflow($x,$y)
691
+ {
692
+ $x2 = $x;
693
+ $y2 = $y;
694
+ if(isset($this->svg_attribs['overflow']))
695
+ {
696
+ if($this->svg_attribs['overflow'] == 'hidden')
697
+ {
698
+ // Not sure if this is supposed to strip off units, but since I dont use any I will omlt this step
699
+ $svg_w = preg_replace("/([0-9\.]*)(.*)/i","$1",$this->svg_attribs['width']);
700
+ $svg_h = preg_replace("/([0-9\.]*)(.*)/i","$1",$this->svg_attribs['height']);
701
+
702
+ // $xmax = floor($this->svg_attribs['width']);
703
+ $xmax = floor($svg_w);
704
+ $xmin = 0;
705
+ // $ymax = floor(($this->svg_attribs['height'] * -1));
706
+ $ymax = floor(($svg_h * -1));
707
+ $ymin = 0;
708
+
709
+ if($x > $xmax) $x2 = $xmax; // right edge
710
+ if($x < $xmin) $x2 = $xmin; // left edge
711
+ if($y < $ymax) $y2 = $ymax; // bottom
712
+ if($y > $ymin) $y2 = $ymin; // top
713
+
714
+ }
715
+ }
716
+
717
+
718
+ return array( 'x' => $x2, 'y' => $y2);
719
+ }
720
+
721
+
722
+
723
+ function svgDefineStyle($critere_style){
724
+
725
+ $tmp = count($this->svg_style)-1;
726
+ $current_style = $this->svg_style[$tmp];
727
+
728
+ unset($current_style['transformations']);
729
+
730
+ // TRANSFORM SCALE
731
+ $transformations = '';
732
+ if (isset($critere_style['transform'])){
733
+ preg_match_all('/(matrix|translate|scale|rotate|skewX|skewY)\((.*?)\)/is',$critere_style['transform'],$m);
734
+ if (count($m[0])) {
735
+ for($i=0; $i<count($m[0]); $i++) {
736
+ $c = strtolower($m[1][$i]);
737
+ $v = trim($m[2][$i]);
738
+ $vv = preg_split('/[ ,]+/',$v);
739
+ if ($c=='matrix' && count($vv)==6) {
740
+ // mPDF 5.0.039
741
+ // Note angle of rotation is reversed (from SVG to PDF), so vv[1] and vv[2] are negated
742
+ $transformations .= sprintf(' %.3F %.3F %.3F %.3F %.3F %.3F cm ', $vv[0], -$vv[1], -$vv[2], $vv[3], $vv[4]*$this->kp, -$vv[5]*$this->kp);
743
+
744
+ /*
745
+ // The long way of doing this??
746
+ // need to reverse angle of rotation from SVG to PDF
747
+ $sx=sqrt(pow($vv[0],2)+pow($vv[2],2));
748
+ if ($vv[0] < 0) { $sx *= -1; } // change sign
749
+ $sy=sqrt(pow($vv[1],2)+pow($vv[3],2));
750
+ if ($vv[3] < 0) { $sy *= -1; } // change sign
751
+
752
+ // rotation angle is
753
+ $t=atan2($vv[1],$vv[3]);
754
+ $t=atan2(-$vv[2],$vv[0]); // Should be the same value or skew has been applied
755
+
756
+ // Reverse angle
757
+ $t *= -1;
758
+
759
+ // Rebuild matrix
760
+ $ma = $sx * cos($t);
761
+ $mb = $sy * sin($t);
762
+ $mc = -$sx * sin($t);
763
+ $md = $sy * cos($t);
764
+
765
+ // $transformations .= sprintf(' %.3F %.3F %.3F %.3F %.3F %.3F cm ', $ma, $mb, $mc, $md, $vv[4]*$this->kp, -$vv[5]*$this->kp);
766
+ */
767
+
768
+ }
769
+ else if ($c=='translate' && count($vv)) {
770
+ $tm[4] = $vv[0];
771
+ if (count($vv)==2) { $t_y = -$vv[1]; }
772
+ else { $t_y = 0; }
773
+ $tm[5] = $t_y;
774
+ $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', $tm[4]*$this->kp, $tm[5]*$this->kp);
775
+ }
776
+ else if ($c=='scale' && count($vv)) {
777
+ if (count($vv)==2) { $s_y = $vv[1]; }
778
+ else { $s_y = $vv[0]; }
779
+ $tm[0] = $vv[0];
780
+ $tm[3] = $s_y;
781
+ $transformations .= sprintf(' %.3F 0 0 %.3F 0 0 cm ', $tm[0], $tm[3]);
782
+ }
783
+ else if ($c=='rotate' && count($vv)) {
784
+ $tm[0] = cos(deg2rad(-$vv[0]));
785
+ $tm[1] = sin(deg2rad(-$vv[0]));
786
+ $tm[2] = -$tm[1];
787
+ $tm[3] = $tm[0];
788
+ if (count($vv)==3) {
789
+ $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', $vv[1]*$this->kp, -$vv[2]*$this->kp);
790
+ }
791
+ $transformations .= sprintf(' %.3F %.3F %.3F %.3F 0 0 cm ', $tm[0], $tm[1], $tm[2], $tm[3]);
792
+ if (count($vv)==3) {
793
+ $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', -$vv[1]*$this->kp, $vv[2]*$this->kp);
794
+ }
795
+ }
796
+ else if ($c=='skewx' && count($vv)) {
797
+ $tm[2] = tan(deg2rad(-$vv[0]));
798
+ $transformations .= sprintf(' 1 0 %.3F 1 0 0 cm ', $tm[2]);
799
+ }
800
+ else if ($c=='skewy' && count($vv)) {
801
+ $tm[1] = tan(deg2rad(-$vv[0]));
802
+ $transformations .= sprintf(' 1 %.3F 0 1 0 0 cm ', $tm[1]);
803
+ }
804
+
805
+ }
806
+ }
807
+ $current_style['transformations'] = $transformations;
808
+ }
809
+
810
+ if (isset($critere_style['style'])){
811
+ if (preg_match('/fill:\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)/',$critere_style['style'], $m)) {
812
+ $current_style['fill'] = '#'.str_pad(dechex($m[1]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[2]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[3]), 2, "0", STR_PAD_LEFT);
813
+ }
814
+ else { $tmp = preg_replace("/(.*)fill:\s*([a-z0-9#_()]*|none)(.*)/i","$2",$critere_style['style']); // mPDF 4.4.003
815
+ if ($tmp != $critere_style['style']){ $current_style['fill'] = $tmp; }
816
+ }
817
+
818
+ $tmp = preg_replace("/(.*)fill-opacity:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
819
+ if ($tmp != $critere_style['style']){ $current_style['fill-opacity'] = $tmp;}
820
+
821
+ $tmp = preg_replace("/(.*)fill-rule:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
822
+ if ($tmp != $critere_style['style']){ $current_style['fill-rule'] = $tmp;}
823
+
824
+ if (preg_match('/stroke:\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)/',$critere_style['style'], $m)) {
825
+ $current_style['stroke'] = '#'.str_pad(dechex($m[1]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[2]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[3]), 2, "0", STR_PAD_LEFT);
826
+ }
827
+ else { $tmp = preg_replace("/(.*)stroke:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
828
+ if ($tmp != $critere_style['style']){ $current_style['stroke'] = $tmp; }
829
+ }
830
+
831
+ $tmp = preg_replace("/(.*)stroke-linecap:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
832
+ if ($tmp != $critere_style['style']){ $current_style['stroke-linecap'] = $tmp;}
833
+
834
+ $tmp = preg_replace("/(.*)stroke-linejoin:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
835
+ if ($tmp != $critere_style['style']){ $current_style['stroke-linejoin'] = $tmp;}
836
+
837
+ $tmp = preg_replace("/(.*)stroke-miterlimit:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
838
+ if ($tmp != $critere_style['style']){ $current_style['stroke-miterlimit'] = $tmp;}
839
+
840
+ $tmp = preg_replace("/(.*)stroke-opacity:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
841
+ if ($tmp != $critere_style['style']){ $current_style['stroke-opacity'] = $tmp; }
842
+
843
+ $tmp = preg_replace("/(.*)stroke-width:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
844
+ if ($tmp != $critere_style['style']){ $current_style['stroke-width'] = $tmp;}
845
+
846
+ // mPDF 4.4.003
847
+ $tmp = preg_replace("/(.*)stroke-dasharray:\s*([a-z0-9., ]*|none)(.*)/i","$2",$critere_style['style']);
848
+ if ($tmp != $critere_style['style']){ $current_style['stroke-dasharray'] = $tmp;}
849
+
850
+ // mPDF 4.4.003
851
+ $tmp = preg_replace("/(.*)stroke-dashoffset:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
852
+ if ($tmp != $critere_style['style']){ $current_style['stroke-dashoffset'] = $tmp;}
853
+
854
+ }
855
+ if(isset($critere_style['fill'])){
856
+ $current_style['fill'] = $critere_style['fill'];
857
+ }
858
+
859
+ if(isset($critere_style['fill-opacity'])){
860
+ $current_style['fill-opacity'] = $critere_style['fill-opacity'];
861
+ }
862
+
863
+ if(isset($critere_style['fill-rule'])){
864
+ $current_style['fill-rule'] = $critere_style['fill-rule'];
865
+ }
866
+
867
+ if(isset($critere_style['stroke'])){
868
+ $current_style['stroke'] = $critere_style['stroke'];
869
+ }
870
+
871
+ if(isset($critere_style['stroke-linecap'])){
872
+ $current_style['stroke-linecap'] = $critere_style['stroke-linecap'];
873
+ }
874
+
875
+ if(isset($critere_style['stroke-linejoin'])){
876
+ $current_style['stroke-linejoin'] = $critere_style['stroke-linejoin'];
877
+ }
878
+
879
+ if(isset($critere_style['stroke-miterlimit'])){
880
+ $current_style['stroke-miterlimit'] = $critere_style['stroke-miterlimit'];
881
+ }
882
+
883
+ if(isset($critere_style['stroke-opacity'])){
884
+ $current_style['stroke-opacity'] = $critere_style['stroke-opacity'];
885
+ }
886
+
887
+ if(isset($critere_style['stroke-width'])){
888
+ $current_style['stroke-width'] = $critere_style['stroke-width'];
889
+ }
890
+
891
+ // mPDF 4.4.003
892
+ if(isset($critere_style['stroke-dasharray'])){
893
+ $current_style['stroke-dasharray'] = $critere_style['stroke-dasharray'];
894
+ }
895
+ if(isset($critere_style['stroke-dashoffset'])){
896
+ $current_style['stroke-dashoffset'] = $critere_style['stroke-dashoffset'];
897
+ }
898
+
899
+ // mPDF 4.4.005 Used as indirect setting for currentColor
900
+ if(isset($critere_style['color']) && $critere_style['color'] != 'inherit'){
901
+ $current_style['color'] = $critere_style['color'];
902
+ }
903
+
904
+ return $current_style;
905
+
906
+ }
907
+
908
+ //
909
+ // Cette fonction ecrit le style dans le stream svg.
910
+ function svgStyle($critere_style, $attribs, $element){
911
+ $path_style = '';
912
+ if (substr_count($critere_style['fill'],'url')>0){
913
+ //
914
+ // couleur degrad�
915
+ $id_gradient = preg_replace("/url\(#([\w_]*)\)/i","$1",$critere_style['fill']);
916
+ if ($id_gradient != $critere_style['fill']) {
917
+ if (isset($this->svg_gradient[$id_gradient])) {
918
+ $fill_gradient = $this->svgGradient($this->svg_gradient[$id_gradient], $attribs, $element);
919
+ if ($fill_gradient) { // mPDF 4.4.003
920
+ $path_style = "q ";
921
+ $w = "W";
922
+ $style .= 'N';
923
+ }
924
+ }
925
+ }
926
+
927
+ }
928
+ // mPDF 4.4.005 Used as indirect setting for currentColor
929
+ else if (strtolower($critere_style['fill']) == 'currentcolor'){
930
+ $col = $this->mpdf_ref->ConvertColor($critere_style['color']);
931
+ if ($col) {
932
+ // mPDF 5.0.051
933
+ // mPDF 5.3.74
934
+ if ($col{0}==5) { $critere_style['fill-opacity'] = ord($col{4}/100); } // RGBa
935
+ if ($col{0}==6) { $critere_style['fill-opacity'] = ord($col{5}/100); } // CMYKa
936
+ $path_style .= $this->mpdf_ref->SetFColor($col, true).' '; // mPDF 5.0.051
937
+ $style .= 'F';
938
+ }
939
+ }
940
+ else if ($critere_style['fill'] != 'none'){
941
+ $col = $this->mpdf_ref->ConvertColor($critere_style['fill']);
942
+ if ($col) {
943
+ // mPDF 5.0.051
944
+ // mPDF 5.3.74
945
+ if ($col{0}==5) { $critere_style['fill-opacity'] = ord($col{4}/100); } // RGBa
946
+ if ($col{0}==6) { $critere_style['fill-opacity'] = ord($col{5}/100); } // CMYKa
947
+ $path_style .= $this->mpdf_ref->SetFColor($col, true).' '; // mPDF 5.0.051
948
+ $style .= 'F';
949
+ }
950
+ }
951
+
952
+ // mPDF 5.0.040
953
+ if (substr_count($critere_style['stroke'],'url')>0){
954
+ /*
955
+ // Cannot put a gradient on a "stroke" in PDF?
956
+ $id_gradient = preg_replace("/url\(#([\w_]*)\)/i","$1",$critere_style['stroke']);
957
+ if ($id_gradient != $critere_style['stroke']) {
958
+ if (isset($this->svg_gradient[$id_gradient])) {
959
+ $fill_gradient = $this->svgGradient($this->svg_gradient[$id_gradient], $attribs, $element);
960
+ if ($fill_gradient) {
961
+ $path_style = "q ";
962
+ $w = "W";
963
+ $style .= 'D';
964
+ }
965
+ }
966
+ }
967
+ */
968
+ }
969
+ // mPDF 4.4.005 Used as indirect setting for currentColor
970
+ else if (strtolower($critere_style['stroke']) == 'currentcolor'){
971
+ $col = $this->mpdf_ref->ConvertColor($critere_style['color']);
972
+ if ($col) {
973
+ // mPDF 5.0.051
974
+ // mPDF 5.3.74
975
+ if ($col{0}==5) { $critere_style['stroke-opacity'] = ord($col{4}/100); } // RGBa
976
+ if ($col{0}==6) { $critere_style['stroke-opacity'] = ord($col{5}/100); } // CMYKa
977
+ $path_style .= $this->mpdf_ref->SetDColor($col, true).' '; // mPDF 5.0.051
978
+ $style .= 'D';
979
+ $lw = $this->ConvertSVGSizePixels($critere_style['stroke-width']);
980
+ $path_style .= sprintf('%.3F w ',$lw*$this->kp);
981
+ }
982
+ }
983
+ else if ($critere_style['stroke'] != 'none'){
984
+ $col = $this->mpdf_ref->ConvertColor($critere_style['stroke']);
985
+ if ($col) {
986
+ // mPDF 5.0.051
987
+ // mPDF 5.3.74
988
+ if ($col{0}==5) { $critere_style['stroke-opacity'] = ord($col{4}/100); } // RGBa
989
+ if ($col{0}==6) { $critere_style['stroke-opacity'] = ord($col{5}/100); } // CMYKa
990
+ $path_style .= $this->mpdf_ref->SetDColor($col, true).' '; // mPDF 5.0.051
991
+ $style .= 'D';
992
+ $lw = $this->ConvertSVGSizePixels($critere_style['stroke-width']); // mPDF 4.4.003
993
+ $path_style .= sprintf('%.3F w ',$lw*$this->kp);
994
+ }
995
+ }
996
+
997
+
998
+ if ($critere_style['stroke'] != 'none'){
999
+ if ($critere_style['stroke-linejoin'] == 'miter'){
1000
+ $path_style .= ' 0 j ';
1001
+ }
1002
+ else if ($critere_style['stroke-linejoin'] == 'round'){
1003
+ $path_style .= ' 1 j ';
1004
+ }
1005
+ else if ($critere_style['stroke-linejoin'] == 'bevel'){
1006
+ $path_style .= ' 2 j ';
1007
+ }
1008
+
1009
+ if ($critere_style['stroke-linecap'] == 'butt'){
1010
+ $path_style .= ' 0 J ';
1011
+ }
1012
+ else if ($critere_style['stroke-linecap'] == 'round'){
1013
+ $path_style .= ' 1 J ';
1014
+ }
1015
+ else if ($critere_style['stroke-linecap'] == 'square'){
1016
+ $path_style .= ' 2 J ';
1017
+ }
1018
+
1019
+ if (isset($critere_style['stroke-miterlimit'])){
1020
+ if ($critere_style['stroke-miterlimit'] == 'none'){
1021
+ }
1022
+ else if (preg_match('/^[\d.]+$/',$critere_style['stroke-miterlimit'])) {
1023
+ $path_style .= sprintf('%.2F M ',$critere_style['stroke-miterlimit']);
1024
+ }
1025
+ }
1026
+ // mPDF 4.4.003
1027
+ if (isset($critere_style['stroke-dasharray'])){
1028
+ $off = 0;
1029
+ $d = preg_split('/[ ,]/',$critere_style['stroke-dasharray']);
1030
+ if (count($d) == 1 && $d[0]==0) {
1031
+ $path_style .= '[] 0 d ';
1032
+ }
1033
+ else {
1034
+ if (count($d) % 2 == 1) { $d = array_merge($d, $d); } // 5, 3, 1 => 5,3,1,5,3,1 OR 3 => 3,3
1035
+ $arr = '';
1036
+ for($i=0; $i<count($d); $i+=2) {
1037
+ $arr .= sprintf('%.3F %.3F ', $d[$i]*$this->kp, $d[$i+1]*$this->kp);
1038
+ }
1039
+ if (isset($critere_style['stroke-dashoffset'])){ $off = $critere_style['stroke-dashoffset'] + 0; }
1040
+ $path_style .= sprintf('[%s] %.3F d ', $arr, $off*$this->kp);
1041
+ }
1042
+ }
1043
+ }
1044
+
1045
+ // mPDF 4.4.003
1046
+ if ($critere_style['fill-rule']=='evenodd') { $fr = '*'; }
1047
+ else { $fr = ''; }
1048
+
1049
+ // mPDF 4.4.003
1050
+ if (isset($critere_style['fill-opacity'])) {
1051
+ $opacity = 1;
1052
+ if ($critere_style['fill-opacity'] == 0) { $opacity = 0; }
1053
+ else if ($critere_style['fill-opacity'] > 1) { $opacity = 1; }
1054
+ else if ($critere_style['fill-opacity'] > 0) { $opacity = $critere_style['fill-opacity']; }
1055
+ else if ($critere_style['fill-opacity'] < 0) { $opacity = 0; }
1056
+ $gs = $this->mpdf_ref->AddExtGState(array('ca'=>$opacity, 'BM'=>'/Normal'));
1057
+ $this->mpdf_ref->extgstates[$gs]['fo'] = true; // mPDF 5.0.039
1058
+ $path_style .= sprintf(' /GS%d gs ', $gs);
1059
+ }
1060
+
1061
+ // mPDF 4.4.003
1062
+ if (isset($critere_style['stroke-opacity'])) {
1063
+ $opacity = 1;
1064
+ if ($critere_style['stroke-opacity'] == 0) { $opacity = 0; }
1065
+ else if ($critere_style['stroke-opacity'] > 1) { $opacity = 1; }
1066
+ else if ($critere_style['stroke-opacity'] > 0) { $opacity = $critere_style['stroke-opacity']; }
1067
+ else if ($critere_style['stroke-opacity'] < 0) { $opacity = 0; }
1068
+ $gs = $this->mpdf_ref->AddExtGState(array('CA'=>$opacity, 'BM'=>'/Normal'));
1069
+ $this->mpdf_ref->extgstates[$gs]['fo'] = true; // mPDF 5.0.039
1070
+ $path_style .= sprintf(' /GS%d gs ', $gs);
1071
+ }
1072
+
1073
+ switch ($style){
1074
+ case 'F':
1075
+ $op = 'f';
1076
+ break;
1077
+ case 'FD':
1078
+ $op = 'B';
1079
+ break;
1080
+ case 'ND':
1081
+ $op = 'S';
1082
+ break;
1083
+ case 'D':
1084
+ $op = 'S';
1085
+ break;
1086
+ default:
1087
+ $op = 'n';
1088
+ }
1089
+
1090
+ // mPDF 5.0
1091
+ $prestyle = $path_style.' ';
1092
+ $poststyle = $w.' '. $op.$fr.' '.$fill_gradient."\n";
1093
+ return array($prestyle,$poststyle);
1094
+
1095
+ }
1096
+
1097
+ //
1098
+ // fonction retracant les <path />
1099
+ function svgPath($command, $arguments){
1100
+ $path_cmd = '';
1101
+ $newsubpath = false; // mPDF 4.4.003
1102
+ // mPDF 5.0.039
1103
+ $minl = $this->pathBBox[0];
1104
+ $mint = $this->pathBBox[1];
1105
+ $maxr = $this->pathBBox[2]+$this->pathBBox[0];
1106
+ $maxb = $this->pathBBox[3]+$this->pathBBox[1];
1107
+ // mPDF 5.0.040
1108
+ $start = array($this->xbase, -$this->ybase);
1109
+
1110
+ // mPDF 4.4.003
1111
+ preg_match_all('/[\-^]?[\d.]+(e[\-]?[\d]+){0,1}/i', $arguments, $a, PREG_SET_ORDER);
1112
+
1113
+ // if the command is a capital letter, the coords go absolute, otherwise relative
1114
+ if(strtolower($command) == $command) $relative = true;
1115
+ else $relative = false;
1116
+
1117
+
1118
+ $ile_argumentow = count($a);
1119
+
1120
+ // each command may have different needs for arguments [1 to 8]
1121
+
1122
+ switch(strtolower($command)){
1123
+ case 'm': // move
1124
+ for($i = 0; $i<$ile_argumentow; $i+=2){
1125
+ $x = $a[$i][0];
1126
+ $y = $a[$i+1][0];
1127
+ if($relative){
1128
+ $pdfx = ($this->xbase + $x);
1129
+ $pdfy = ($this->ybase - $y);
1130
+ $this->xbase += $x;
1131
+ $this->ybase += -$y;
1132
+ }
1133
+ else{
1134
+ $pdfx = $x;
1135
+ $pdfy = -$y ;
1136
+ $this->xbase = $x;
1137
+ $this->ybase = -$y;
1138
+ }
1139
+ $pdf_pt = $this->svg_overflow($pdfx,$pdfy);
1140
+ // mPDF 5.0.039
1141
+ $minl = min($minl,$pdf_pt['x']);
1142
+ $maxr = max($maxr,$pdf_pt['x']);
1143
+ $mint = min($mint,-$pdf_pt['y']);
1144
+ $maxb = max($maxb,-$pdf_pt['y']);
1145
+ if($i == 0) $path_cmd .= sprintf('%.3F %.3F m ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1146
+ else $path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1147
+ // mPDF 4.4.003 Save start points of subpath
1148
+ if ($this->subPathInit) {
1149
+ $this->spxstart = $this->xbase;
1150
+ $this->spystart = $this->ybase;
1151
+ $this->subPathInit = false;
1152
+ }
1153
+ }
1154
+ break;
1155
+ case 'l': // a simple line
1156
+ for($i = 0; $i<$ile_argumentow; $i+=2){
1157
+ $x = ($a[$i][0]);
1158
+ $y = ($a[$i+1][0]);
1159
+ if($relative){
1160
+ $pdfx = ($this->xbase + $x);
1161
+ $pdfy = ($this->ybase - $y);
1162
+ $this->xbase += $x;
1163
+ $this->ybase += -$y;
1164
+ }
1165
+ else{
1166
+ $pdfx = $x ;
1167
+ $pdfy = -$y ;
1168
+ $this->xbase = $x;
1169
+ $this->ybase = -$y;
1170
+ }
1171
+ $pdf_pt = $this->svg_overflow($pdfx,$pdfy);
1172
+ // mPDF 5.0.039
1173
+ $minl = min($minl,$pdf_pt['x']);
1174
+ $maxr = max($maxr,$pdf_pt['x']);
1175
+ $mint = min($mint,-$pdf_pt['y']);
1176
+ $maxb = max($maxb,-$pdf_pt['y']);
1177
+ $path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1178
+ }
1179
+ break;
1180
+ case 'h': // a very simple horizontal line
1181
+ for($i = 0; $i<$ile_argumentow; $i++){
1182
+ $x = ($a[$i][0]);
1183
+ if($relative){
1184
+ $y = 0;
1185
+ $pdfx = ($this->xbase + $x) ;
1186
+ $pdfy = ($this->ybase - $y) ;
1187
+ $this->xbase += $x;
1188
+ $this->ybase += -$y;
1189
+ }
1190
+ else{
1191
+ $y = -$this->ybase;
1192
+ $pdfx = $x;
1193
+ $pdfy = -$y;
1194
+ $this->xbase = $x;
1195
+ $this->ybase = -$y;
1196
+ }
1197
+ $pdf_pt = $this->svg_overflow($pdfx,$pdfy);
1198
+ // mPDF 5.0.039
1199
+ $minl = min($minl,$pdf_pt['x']);
1200
+ $maxr = max($maxr,$pdf_pt['x']);
1201
+ $mint = min($mint,-$pdf_pt['y']);
1202
+ $maxb = max($maxb,-$pdf_pt['y']);
1203
+ $path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1204
+ }
1205
+ break;
1206
+ case 'v': // the simplest line, vertical
1207
+ for($i = 0; $i<$ile_argumentow; $i++){
1208
+ $y = ($a[$i][0]);
1209
+ if($relative){
1210
+ $x = 0;
1211
+ $pdfx = ($this->xbase + $x);
1212
+ $pdfy = ($this->ybase - $y);
1213
+ $this->xbase += $x;
1214
+ $this->ybase += -$y;
1215
+ }
1216
+ else{
1217
+ $x = $this->xbase;
1218
+ $pdfx = $x;
1219
+ $pdfy = -$y;
1220
+ $this->xbase = $x;
1221
+ $this->ybase = -$y;
1222
+ }
1223
+ $pdf_pt = $this->svg_overflow($pdfx,$pdfy);
1224
+ // mPDF 5.0.039
1225
+ $minl = min($minl,$pdf_pt['x']);
1226
+ $maxr = max($maxr,$pdf_pt['x']);
1227
+ $mint = min($mint,-$pdf_pt['y']);
1228
+ $maxb = max($maxb,-$pdf_pt['y']);
1229
+ $path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1230
+ }
1231
+ break;
1232
+ case 's': // bezier with first vertex equal first control
1233
+ // mPDF 4.4.003
1234
+ if (!($this->lastcommand == 'C' || $this->lastcommand == 'c' || $this->lastcommand == 'S' || $this->lastcommand == 's')) {
1235
+ $this->lastcontrolpoints = array(0,0);
1236
+ }
1237
+ for($i = 0; $i<$ile_argumentow; $i += 4){
1238
+ $x1 = $this->lastcontrolpoints[0];
1239
+ $y1 = $this->lastcontrolpoints[1];
1240
+ $x2 = ($a[$i][0]);
1241
+ $y2 = ($a[$i+1][0]);
1242
+ $x = ($a[$i+2][0]);
1243
+ $y = ($a[$i+3][0]);
1244
+ if($relative){
1245
+ $pdfx1 = ($this->xbase + $x1);
1246
+ $pdfy1 = ($this->ybase - $y1);
1247
+ $pdfx2 = ($this->xbase + $x2);
1248
+ $pdfy2 = ($this->ybase - $y2);
1249
+ $pdfx = ($this->xbase + $x);
1250
+ $pdfy = ($this->ybase - $y);
1251
+ $this->xbase += $x;
1252
+ $this->ybase += -$y;
1253
+ }
1254
+ else{
1255
+ $pdfx1 = $this->xbase + $x1;
1256
+ $pdfy1 = $this->ybase -$y1;
1257
+ $pdfx2 = $x2;
1258
+ $pdfy2 = -$y2;
1259
+ $pdfx = $x;
1260
+ $pdfy = -$y;
1261
+ $this->xbase = $x;
1262
+ $this->ybase = -$y;
1263
+ }
1264
+ $this->lastcontrolpoints = array(($pdfx-$pdfx2),-($pdfy-$pdfy2)); // mPDF 4.4.003 always relative
1265
+
1266
+ $pdf_pt = $this->svg_overflow($pdfx,$pdfy);
1267
+
1268
+ // mPDF 5.0.040
1269
+ $curves = array($pdfx1,-$pdfy1,$pdfx2,-$pdfy2,$pdfx,-$pdfy);
1270
+ $bx = calc_bezier_bbox($start, $curves);
1271
+ $minl = min($minl,$bx[0]);
1272
+ $maxr = max($maxr,$bx[2]);
1273
+ $mint = min($mint,$bx[1]);
1274
+ $maxb = max($maxb,$bx[3]);
1275
+
1276
+ if( ($pdf_pt['x'] != $pdfx) || ($pdf_pt['y'] != $pdfy) )
1277
+ {
1278
+ $path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1279
+ }
1280
+ else
1281
+ {
1282
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1*$this->kp, $pdfy1*$this->kp, $pdfx2*$this->kp, $pdfy2*$this->kp, $pdfx*$this->kp, $pdfy*$this->kp);
1283
+ }
1284
+
1285
+ }
1286
+ break;
1287
+ case 'c': // bezier with second vertex equal second control
1288
+ for($i = 0; $i<$ile_argumentow; $i += 6){
1289
+ $x1 = ($a[$i][0]);
1290
+ $y1 = ($a[$i+1][0]);
1291
+ $x2 = ($a[$i+2][0]);
1292
+ $y2 = ($a[$i+3][0]);
1293
+ $x = ($a[$i+4][0]);
1294
+ $y = ($a[$i+5][0]);
1295
+
1296
+
1297
+ if($relative){
1298
+ $pdfx1 = ($this->xbase + $x1);
1299
+ $pdfy1 = ($this->ybase - $y1);
1300
+ $pdfx2 = ($this->xbase + $x2);
1301
+ $pdfy2 = ($this->ybase - $y2);
1302
+ $pdfx = ($this->xbase + $x);
1303
+ $pdfy = ($this->ybase - $y);
1304
+ $this->xbase += $x;
1305
+ $this->ybase += -$y;
1306
+ }
1307
+ else{
1308
+ $pdfx1 = $x1;
1309
+ $pdfy1 = -$y1;
1310
+ $pdfx2 = $x2;
1311
+ $pdfy2 = -$y2;
1312
+ $pdfx = $x;
1313
+ $pdfy = -$y;
1314
+ $this->xbase = $x;
1315
+ $this->ybase = -$y;
1316
+ }
1317
+ $this->lastcontrolpoints = array(($pdfx-$pdfx2),-($pdfy-$pdfy2)); // mPDF 4.4.003 always relative
1318
+ // $pdf_pt2 = $this->svg_overflow($pdfx2,$pdfy2);
1319
+ // $pdf_pt1 = $this->svg_overflow($pdfx1,$pdfy1);
1320
+ $pdf_pt = $this->svg_overflow($pdfx,$pdfy);
1321
+
1322
+ // mPDF 5.0.040
1323
+ $curves = array($pdfx1,-$pdfy1,$pdfx2,-$pdfy2,$pdfx,-$pdfy);
1324
+ $bx = calc_bezier_bbox($start, $curves);
1325
+ $minl = min($minl,$bx[0]);
1326
+ $maxr = max($maxr,$bx[2]);
1327
+ $mint = min($mint,$bx[1]);
1328
+ $maxb = max($maxb,$bx[3]);
1329
+
1330
+ if( ($pdf_pt['x'] != $pdfx) || ($pdf_pt['y'] != $pdfy) )
1331
+ {
1332
+ $path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1333
+ }
1334
+ else
1335
+ {
1336
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1*$this->kp, $pdfy1*$this->kp, $pdfx2*$this->kp, $pdfy2*$this->kp, $pdfx*$this->kp, $pdfy*$this->kp);
1337
+ }
1338
+
1339
+ }
1340
+ break;
1341
+
1342
+ case 'q': // bezier quadratic avec point de control
1343
+ for($i = 0; $i<$ile_argumentow; $i += 4){
1344
+ $x1 = ($a[$i][0]);
1345
+ $y1 = ($a[$i+1][0]);
1346
+ $x = ($a[$i+2][0]);
1347
+ $y = ($a[$i+3][0]);
1348
+ if($relative){
1349
+ $pdfx = ($this->xbase + $x);
1350
+ $pdfy = ($this->ybase - $y);
1351
+
1352
+ $pdfx1 = ($this->xbase + ($x1*2/3));
1353
+ $pdfy1 = ($this->ybase - ($y1*2/3));
1354
+ // mPDF 4.4.003
1355
+ $pdfx2 = $pdfx1 + 1/3 *($x);
1356
+ $pdfy2 = $pdfy1 + 1/3 *(-$y) ;
1357
+
1358
+ $this->xbase += $x;
1359
+ $this->ybase += -$y;
1360
+ }
1361
+ else{
1362
+ $pdfx = $x;
1363
+ $pdfy = -$y;
1364
+
1365
+ $pdfx1 = ($this->xbase+(($x1-$this->xbase)*2/3));
1366
+ $pdfy1 = ($this->ybase-(($y1+$this->ybase)*2/3));
1367
+
1368
+ $pdfx2 = ($x+(($x1-$x)*2/3));
1369
+ $pdfy2 = (-$y-(($y1-$y)*2/3));
1370
+
1371
+ // mPDF 4.4.003
1372
+ $pdfx2 = $pdfx1 + 1/3 *($x - $this->xbase);
1373
+ $pdfy2 = $pdfy1 + 1/3 *(-$y - $this->ybase) ;
1374
+
1375
+ $this->xbase = $x;
1376
+ $this->ybase = -$y;
1377
+ }
1378
+ $this->lastcontrolpoints = array(($pdfx-$pdfx2),-($pdfy-$pdfy2)); // mPDF 4.4.003 always relative
1379
+
1380
+ $pdf_pt = $this->svg_overflow($pdfx,$pdfy);
1381
+
1382
+ // mPDF 5.0.040
1383
+ $curves = array($pdfx1,-$pdfy1,$pdfx2,-$pdfy2,$pdfx,-$pdfy);
1384
+ $bx = calc_bezier_bbox($start, $curves);
1385
+ $minl = min($minl,$bx[0]);
1386
+ $maxr = max($maxr,$bx[2]);
1387
+ $mint = min($mint,$bx[1]);
1388
+ $maxb = max($maxb,$bx[3]);
1389
+
1390
+ if( ($pdf_pt['x'] != $pdfx) || ($pdf_pt['y'] != $pdfy) )
1391
+ {
1392
+ $path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x']*$this->kp, $pdf_pt['y']*$this->kp);
1393
+ }
1394
+ else
1395
+ {
1396
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1*$this->kp, $pdfy1*$this->kp, $pdfx2*$this->kp, $pdfy2*$this->kp, $pdfx*$this->kp, $pdfy*$this->kp);
1397
+ }
1398
+ }
1399
+ break;
1400
+ case 't': // bezier quadratic avec point de control simetrique a lancien point de control
1401
+ // mPDF 4.4.003
1402
+ if (!($this->lastcommand == 'Q' || $this->lastcommand == 'q' || $this->lastcommand == 'T' || $this->lastcommand == 't')) {
1403
+ $this->lastcontrolpoints = array(0,0);
1404
+ }
1405
+ for($i = 0; $i<$ile_argumentow; $i += 2){
1406
+ $x = ($a[$i][0]);
1407
+ $y = ($a[$i+1][0]);
1408
+
1409
+ $x1 = $this->lastcontrolpoints[0];
1410
+ $y1 = $this->lastcontrolpoints[1];
1411
+
1412
+ if($relative){
1413
+ $pdfx = ($this->xbase + $x);
1414
+ $pdfy = ($this->ybase - $y);
1415
+
1416
+ $pdfx1 = ($this->xbase + ($x1)); // mPDF 4.4.003
1417
+ $pdfy1 = ($this->ybase - ($y1)); // mPDF 4.4.003
1418
+ // mPDF 4.4.003
1419
+ $pdfx2 = $pdfx1 + 1/3 *($x);
1420
+ $pdfy2 = $pdfy1 + 1/3 *(-$y) ;
1421
+
1422
+ $this->xbase += $x;
1423
+ $this->ybase += -$y;
1424
+ }
1425
+ else{
1426
+ $pdfx = $x;
1427
+ $pdfy = -$y;
1428
+
1429
+ $pdfx1 = ($this->xbase + ($x1)); // mPDF 4.4.003
1430
+ $pdfy1 = ($this->ybase - ($y1)); // mPDF 4.4.003
1431
+ // mPDF 4.4.003
1432
+ $pdfx2 = $pdfx1 + 1/3 *($x - $this->xbase);
1433
+ $pdfy2 = $pdfy1 + 1/3 *(-$y - $this->ybase) ;
1434
+
1435
+ $this->xbase = $x;
1436
+ $this->ybase = -$y;
1437
+ }
1438
+
1439
+ $this->lastcontrolpoints = array(($pdfx-$pdfx2),-($pdfy-$pdfy2)); // mPDF 4.4.003 always relative
1440
+
1441
+ // mPDF 5.0.040
1442
+ $curves = array($pdfx1,-$pdfy1,$pdfx2,-$pdfy2,$pdfx,-$pdfy);
1443
+ $bx = calc_bezier_bbox($start, $curves);
1444
+ $minl = min($minl,$bx[0]);
1445
+ $maxr = max($maxr,$bx[2]);
1446
+ $mint = min($mint,$bx[1]);
1447
+ $maxb = max($maxb,$bx[3]);
1448
+
1449
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1*$this->kp, $pdfy1*$this->kp, $pdfx2*$this->kp, $pdfy2*$this->kp, $pdfx*$this->kp, $pdfy*$this->kp);
1450
+ }
1451
+
1452
+ break;
1453
+ case 'a': // Elliptical arc
1454
+ for($i = 0; $i<$ile_argumentow; $i += 7){
1455
+ $rx = ($a[$i][0]);
1456
+ $ry = ($a[$i+1][0]);
1457
+ $angle = ($a[$i+2][0]); //x-axis-rotation
1458
+ $largeArcFlag = ($a[$i+3][0]);
1459
+ $sweepFlag = ($a[$i+4][0]);
1460
+ $x2 = ($a[$i+5][0]);
1461
+ $y2 = ($a[$i+6][0]);
1462
+ $x1 = $this->xbase;
1463
+ $y1 = -$this->ybase;
1464
+ if($relative){
1465
+ $x2 = $this->xbase + $x2;
1466
+ $y2 = -$this->ybase + $y2;
1467
+ $this->xbase += ($a[$i+5][0]);
1468
+ $this->ybase += -($a[$i+6][0]);
1469
+ }
1470
+ else{
1471
+ $this->xbase = $x2;
1472
+ $this->ybase = -$y2;
1473
+ }
1474
+ // mPDF 5.0.039 // mPDF 5.0.040
1475
+ list($pcmd, $bounds) = $this->Arcto($x1, $y1, $x2, $y2, $rx, $ry, $angle, $largeArcFlag, $sweepFlag);
1476
+ $minl = min($minl,$x2,min($bounds[0]));
1477
+ $maxr = max($maxr,$x2,max($bounds[0]));
1478
+ $mint = min($mint,$y2,min($bounds[1]));
1479
+ $maxb = max($maxb,$y2,max($bounds[1]));
1480
+ $path_cmd .= $pcmd;
1481
+
1482
+ }
1483
+ break;
1484
+ case'z':
1485
+ $path_cmd .= 'h ';
1486
+ // mPDF 4.4.003
1487
+ $this->subPathInit = true;
1488
+ $newsubpath = true;
1489
+ $this->xbase = $this->spxstart;
1490
+ $this->ybase = $this->spystart;
1491
+ break;
1492
+ default:
1493
+ break;
1494
+ }
1495
+
1496
+ if (!$newsubpath) { $this->subPathInit = false; } // mPDF 4.4.003
1497
+ $this->lastcommand = $command;
1498
+ // mPDF 5.0.039
1499
+ $this->pathBBox[0] = $minl;
1500
+ $this->pathBBox[1] = $mint;
1501
+ $this->pathBBox[2] = $maxr - $this->pathBBox[0];
1502
+ $this->pathBBox[3] = $maxb - $this->pathBBox[1];
1503
+ return $path_cmd;
1504
+
1505
+ }
1506
+
1507
+ function Arcto($x1, $y1, $x2, $y2, $rx, $ry, $angle, $largeArcFlag, $sweepFlag) {
1508
+
1509
+ // mPDF 5.0.040
1510
+ $bounds = array(0=>array($x1,$x2),1=>array($y1,$y2));
1511
+ // 1. Treat out-of-range parameters as described in
1512
+ // http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
1513
+ // If the endpoints (x1, y1) and (x2, y2) are identical, then this
1514
+ // is equivalent to omitting the elliptical arc segment entirely
1515
+ if ($x1 == $x2 && $y1 == $y2) return array('', $bounds); // mPD 5.0.040
1516
+
1517
+ // If rX = 0 or rY = 0 then this arc is treated as a straight line
1518
+ // segment (a "lineto") joining the endpoints.
1519
+ if ($rx == 0.0 || $ry == 0.0) {
1520
+ // return array(Lineto(x2, y2), $bounds); // mPD 5.0.040
1521
+ }
1522
+
1523
+ // If rX or rY have negative signs, these are dropped; the absolute
1524
+ // value is used instead.
1525
+ if ($rx<0.0) $rx = -$rx;
1526
+ if ($ry<0.0) $ry = -$ry;
1527
+
1528
+ // 2. convert to center parameterization as shown in
1529
+ // http://www.w3.org/TR/SVG/implnote.html
1530
+ $sinPhi = sin(deg2rad($angle));
1531
+ $cosPhi = cos(deg2rad($angle));
1532
+
1533
+ $x1dash = $cosPhi * ($x1-$x2)/2.0 + $sinPhi * ($y1-$y2)/2.0;
1534
+ $y1dash = -$sinPhi * ($x1-$x2)/2.0 + $cosPhi * ($y1-$y2)/2.0;
1535
+
1536
+
1537
+ $numerator = $rx*$rx*$ry*$ry - $rx*$rx*$y1dash*$y1dash - $ry*$ry*$x1dash*$x1dash;
1538
+
1539
+ if ($numerator < 0.0) {
1540
+ // If rX , rY and are such that there is no solution (basically,
1541
+ // the ellipse is not big enough to reach from (x1, y1) to (x2,
1542
+ // y2)) then the ellipse is scaled up uniformly until there is
1543
+ // exactly one solution (until the ellipse is just big enough).
1544
+
1545
+ // -> find factor s, such that numerator' with rx'=s*rx and
1546
+ // ry'=s*ry becomes 0 :
1547
+ $s = sqrt(1.0 - $numerator/($rx*$rx*$ry*$ry));
1548
+
1549
+ $rx *= $s;
1550
+ $ry *= $s;
1551
+ $root = 0.0;
1552
+
1553
+ }
1554
+ else {
1555
+ $root = ($largeArcFlag == $sweepFlag ? -1.0 : 1.0) * sqrt( $numerator/($rx*$rx*$y1dash*$y1dash+$ry*$ry*$x1dash*$x1dash) );
1556
+ }
1557
+
1558
+ $cxdash = $root*$rx*$y1dash/$ry;
1559
+ $cydash = -$root*$ry*$x1dash/$rx;
1560
+
1561
+ $cx = $cosPhi * $cxdash - $sinPhi * $cydash + ($x1+$x2)/2.0;
1562
+ $cy = $sinPhi * $cxdash + $cosPhi * $cydash + ($y1+$y2)/2.0;
1563
+
1564
+
1565
+ $theta1 = $this->CalcVectorAngle(1.0, 0.0, ($x1dash-$cxdash)/$rx, ($y1dash-$cydash)/$ry);
1566
+ $dtheta = $this->CalcVectorAngle(($x1dash-$cxdash)/$rx, ($y1dash-$cydash)/$ry, (-$x1dash-$cxdash)/$rx, (-$y1dash-$cydash)/$ry);
1567
+ if (!$sweepFlag && $dtheta>0)
1568
+ $dtheta -= 2.0*M_PI;
1569
+ else if ($sweepFlag && $dtheta<0)
1570
+ $dtheta += 2.0*M_PI;
1571
+
1572
+ // 3. convert into cubic bezier segments <= 90deg
1573
+ $segments = ceil(abs($dtheta/(M_PI/2.0)));
1574
+ $delta = $dtheta/$segments;
1575
+ $t = 8.0/3.0 * sin($delta/4.0) * sin($delta/4.0) / sin($delta/2.0);
1576
+ $coords = array();
1577
+ for ($i = 0; $i < $segments; $i++) {
1578
+ $cosTheta1 = cos($theta1);
1579
+ $sinTheta1 = sin($theta1);
1580
+ $theta2 = $theta1 + $delta;
1581
+ $cosTheta2 = cos($theta2);
1582
+ $sinTheta2 = sin($theta2);
1583
+
1584
+ // a) calculate endpoint of the segment:
1585
+ $xe = $cosPhi * $rx*$cosTheta2 - $sinPhi * $ry*$sinTheta2 + $cx;
1586
+ $ye = $sinPhi * $rx*$cosTheta2 + $cosPhi * $ry*$sinTheta2 + $cy;
1587
+
1588
+ // b) calculate gradients at start/end points of segment:
1589
+ $dx1 = $t * ( - $cosPhi * $rx*$sinTheta1 - $sinPhi * $ry*$cosTheta1);
1590
+ $dy1 = $t * ( - $sinPhi * $rx*$sinTheta1 + $cosPhi * $ry*$cosTheta1);
1591
+
1592
+ $dxe = $t * ( $cosPhi * $rx*$sinTheta2 + $sinPhi * $ry*$cosTheta2);
1593
+ $dye = $t * ( $sinPhi * $rx*$sinTheta2 - $cosPhi * $ry*$cosTheta2);
1594
+
1595
+ // c) draw the cubic bezier:
1596
+ $coords[$i] = array(($x1+$dx1), ($y1+$dy1), ($xe+$dxe), ($ye+$dye), $xe, $ye);
1597
+
1598
+ // do next segment
1599
+ $theta1 = $theta2;
1600
+ $x1 = $xe;
1601
+ $y1 = $ye;
1602
+ }
1603
+ $path = ' ';
1604
+ foreach($coords AS $c) {
1605
+ $cpx1 = $c[0];
1606
+ $cpy1 = $c[1];
1607
+ $cpx2 = $c[2];
1608
+ $cpy2 = $c[3];
1609
+ $x2 = $c[4];
1610
+ $y2 = $c[5];
1611
+ $path .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $cpx1*$this->kp, -$cpy1*$this->kp, $cpx2*$this->kp, -$cpy2*$this->kp, $x2*$this->kp, -$y2*$this->kp) ."\n";
1612
+
1613
+ // mPDF 5.0.040
1614
+ $bounds[0][] = $c[4];
1615
+ $bounds[1][] = $c[5];
1616
+ }
1617
+ return array($path, $bounds); // mPD 5.0.040
1618
+ }
1619
+
1620
+
1621
+ function CalcVectorAngle($ux, $uy, $vx, $vy) {
1622
+ $ta = atan2($uy, $ux);
1623
+ $tb = atan2($vy, $vx);
1624
+ if ($tb >= $ta)
1625
+ return ($tb-$ta);
1626
+ return (6.28318530718 - ($ta-$tb));
1627
+ }
1628
+
1629
+
1630
+ // mPDF 4.4.003
1631
+ function ConvertSVGSizePixels($size=5,$maxsize='x'){
1632
+ // maxsize in pixels (user units) or 'y' or 'x'
1633
+ // e.g. $w = $this->ConvertSVGSizePixels($arguments['w'],$this->svg_info['w']*(25.4/$this->mpdf_ref->dpi));
1634
+ // usefontsize - setfalse for e.g. margins - will ignore fontsize for % values
1635
+ // Depends of maxsize value to make % work properly. Usually maxsize == pagewidth
1636
+ // For text $maxsize = Fontsize
1637
+ // Setting e.g. margin % will use maxsize (pagewidth) and em will use fontsize
1638
+
1639
+ if ($maxsize == 'y') { $maxsize = $this->svg_info['h']; }
1640
+ else if ($maxsize == 'x') { $maxsize = $this->svg_info['w']; }
1641
+ $maxsize *= (25.4/$this->mpdf_ref->dpi); // convert pixels to mm
1642
+ $fontsize=$this->mpdf_ref->FontSize;
1643
+ //Return as pixels
1644
+ $size = $this->mpdf_ref->ConvertSize($size,$maxsize,$fontsize,false) * 1/(25.4/$this->mpdf_ref->dpi);
1645
+ return $size;
1646
+ }
1647
+
1648
+ // mPDF 4.4.003
1649
+ function ConvertSVGSizePts($size=5){
1650
+ // usefontsize - setfalse for e.g. margins - will ignore fontsize for % values
1651
+ // Depends of maxsize value to make % work properly. Usually maxsize == pagewidth
1652
+ // For text $maxsize = Fontsize
1653
+ // Setting e.g. margin % will use maxsize (pagewidth) and em will use fontsize
1654
+ $maxsize=$this->mpdf_ref->FontSize;
1655
+ //Return as pts
1656
+ $size = $this->mpdf_ref->ConvertSize($size,$maxsize,false,true) * 72/25.4;
1657
+ return $size;
1658
+ }
1659
+
1660
+
1661
+ //
1662
+ // fonction retracant les <rect />
1663
+ function svgRect($arguments){
1664
+
1665
+ if ($arguments['h']==0 || $arguments['w']==0) { return ''; } // mPDF 4.4.003
1666
+
1667
+ $x = $this->ConvertSVGSizePixels($arguments['x'],'x'); // mPDF 4.4.003
1668
+ $y = $this->ConvertSVGSizePixels($arguments['y'],'y'); // mPDF 4.4.003
1669
+ $h = $this->ConvertSVGSizePixels($arguments['h'],'y'); // mPDF 4.4.003
1670
+ $w = $this->ConvertSVGSizePixels($arguments['w'],'x'); // mPDF 4.4.003
1671
+ $rx = $this->ConvertSVGSizePixels($arguments['rx'],'x'); // mPDF 4.4.003
1672
+ $ry = $this->ConvertSVGSizePixels($arguments['ry'],'y'); // mPDF 4.4.003
1673
+
1674
+ if ($rx > $w/2) { $rx = $w/2; } // mPDF 4.4.003
1675
+ if ($ry > $h/2) { $ry = $h/2; } // mPDF 4.4.003
1676
+
1677
+ if ($rx>0 and $ry == 0){$ry = $rx;}
1678
+ if ($ry>0 and $rx == 0){$rx = $ry;}
1679
+
1680
+ if ($rx == 0 and $ry == 0){
1681
+ // trace un rectangle sans angle arrondit
1682
+ $path_cmd = sprintf('%.3F %.3F m ', ($x*$this->kp), -($y*$this->kp));
1683
+ $path_cmd .= sprintf('%.3F %.3F l ', (($x+$w)*$this->kp), -($y*$this->kp));
1684
+ $path_cmd .= sprintf('%.3F %.3F l ', (($x+$w)*$this->kp), -(($y+$h)*$this->kp));
1685
+ $path_cmd .= sprintf('%.3F %.3F l ', ($x)*$this->kp, -(($y+$h)*$this->kp));
1686
+ $path_cmd .= sprintf('%.3F %.3F l h ', ($x*$this->kp), -($y*$this->kp));
1687
+
1688
+
1689
+ }
1690
+ else {
1691
+ // trace un rectangle avec les arrondit
1692
+ // les points de controle du bezier sont deduis grace a la constante kappa
1693
+ $kappa = 4*(sqrt(2)-1)/3;
1694
+
1695
+ $kx = $kappa*$rx;
1696
+ $ky = $kappa*$ry;
1697
+
1698
+ $path_cmd = sprintf('%.3F %.3F m ', ($x+$rx)*$this->kp, -$y*$this->kp);
1699
+ $path_cmd .= sprintf('%.3F %.3F l ', ($x+($w-$rx))*$this->kp, -$y*$this->kp);
1700
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($x+($w-$rx+$kx))*$this->kp, -$y*$this->kp, ($x+$w)*$this->kp, (-$y+(-$ry+$ky))*$this->kp, ($x+$w)*$this->kp, (-$y+(-$ry))*$this->kp );
1701
+ $path_cmd .= sprintf('%.3F %.3F l ', ($x+$w)*$this->kp, (-$y+(-$h+$ry))*$this->kp);
1702
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($x+$w)*$this->kp, (-$y+(-$h-$ky+$ry))*$this->kp, ($x+($w-$rx+$kx))*$this->kp, (-$y+(-$h))*$this->kp, ($x+($w-$rx))*$this->kp, (-$y+(-$h))*$this->kp );
1703
+
1704
+ $path_cmd .= sprintf('%.3F %.3F l ', ($x+$rx)*$this->kp, (-$y+(-$h))*$this->kp);
1705
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($x+($rx-$kx))*$this->kp, (-$y+(-$h))*$this->kp, $x*$this->kp, (-$y+(-$h-$ky+$ry))*$this->kp, $x*$this->kp, (-$y+(-$h+$ry))*$this->kp );
1706
+ $path_cmd .= sprintf('%.3F %.3F l ', $x*$this->kp, (-$y+(-$ry))*$this->kp);
1707
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c h ', $x*$this->kp, (-$y+(-$ry+$ky))*$this->kp, ($x+($rx-$kx))*$this->kp, -$y*$this->kp, ($x+$rx)*$this->kp, -$y*$this->kp );
1708
+
1709
+
1710
+ }
1711
+ return $path_cmd;
1712
+ }
1713
+
1714
+ //
1715
+ // fonction retracant les <ellipse /> et <circle />
1716
+ // le cercle est trac� grave a 4 bezier cubic, les poitn de controles
1717
+ // sont deduis grace a la constante kappa * rayon
1718
+ function svgEllipse($arguments){
1719
+ if ($arguments['rx']==0 || $arguments['ry']==0) { return ''; } // mPDF 4.4.003
1720
+
1721
+ $kappa = 4*(sqrt(2)-1)/3;
1722
+
1723
+ $cx = $this->ConvertSVGSizePixels($arguments['cx'],'x'); // mPDF 4.4.003
1724
+ $cy = $this->ConvertSVGSizePixels($arguments['cy'],'y'); // mPDF 4.4.003
1725
+ $rx = $this->ConvertSVGSizePixels($arguments['rx'],'x'); // mPDF 4.4.003
1726
+ $ry = $this->ConvertSVGSizePixels($arguments['ry'],'y'); // mPDF 4.4.003
1727
+
1728
+ $x1 = $cx;
1729
+ $y1 = -$cy+$ry;
1730
+
1731
+ $x2 = $cx+$rx;
1732
+ $y2 = -$cy;
1733
+
1734
+ $x3 = $cx;
1735
+ $y3 = -$cy-$ry;
1736
+
1737
+ $x4 = $cx-$rx;
1738
+ $y4 = -$cy;
1739
+
1740
+ $path_cmd = sprintf('%.3F %.3F m ', $x1*$this->kp, $y1*$this->kp);
1741
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($x1+($rx*$kappa))*$this->kp, $y1*$this->kp, $x2*$this->kp, ($y2+($ry*$kappa))*$this->kp, $x2*$this->kp, $y2*$this->kp);
1742
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $x2*$this->kp, ($y2-($ry*$kappa))*$this->kp, ($x3+($rx*$kappa))*$this->kp, $y3*$this->kp, $x3*$this->kp, $y3*$this->kp);
1743
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($x3-($rx*$kappa))*$this->kp, $y3*$this->kp, $x4*$this->kp, ($y4-($ry*$kappa))*$this->kp, $x4*$this->kp, $y4*$this->kp);
1744
+ $path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $x4*$this->kp, ($y4+($ry*$kappa))*$this->kp, ($x1-($rx*$kappa))*$this->kp, $y1*$this->kp, $x1*$this->kp, $y1*$this->kp);
1745
+ $path_cmd .= 'h ';
1746
+
1747
+ return $path_cmd;
1748
+
1749
+ }
1750
+
1751
+ //
1752
+ // fonction retracant les <polyline /> et les <line />
1753
+ function svgPolyline($arguments,$ispolyline=true){
1754
+ if ($ispolyline) {
1755
+ $xbase = $arguments[0] ;
1756
+ $ybase = - $arguments[1] ;
1757
+ }
1758
+ else {
1759
+ if ($arguments[0]==$arguments[2] && $arguments[1]==$arguments[3]) { return ''; } // mPDF 4.4.003 Zero length line
1760
+ $xbase = $this->ConvertSVGSizePixels($arguments[0],'x'); // mPDF 4.4.003
1761
+ $ybase = - $this->ConvertSVGSizePixels($arguments[1],'y'); // mPDF 4.4.003
1762
+ }
1763
+ $path_cmd = sprintf('%.3F %.3F m ', $xbase*$this->kp, $ybase*$this->kp);
1764
+ for ($i = 2; $i<count($arguments);$i += 2) {
1765
+ if ($ispolyline) {
1766
+ $tmp_x = $arguments[$i] ;
1767
+ $tmp_y = - $arguments[($i+1)] ;
1768
+ }
1769
+ else {
1770
+ $tmp_x = $this->ConvertSVGSizePixels($arguments[$i],'x') ; // mPDF 4.4.003
1771
+ $tmp_y = - $this->ConvertSVGSizePixels($arguments[($i+1)],'y') ; // mPDF 4.4.003
1772
+ }
1773
+ $path_cmd .= sprintf('%.3F %.3F l ', $tmp_x*$this->kp, $tmp_y*$this->kp);
1774
+ }
1775
+
1776
+ // $path_cmd .= 'h '; // ?? In error - don't close subpath here
1777
+ return $path_cmd;
1778
+
1779
+ }
1780
+
1781
+ //
1782
+ // fonction retracant les <polygone />
1783
+ function svgPolygon($arguments){
1784
+ $xbase = $arguments[0] ;
1785
+ $ybase = - $arguments[1] ;
1786
+ $path_cmd = sprintf('%.3F %.3F m ', $xbase*$this->kp, $ybase*$this->kp);
1787
+ for ($i = 2; $i<count($arguments);$i += 2) {
1788
+ $tmp_x = $arguments[$i] ;
1789
+ $tmp_y = - $arguments[($i+1)] ;
1790
+
1791
+ $path_cmd .= sprintf('%.3F %.3F l ', $tmp_x*$this->kp, $tmp_y*$this->kp);
1792
+
1793
+ }
1794
+ $path_cmd .= sprintf('%.3F %.3F l ', $xbase*$this->kp, $ybase*$this->kp);
1795
+ $path_cmd .= 'h ';
1796
+ return $path_cmd;
1797
+
1798
+ }
1799
+
1800
+ //
1801
+ // write string to image
1802
+ function svgText() {
1803
+ // $tmp = count($this->txt_style)-1;
1804
+ $current_style = array_pop($this->txt_style);
1805
+ $style = '';
1806
+ $render = -1;
1807
+ if(isset($this->txt_data[2]))
1808
+ {
1809
+ // select font
1810
+ $style .= ($current_style['font-weight'] == 'bold')?'B':'';
1811
+ $style .= ($current_style['font-style'] == 'italic')?'I':'';
1812
+ $size = $current_style['font-size']*$this->kf; // mPDF 5.0.039
1813
+
1814
+ // mPDF 5.0
1815
+ $current_style['font-family'] = $this->mpdf_ref->SetFont($current_style['font-family'],$style,$size,false);
1816
+ $this->mpdf_ref->CurrentFont['fo'] = true; // mPDF 5.0.039
1817
+
1818
+
1819
+ // mPDF 5.0.041
1820
+ $opacitystr = '';
1821
+ $opacity = 1;
1822
+ if (isset($current_style['fill-opacity'])) {
1823
+ if ($current_style['fill-opacity'] == 0) { $opacity = 0; }
1824
+ else if ($current_style['fill-opacity'] > 1) { $opacity = 1; }
1825
+ else if ($current_style['fill-opacity'] > 0) { $opacity = $current_style['fill-opacity']; }
1826
+ else if ($current_style['fill-opacity'] < 0) { $opacity = 0; }
1827
+ }
1828
+ $gs = $this->mpdf_ref->AddExtGState(array('ca'=>$opacity, 'BM'=>'/Normal'));
1829
+ $this->mpdf_ref->extgstates[$gs]['fo'] = true; // mPDF 5.0.039
1830
+ $opacitystr = sprintf(' /GS%d gs ', $gs);
1831
+
1832
+ // mPDF 5.0.051
1833
+ $fillstr = '';
1834
+ if (isset($current_style['fill']) && $current_style['fill']!='none') {
1835
+ $col = $this->mpdf_ref->ConvertColor($current_style['fill']);
1836
+ // mPDF 5.0.051
1837
+ $fillstr = $this->mpdf_ref->SetFColor($col, true);
1838
+ $render = "0"; // Fill (only)
1839
+ }
1840
+ $strokestr = '';
1841
+ if (isset($current_style['stroke-width']) && $current_style['stroke-width']>0 && $current_style['stroke']!='none') {
1842
+ $scol = $this->mpdf_ref->ConvertColor($current_style['stroke']);
1843
+ if ($scol) {
1844
+ $strokestr .= $this->mpdf_ref->SetDColor($scol, true).' '; // mPDF 5.0.051
1845
+ }
1846
+ $linewidth = $this->ConvertSVGSizePixels($current_style['stroke-width']);
1847
+ if ($linewidth > 0) {
1848
+ $strokestr .= sprintf('%.3F w 1 J 1 j ',$linewidth*$this->kp);
1849
+ if ($render == -1) { $render = "1"; } // stroke only
1850
+ else { $render = "2"; } // fill and stroke
1851
+ }
1852
+ }
1853
+ if ($render == -1) { return ''; }
1854
+
1855
+ $x = $this->ConvertSVGSizePixels($this->txt_data[0],'x'); // mPDF 4.4.003
1856
+ $y = $this->ConvertSVGSizePixels($this->txt_data[1],'y'); // mPDF 4.4.003
1857
+ $txt = $this->txt_data[2];
1858
+
1859
+ // mPDF 4.4.003
1860
+ $txt = preg_replace('/\f/','',$txt);
1861
+ $txt = preg_replace('/\r/','',$txt);
1862
+ $txt = preg_replace('/\n/',' ',$txt);
1863
+ $txt = preg_replace('/\t/',' ',$txt);
1864
+ $txt = preg_replace("/[ ]+/u",' ',$txt);
1865
+
1866
+ $txt = trim($txt);
1867
+
1868
+ $txt = $this->mpdf_ref->purify_utf8_text($txt);
1869
+ if ($this->mpdf_ref->text_input_as_HTML) {
1870
+ $txt = $this->mpdf_ref->all_entities_to_utf8($txt);
1871
+ }
1872
+
1873
+ // mPDF 5.0
1874
+ if ($this->mpdf_ref->usingCoreFont) { $txt = mb_convert_encoding($txt,$this->mpdf_ref->mb_enc,'UTF-8'); }
1875
+ if (preg_match("/([".$this->mpdf_ref->pregRTLchars."])/u", $txt)) { $this->mpdf_ref->biDirectional = true; } // mPDF 4.4.003
1876
+
1877
+ $this->mpdf_ref->magic_reverse_dir($txt, true, 'ltr'); // mPDF 5.0.054
1878
+ $this->mpdf_ref->ConvertIndic($txt);
1879
+
1880
+
1881
+ if ($current_style['text-anchor']=='middle') {
1882
+ $tw = $this->mpdf_ref->GetStringWidth($txt)*_MPDFK/2; // mPDF 4.4.003 // mPDF 5.4.09
1883
+ }
1884
+ else if ($current_style['text-anchor']=='end') {
1885
+ $tw = $this->mpdf_ref->GetStringWidth($txt)*_MPDFK; // mPDF 4.4.003 // mPDF 5.4.09
1886
+ }
1887
+ else $tw = 0;
1888
+
1889
+ if (!$this->mpdf_ref->usingCoreFont) {
1890
+ $this->mpdf_ref->UTF8StringToArray($txt); // mPDF 5.0 adds chars to subset list
1891
+ $txt= $this->mpdf_ref->UTF8ToUTF16BE($txt, false);
1892
+ }
1893
+ $txt='('.$this->mpdf_ref->_escape($txt).')';
1894
+ $this->mpdf_ref->CurrentFont['used']= true;
1895
+
1896
+ $pdfx = $x - $tw/$this->kp; // mPDF 4.4.009
1897
+ $pdfy = -$y ;
1898
+ $xbase = $x;
1899
+ $ybase = -$y;
1900
+
1901
+ // mPDF 5.0.041
1902
+ // mPDF 5.0.051
1903
+ $path_cmd = sprintf('q BT /F%d %s %.3F Tf %.3F %.3F Td %s Tr %s %s %s Tj ET Q ',$this->mpdf_ref->CurrentFont['i'],$opacitystr, $this->mpdf_ref->FontSizePt,$pdfx*$this->kp,$pdfy*$this->kp,$render,$fillstr,$strokestr,$txt)."\n";
1904
+ unset($this->txt_data[0], $this->txt_data[1],$this->txt_data[2]);
1905
+
1906
+ // mPDF 5.4.12
1907
+ if (isset($current_style['font-size-parent'])) {
1908
+ $this->mpdf_ref->SetFontSize($current_style['font-size-parent']);
1909
+ }
1910
+ }
1911
+ else
1912
+ {
1913
+ return ' ';
1914
+ }
1915
+ // $path_cmd .= 'h '; // mPDF 5.0
1916
+ return $path_cmd;
1917
+ }
1918
+
1919
+
1920
+ function svgDefineTxtStyle($critere_style)
1921
+ {
1922
+ // get copy of current/default txt style, and modify it with supplied attributes
1923
+ $tmp = count($this->txt_style)-1;
1924
+ $current_style = $this->txt_style[$tmp];
1925
+ if (isset($critere_style['style'])){
1926
+ if (preg_match('/fill:\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)/',$critere_style['style'], $m)) {
1927
+ $current_style['fill'] = '#'.str_pad(dechex($m[1]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[2]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[3]), 2, "0", STR_PAD_LEFT);
1928
+ }
1929
+ else { $tmp = preg_replace("/(.*)fill:\s*([a-z0-9#_()]*|none)(.*)/i","$2",$critere_style['style']);
1930
+ if ($tmp != $critere_style['style']){ $current_style['fill'] = $tmp; }
1931
+ }
1932
+
1933
+ $tmp = preg_replace("/(.*)fill-opacity:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1934
+ if ($tmp != $critere_style['style']){ $current_style['fill-opacity'] = $tmp;}
1935
+
1936
+ $tmp = preg_replace("/(.*)fill-rule:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
1937
+ if ($tmp != $critere_style['style']){ $current_style['fill-rule'] = $tmp;}
1938
+
1939
+ if (preg_match('/stroke:\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)/',$critere_style['style'], $m)) {
1940
+ $current_style['stroke'] = '#'.str_pad(dechex($m[1]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[2]), 2, "0", STR_PAD_LEFT).str_pad(dechex($m[3]), 2, "0", STR_PAD_LEFT);
1941
+ }
1942
+ else { $tmp = preg_replace("/(.*)stroke:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
1943
+ if ($tmp != $critere_style['style']){ $current_style['stroke'] = $tmp; }
1944
+ }
1945
+
1946
+ $tmp = preg_replace("/(.*)stroke-linecap:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
1947
+ if ($tmp != $critere_style['style']){ $current_style['stroke-linecap'] = $tmp;}
1948
+
1949
+ $tmp = preg_replace("/(.*)stroke-linejoin:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
1950
+ if ($tmp != $critere_style['style']){ $current_style['stroke-linejoin'] = $tmp;}
1951
+
1952
+ $tmp = preg_replace("/(.*)stroke-miterlimit:\s*([a-z0-9#]*|none)(.*)/i","$2",$critere_style['style']);
1953
+ if ($tmp != $critere_style['style']){ $current_style['stroke-miterlimit'] = $tmp;}
1954
+
1955
+ $tmp = preg_replace("/(.*)stroke-opacity:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1956
+ if ($tmp != $critere_style['style']){ $current_style['stroke-opacity'] = $tmp; }
1957
+
1958
+ $tmp = preg_replace("/(.*)stroke-width:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1959
+ if ($tmp != $critere_style['style']){ $current_style['stroke-width'] = $tmp;}
1960
+
1961
+ $tmp = preg_replace("/(.*)stroke-dasharray:\s*([a-z0-9., ]*|none)(.*)/i","$2",$critere_style['style']);
1962
+ if ($tmp != $critere_style['style']){ $current_style['stroke-dasharray'] = $tmp;}
1963
+
1964
+ $tmp = preg_replace("/(.*)stroke-dashoffset:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1965
+ if ($tmp != $critere_style['style']){ $current_style['stroke-dashoffset'] = $tmp;}
1966
+
1967
+ // mPDF 5.0.039
1968
+ $tmp = preg_replace("/(.*)font-family:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1969
+ if ($tmp != $critere_style['style']){ $critere_style['font-family'] = $tmp;}
1970
+
1971
+ $tmp = preg_replace("/(.*)font-size:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1972
+ if ($tmp != $critere_style['style']){ $critere_style['font-size'] = $tmp;}
1973
+
1974
+ $tmp = preg_replace("/(.*)font-weight:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1975
+ if ($tmp != $critere_style['style']){ $critere_style['font-weight'] = $tmp;}
1976
+
1977
+ $tmp = preg_replace("/(.*)font-style:\s*([a-z0-9.]*|none)(.*)/i","$2",$critere_style['style']);
1978
+ if ($tmp != $critere_style['style']){ $critere_style['font-style'] = $tmp;}
1979
+
1980
+ }
1981
+
1982
+ if (isset($critere_style['font'])){
1983
+
1984
+ // [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]?<'font-size'> [ / <'line-height'> ]? <'font-family'> ]
1985
+
1986
+ $tmp = preg_replace("/(.*)(italic|oblique)(.*)/i","$2",$critere_style['font']);
1987
+ if ($tmp != $critere_style['font']){
1988
+ if($tmp == 'oblique'){
1989
+ $tmp = 'italic';
1990
+ }
1991
+ $current_style['font-style'] = $tmp;
1992
+ }
1993
+ $tmp = preg_replace("/(.*)(bold|bolder)(.*)/i","$2",$critere_style['font']);
1994
+ if ($tmp != $critere_style['font']){
1995
+ if($tmp == 'bolder'){
1996
+ $tmp = 'bold';
1997
+ }
1998
+ $current_style['font-weight'] = $tmp;
1999
+ }
2000
+
2001
+ // select digits not followed by percent sign nor preceeded by forward slash
2002
+ $tmp = preg_replace("/(.*)\b(\d+)[\b|\/](.*)/i","$2",$critere_style['font']);
2003
+ if ($tmp != $critere_style['font']){
2004
+ $current_style['font-size'] = $this->ConvertSVGSizePts($tmp);
2005
+ $this->mpdf_ref->SetFont('','',$current_style['font-size'],false);
2006
+ }
2007
+
2008
+ }
2009
+
2010
+ if(isset($critere_style['fill'])){
2011
+ $current_style['fill'] = $critere_style['fill'];
2012
+ }
2013
+ if(isset($critere_style['stroke'])){
2014
+ $current_style['stroke'] = $critere_style['stroke'];
2015
+ }
2016
+ if(isset($critere_style['stroke-width'])){
2017
+ $current_style['stroke-width'] = $critere_style['stroke-width'];
2018
+ }
2019
+
2020
+ if(isset($critere_style['font-style'])){
2021
+ if(strtolower($critere_style['font-style']) == 'oblique')
2022
+ {
2023
+ $critere_style['font-style'] = 'italic';
2024
+ }
2025
+ $current_style['font-style'] = $critere_style['font-style'];
2026
+ }
2027
+
2028
+ if(isset($critere_style['font-weight'])){
2029
+ if(strtolower($critere_style['font-weight']) == 'bolder')
2030
+ {
2031
+ $critere_style['font-weight'] = 'bold';
2032
+ }
2033
+ $current_style['font-weight'] = $critere_style['font-weight'];
2034
+ }
2035
+
2036
+ if(isset($critere_style['font-size'])){
2037
+ // mPDF 5.4.12
2038
+ if (strpos($critere_style['font-size'], '%')!==false) {
2039
+ $current_style['font-size-parent'] = $current_style['font-size'];
2040
+ }
2041
+ $current_style['font-size'] = $this->ConvertSVGSizePts($critere_style['font-size']);
2042
+ $this->mpdf_ref->SetFont('','',$current_style['font-size'],false);
2043
+ }
2044
+
2045
+ if(isset($critere_style['font-family'])){
2046
+ $v = $critere_style['font-family'];
2047
+ $aux_fontlist = explode(",",$v);
2048
+ $found = 0;
2049
+ foreach($aux_fontlist AS $f) {
2050
+ $fonttype = trim($f);
2051
+ $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
2052
+ $fonttype = preg_replace('/ /','',$fonttype);
2053
+ $v = strtolower(trim($fonttype));
2054
+ if (isset($this->mpdf_ref->fonttrans[$v]) && $this->mpdf_ref->fonttrans[$v]) { $v = $this->mpdf_ref->fonttrans[$v]; }
2055
+ if ((!$this->mpdf_ref->usingCoreFont && in_array($v,$this->mpdf_ref->available_unifonts)) ||
2056
+ ($this->mpdf_ref->usingCoreFont && in_array($v,array('courier','times','helvetica','arial'))) ||
2057
+ in_array($v, array('sjis','uhc','big5','gb'))) {
2058
+ $current_style['font-family'] = $v;
2059
+ $found = 1;
2060
+ break;
2061
+ }
2062
+ }
2063
+ if (!$found) {
2064
+ foreach($aux_fontlist AS $f) {
2065
+ $fonttype = trim($f);
2066
+ $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
2067
+ $fonttype = preg_replace('/ /','',$fonttype);
2068
+ $v = strtolower(trim($fonttype));
2069
+ if (isset($this->mpdf_ref->fonttrans[$v]) && $this->mpdf_ref->fonttrans[$v]) { $v = $this->mpdf_ref->fonttrans[$v]; }
2070
+ if (in_array($v,$this->mpdf_ref->sans_fonts) || in_array($v,$this->mpdf_ref->serif_fonts) || in_array($v,$this->mpdf_ref->mono_fonts) ) {
2071
+ $current_style['font-family'] = $v;
2072
+ break;
2073
+ }
2074
+ }
2075
+ }
2076
+ }
2077
+
2078
+ if(isset($critere_style['text-anchor'])){
2079
+ $current_style['text-anchor'] = $critere_style['text-anchor'];
2080
+ }
2081
+
2082
+ // add current style to text style array (will remove it later after writing text to svg_string)
2083
+ array_push($this->txt_style,$current_style);
2084
+ }
2085
+
2086
+
2087
+
2088
+ //
2089
+ // fonction ajoutant un gradient
2090
+ function svgAddGradient($id,$array_gradient){
2091
+
2092
+ $this->svg_gradient[$id] = $array_gradient;
2093
+
2094
+ }
2095
+ //
2096
+ // Ajoute une couleur dans le gradient correspondant
2097
+
2098
+ //
2099
+ // function ecrivant dans le svgstring
2100
+ function svgWriteString($content){
2101
+
2102
+ $this->svg_string .= $content;
2103
+
2104
+ }
2105
+
2106
+
2107
+
2108
+ // analise le svg et renvoie aux fonctions precedente our le traitement
2109
+ function ImageSVG($data){
2110
+ $this->svg_info = array();
2111
+
2112
+ // mPDF 4.4.006
2113
+ if (preg_match('/<!ENTITY/si',$data)) {
2114
+ // Get User-defined entities
2115
+ preg_match_all('/<!ENTITY\s+([a-z]+)\s+\"(.*?)\">/si',$data, $ent);
2116
+ // Replace entities
2117
+ for ($i=0; $i<count($ent[0]); $i++) {
2118
+ $data = preg_replace('/&'.preg_quote($ent[1][$i],'/').';/is', $ent[2][$i], $data);
2119
+ }
2120
+ }
2121
+
2122
+
2123
+ // mPDF 4.4.003
2124
+ if (preg_match('/xlink:href=/si',$data)) {
2125
+ // Get links
2126
+ preg_match_all('/(<(linearGradient|radialgradient)[^>]*)xlink:href=["\']#(.*?)["\'](.*?)\/>/si',$data, $links);
2127
+ if (count($links[0])) { $links[5] = array(); } // mPDF 4.5.010
2128
+ // Delete links from data - keeping in $links
2129
+ for ($i=0; $i<count($links[0]); $i++) {
2130
+ $links[5][$i] = 'tmpLink'.RAND(100000,9999999); // mPDF 4.5.010
2131
+ $data = preg_replace('/'.preg_quote($links[0][$i],'/').'/is', '<MYLINKS'.$links[5][$i].'>' , $data); // mPDF 4.5.010
2132
+ }
2133
+ // Get targets
2134
+ preg_match_all('/<(linearGradient|radialgradient)([^>]*)id=["\'](.*?)["\'](.*?)>(.*?)<\/(linearGradient|radialgradient)>/si',$data, $m);
2135
+ $targets = array();
2136
+ $stops = array();
2137
+ // keeping in $targets
2138
+ for ($i=0; $i<count($m[0]); $i++) {
2139
+ $stops[$m[3][$i]] = $m[5][$i];
2140
+ }
2141
+ // Add back links this time as targets (gradients)
2142
+ for ($i=0; $i<count($links[0]); $i++) {
2143
+ $def = $links[1][$i] .' '.$links[4][$i].'>'. $stops[$links[3][$i]].'</'.$links[2][$i] .'>' ; // mPDF 4.5.010
2144
+ $data = preg_replace('/<MYLINKS'.$links[5][$i].'>/is', $def , $data); // mPDF 4.5.010
2145
+ }
2146
+ }
2147
+ // mPDF 4.4.003 - Removes <pattern>
2148
+ $data = preg_replace('/<pattern.*?<\/pattern>/is', '', $data);
2149
+ // mPDF 4.4.003 - Removes <marker>
2150
+ $data = preg_replace('/<marker.*?<\/marker>/is', '', $data);
2151
+
2152
+ $this->svg_info['data'] = $data;
2153
+
2154
+ $this->svg_string = '';
2155
+
2156
+ //
2157
+ // chargement unique des fonctions
2158
+ if(!function_exists("xml_svg2pdf_start")){ // mPDF 5.3.76
2159
+
2160
+ function xml_svg2pdf_start($parser, $name, $attribs){
2161
+ //
2162
+ // definition
2163
+ global $svg_class, $last_gradid;
2164
+
2165
+ // mPDF 4.4.003
2166
+ $svg_class->xbase = 0;
2167
+ $svg_class->ybase = 0;
2168
+ switch (strtolower($name)){
2169
+
2170
+ // mPDF 5.0.039 - Don't output stuff inside <defs>
2171
+ case 'defs':
2172
+ $svg_class->inDefs = true;
2173
+ return;
2174
+
2175
+ case 'svg':
2176
+ $svg_class->svgOffset($attribs);
2177
+ break;
2178
+
2179
+ case 'path':
2180
+ $path = $attribs['d'];
2181
+ // mPDF 5.6.65
2182
+ preg_match_all('/([MZLHVCSQTAmzlhvcsqta])([eE ,\-.\d]+)*/', $path, $commands, PREG_SET_ORDER);
2183
+ $path_cmd = '';
2184
+ $svg_class->subPathInit = true;
2185
+ // mPDF 5.0.039
2186
+ $svg_class->pathBBox = array(999999,999999,-999999,-999999);
2187
+ foreach($commands as $c){
2188
+ if(count($c)==3 || $c[2]==''){
2189
+ list($tmp, $command, $arguments) = $c;
2190
+ }
2191
+ else{
2192
+ list($tmp, $command) = $c;
2193
+ $arguments = '';
2194
+ }
2195
+
2196
+ $path_cmd .= $svg_class->svgPath($command, $arguments);
2197
+ }
2198
+ // mPDF 5.0.039
2199
+ if ($svg_class->pathBBox[2]==-1999998) { $svg_class->pathBBox[2] = 100; }
2200
+ if ($svg_class->pathBBox[3]==-1999998) { $svg_class->pathBBox[3] = 100; }
2201
+ if ($svg_class->pathBBox[0]==999999) { $svg_class->pathBBox[0] = 0; }
2202
+ if ($svg_class->pathBBox[1]==999999) { $svg_class->pathBBox[1] = 0; }
2203
+ $critere_style = $attribs;
2204
+ unset($critere_style['d']);
2205
+ $path_style = $svg_class->svgDefineStyle($critere_style);
2206
+ break;
2207
+
2208
+ case 'rect':
2209
+ if (!isset($attribs['x'])) {$attribs['x'] = 0;}
2210
+ if (!isset($attribs['y'])) {$attribs['y'] = 0;}
2211
+ if (!isset($attribs['rx'])) {$attribs['rx'] = 0;}
2212
+ if (!isset($attribs['ry'])) {$attribs['ry'] = 0;}
2213
+ $arguments = array(
2214
+ 'x' => $attribs['x'],
2215
+ 'y' => $attribs['y'],
2216
+ 'w' => $attribs['width'],
2217
+ 'h' => $attribs['height'],
2218
+ 'rx' => $attribs['rx'],
2219
+ 'ry' => $attribs['ry']
2220
+ );
2221
+ $path_cmd = $svg_class->svgRect($arguments);
2222
+ $critere_style = $attribs;
2223
+ unset($critere_style['x'],$critere_style['y'],$critere_style['rx'],$critere_style['ry'],$critere_style['height'],$critere_style['width']);
2224
+ $path_style = $svg_class->svgDefineStyle($critere_style);
2225
+ break;
2226
+
2227
+ case 'circle':
2228
+ if (!isset($attribs['cx'])) {$attribs['cx'] = 0;}
2229
+ if (!isset($attribs['cy'])) {$attribs['cy'] = 0;}
2230
+ $arguments = array(
2231
+ 'cx' => $attribs['cx'],
2232
+ 'cy' => $attribs['cy'],
2233
+ 'rx' => $attribs['r'],
2234
+ 'ry' => $attribs['r']
2235
+ );
2236
+ $path_cmd = $svg_class->svgEllipse($arguments);
2237
+ $critere_style = $attribs;
2238
+ unset($critere_style['cx'],$critere_style['cy'],$critere_style['r']);
2239
+ $path_style = $svg_class->svgDefineStyle($critere_style);
2240
+ break;
2241
+
2242
+ case 'ellipse':
2243
+ if (!isset($attribs['cx'])) {$attribs['cx'] = 0;}
2244
+ if (!isset($attribs['cy'])) {$attribs['cy'] = 0;}
2245
+ $arguments = array(
2246
+ 'cx' => $attribs['cx'],
2247
+ 'cy' => $attribs['cy'],
2248
+ 'rx' => $attribs['rx'],
2249
+ 'ry' => $attribs['ry']
2250
+ );
2251
+ $path_cmd = $svg_class->svgEllipse($arguments);
2252
+ $critere_style = $attribs;
2253
+ unset($critere_style['cx'],$critere_style['cy'],$critere_style['rx'],$critere_style['ry']);
2254
+ $path_style = $svg_class->svgDefineStyle($critere_style);
2255
+ break;
2256
+
2257
+ case 'line':
2258
+ $arguments = array($attribs['x1'],$attribs['y1'],$attribs['x2'],$attribs['y2']);
2259
+ $path_cmd = $svg_class->svgPolyline($arguments,false); // mPDF 4.4.003
2260
+ $critere_style = $attribs;
2261
+ unset($critere_style['x1'],$critere_style['y1'],$critere_style['x2'],$critere_style['y2']);
2262
+ $path_style = $svg_class->svgDefineStyle($critere_style);
2263
+ break;
2264
+
2265
+ case 'polyline':
2266
+ $path = $attribs['points'];
2267
+ preg_match_all('/[0-9\-\.]*/',$path, $tmp, PREG_SET_ORDER);
2268
+ $arguments = array();
2269
+ for ($i=0;$i<count($tmp);$i++){
2270
+ if ($tmp[$i][0] !=''){
2271
+ array_push($arguments, $tmp[$i][0]);
2272
+ }
2273
+ }
2274
+ $path_cmd = $svg_class->svgPolyline($arguments);
2275
+ $critere_style = $attribs;
2276
+ unset($critere_style['points']);
2277
+ $path_style = $svg_class->svgDefineStyle($critere_style);
2278
+ break;
2279
+
2280
+ case 'polygon':
2281
+ $path = $attribs['points'];
2282
+ preg_match_all('/([\-]*[0-9\.]+)/',$path, $tmp);
2283
+ $arguments = array();
2284
+ for ($i=0;$i<count($tmp[0]);$i++){
2285
+ if ($tmp[0][$i] !=''){
2286
+ array_push($arguments, $tmp[0][$i]);
2287
+ }
2288
+ }
2289
+ $path_cmd = $svg_class->svgPolygon($arguments);
2290
+ // definition du style de la forme:
2291
+ $critere_style = $attribs;
2292
+ unset($critere_style['points']);
2293
+ $path_style = $svg_class->svgDefineStyle($critere_style);
2294
+ break;
2295
+
2296
+ case 'lineargradient':
2297
+ $tmp_gradient = array(
2298
+ 'type' => 'linear',
2299
+ 'info' => array(
2300
+ 'x1' => $attribs['x1'],
2301
+ 'y1' => $attribs['y1'],
2302
+ 'x2' => $attribs['x2'],
2303
+ 'y2' => $attribs['y2']
2304
+ ),
2305
+ 'transform' => $attribs['gradientTransform'],
2306
+ 'units' => $attribs['gradientUnits'], /* mPDF 4.4.003 */
2307
+ 'spread' => $attribs['spreadMethod'], /* mPDF 5.0.040 */
2308
+ 'color' => array()
2309
+ );
2310
+
2311
+ $last_gradid = $attribs['id'];
2312
+ $svg_class->svgAddGradient($attribs['id'],$tmp_gradient);
2313
+ break;
2314
+
2315
+ case 'radialgradient':
2316
+ $tmp_gradient = array(
2317
+ 'type' => 'radial',
2318
+ 'info' => array(
2319
+ 'x0' => $attribs['cx'],
2320
+ 'y0' => $attribs['cy'],
2321
+ 'x1' => $attribs['fx'],
2322
+ 'y1' => $attribs['fy'],
2323
+ 'r' => $attribs['r']
2324
+ ),
2325
+ 'transform' => $attribs['gradientTransform'],
2326
+ 'units' => $attribs['gradientUnits'], /* mPDF 4.4.003 */
2327
+ 'spread' => $attribs['spreadMethod'], /* mPDF 5.0.040 */
2328
+ 'color' => array()
2329
+ );
2330
+
2331
+ $last_gradid = $attribs['id'];
2332
+
2333
+ $svg_class->svgAddGradient($attribs['id'],$tmp_gradient);
2334
+
2335
+ break;
2336
+
2337
+ case 'stop':
2338
+ if (!$last_gradid) break;
2339
+ // mPDF 4.4.003 // mPDF 5.0.040
2340
+ if (isset($attribs['style']) AND preg_match('/stop-color:\s*([^;]*)/i',$attribs['style'],$m)) {
2341
+ $color = trim($m[1]);
2342
+ } else if (isset($attribs['stop-color'])) {
2343
+ $color = $attribs['stop-color'];
2344
+ }
2345
+ $col = $svg_class->mpdf_ref->ConvertColor($color);
2346
+
2347
+ // mPDF 5.0.051
2348
+ // mPDF 5.3.74
2349
+ if ($col{0}==3 || $col{0}==5) { // RGB
2350
+ $color_final = sprintf('%.3F %.3F %.3F',ord($col{1})/255,ord($col{2})/255,ord($col{3})/255);
2351
+ $svg_class->svg_gradient[$last_gradid]['colorspace']='RGB';
2352
+ }
2353
+ else if ($col{0}==4 || $col{0}==6) { // CMYK
2354
+ $color_final = sprintf('%.3F %.3F %.3F %.3F',ord($col{1})/100,ord($col{2})/100,ord($col{3})/100,ord($col{4})/100);
2355
+ $svg_class->svg_gradient[$last_gradid]['colorspace']='CMYK';
2356
+ }
2357
+ else if ($col{0}==1) { // Grayscale
2358
+ $color_final = sprintf('%.3F',ord($col{1})/255);
2359
+ $svg_class->svg_gradient[$last_gradid]['colorspace']='Gray';
2360
+ }
2361
+
2362
+
2363
+ // mPDF 5.0.020
2364
+ $stop_opacity = 1;
2365
+ // mPDF 4.4.003
2366
+ if (isset($attribs['style']) AND preg_match('/stop-opacity:\s*([0-9.]*)/i',$attribs['style'],$m)) {
2367
+ $stop_opacity = $m[1];
2368
+ } else if (isset($attribs['stop-opacity'])) {
2369
+ $stop_opacity = $attribs['stop-opacity'];
2370
+ }
2371
+ // mPDF 5.0.051
2372
+ // mPDF 5.3.74
2373
+ else if ($col{0}==5) { // RGBa
2374
+ $stop_opacity = ord($col{4}/100);
2375
+ }
2376
+ else if ($col{0}==6) { // CMYKa
2377
+ $stop_opacity = ord($col{5}/100);
2378
+ }
2379
+
2380
+ $tmp_color = array(
2381
+ 'color' => $color_final,
2382
+ 'offset' => $attribs['offset'],
2383
+ 'opacity' => $stop_opacity
2384
+ );
2385
+ array_push($svg_class->svg_gradient[$last_gradid]['color'],$tmp_color);
2386
+ break;
2387
+
2388
+
2389
+ case 'a':
2390
+ if (isset($attribs['xlink:href'])) {
2391
+ unset($attribs['xlink:href']); // this should be a hyperlink
2392
+ // not handled like a xlink:href in other elements
2393
+ } // then continue like a <g>
2394
+ case 'g':
2395
+ $array_style = $svg_class->svgDefineStyle($attribs);
2396
+ if ($array_style['transformations']) {
2397
+ $svg_class->svgWriteString(' q '.$array_style['transformations']);
2398
+ }
2399
+ array_push($svg_class->svg_style,$array_style);
2400
+
2401
+ $svg_class->svgDefineTxtStyle($attribs); // mPDF 4.4.003
2402
+
2403
+ break;
2404
+
2405
+ case 'text':
2406
+ // mPDF 4.4.003
2407
+ $array_style = $svg_class->svgDefineStyle($attribs);
2408
+ if ($array_style['transformations']) {
2409
+ $svg_class->svgWriteString(' q '.$array_style['transformations']);
2410
+ }
2411
+ array_push($svg_class->svg_style,$array_style);
2412
+
2413
+ $svg_class->txt_data = array();
2414
+ $svg_class->txt_data[0] = $attribs['x'];
2415
+ $svg_class->txt_data[1] = $attribs['y'];
2416
+ $critere_style = $attribs;
2417
+ unset($critere_style['x'], $critere_style['y']);
2418
+ $svg_class->svgDefineTxtStyle($critere_style);
2419
+ break;
2420
+ }
2421
+
2422
+ //
2423
+ //insertion des path et du style dans le flux de donn� general.
2424
+ if (isset($path_cmd) && $path_cmd) { // mPDF 4.4.003
2425
+ // mPDF 5.0
2426
+ list($prestyle,$poststyle) = $svg_class->svgStyle($path_style, $attribs, strtolower($name));
2427
+ if ($path_style['transformations']) { // transformation on an element
2428
+ $svg_class->svgWriteString(" q ".$path_style['transformations']. " $prestyle $path_cmd $poststyle" . " Q\n");
2429
+ }
2430
+ else {
2431
+ $svg_class->svgWriteString("$prestyle $path_cmd $poststyle\n");
2432
+ }
2433
+ }
2434
+ }
2435
+
2436
+ function characterData($parser, $data)
2437
+ {
2438
+ global $svg_class;
2439
+ if(isset($svg_class->txt_data[2])) {
2440
+ $svg_class->txt_data[2] .= $data;
2441
+ }
2442
+ else {
2443
+ $svg_class->txt_data[2] = $data;
2444
+ }
2445
+ }
2446
+
2447
+
2448
+ function xml_svg2pdf_end($parser, $name){
2449
+ global $svg_class;
2450
+ switch($name){
2451
+
2452
+ case "g":
2453
+ case "a":
2454
+ $tmp = count($svg_class->svg_style)-1;
2455
+ $current_style = $svg_class->svg_style[$tmp];
2456
+ if ($current_style['transformations']) {
2457
+ $svg_class->svgWriteString(" Q\n");
2458
+ }
2459
+ array_pop($svg_class->svg_style);
2460
+
2461
+ array_pop($svg_class->txt_style); // mPDF 4.4.003
2462
+
2463
+ break;
2464
+ case 'radialgradient':
2465
+ case 'lineargradient':
2466
+ $last_gradid = '';
2467
+ break;
2468
+ case "text":
2469
+ $path_cmd = $svg_class->svgText();
2470
+ // echo 'path >> '.$path_cmd."<br><br>";
2471
+ // echo "style >> ".$get_style[1]."<br><br>";
2472
+ $svg_class->svgWriteString($path_cmd);
2473
+ // mPDF 4.4.003
2474
+ $tmp = count($svg_class->svg_style)-1;
2475
+ $current_style = $svg_class->svg_style[$tmp];
2476
+ if ($current_style['transformations']) {
2477
+ $svg_class->svgWriteString(" Q\n");
2478
+ }
2479
+ array_pop($svg_class->svg_style);
2480
+
2481
+ break;
2482
+ }
2483
+ // mPDF 5.0.039 - Don't output stuff inside <defs>
2484
+ if ($name == 'defs') {
2485
+ $svg_class->inDefs = false;
2486
+ }
2487
+
2488
+ }
2489
+
2490
+ }
2491
+
2492
+ $svg2pdf_xml='';
2493
+ global $svg_class;
2494
+ $svg_class = $this;
2495
+ // mPDF 5.0.039 - Don't output stuff inside <defs>
2496
+ $svg_class->inDefs = false;
2497
+ $svg2pdf_xml_parser = xml_parser_create("utf-8");
2498
+ xml_parser_set_option($svg2pdf_xml_parser, XML_OPTION_CASE_FOLDING, false);
2499
+ xml_set_element_handler($svg2pdf_xml_parser, "xml_svg2pdf_start", "xml_svg2pdf_end");
2500
+ xml_set_character_data_handler($svg2pdf_xml_parser, "characterData");
2501
+ xml_parse($svg2pdf_xml_parser, $data);
2502
+ // mPDF 4.4.003
2503
+ if ($this->svg_error) { return false; }
2504
+ else {
2505
+ return array('x'=>$this->svg_info['x']*$this->kp,'y'=>-$this->svg_info['y']*$this->kp,'w'=>$this->svg_info['w']*$this->kp,'h'=>-$this->svg_info['h']*$this->kp,'data'=>$svg_class->svg_string);
2506
+ }
2507
+
2508
+ }
2509
+
2510
+ }
2511
+
2512
+ // END OF CLASS
2513
+
2514
+
2515
+ // mPDF 5.0.040
2516
+ function calc_bezier_bbox($start, $c) {
2517
+ $P0 = array($start[0],$start[1]);
2518
+ $P1 = array($c[0],$c[1]);
2519
+ $P2 = array($c[2],$c[3]);
2520
+ $P3 = array($c[4],$c[5]);
2521
+ $bounds = array();
2522
+ $bounds[0][] = $P0[0];
2523
+ $bounds[1][] = $P0[1];
2524
+ $bounds[0][] = $P3[0];
2525
+ $bounds[1][] = $P3[1];
2526
+ for ($i=0;$i<=1;$i++) {
2527
+ $b = 6 * $P0[$i] - 12 * $P1[$i] + 6 * $P2[$i];
2528
+ $a = -3 * $P0[$i] + 9 * $P1[$i] - 9 * $P2[$i] + 3 * $P3[$i];
2529
+ $c = 3 * $P1[$i] - 3 * $P0[$i];
2530
+ if ($a == 0) {
2531
+ if ($b == 0) { continue; }
2532
+ $t = -$c / $b;
2533
+ if ($t>0 && $t<1) {
2534
+ $bounds[$i][] = (pow((1-$t),3) * $P0[$i] + 3 * pow((1-$t),2) * $t * $P1[$i] + 3 * (1-$t) * pow($t,2) * $P2[$i] + pow($t,3) * $P3[$i]);
2535
+ }
2536
+ continue;
2537
+ }
2538
+ $b2ac = pow($b, 2) - 4 * $c * $a;
2539
+ if ($b2ac < 0) { continue; }
2540
+ $t1 = (-$b + sqrt($b2ac))/(2 * $a);
2541
+ if ($t1>0 && $t1<1) {
2542
+ $bounds[$i][] = (pow((1-$t1),3) * $P0[$i] + 3 * pow((1-$t1),2) * $t1 * $P1[$i] + 3 * (1-$t1) * pow($t1,2) * $P2[$i] + pow($t1,3) * $P3[$i]);
2543
+ }
2544
+ $t2 = (-$b - sqrt($b2ac))/(2 * $a);
2545
+ if ($t2>0 && $t2<1) {
2546
+ $bounds[$i][] = (pow((1-$t2),3) * $P0[$i] + 3 * pow((1-$t2),2) * $t2 * $P1[$i] + 3 * (1-$t2) * pow($t2,2) * $P2[$i] + pow($t2,3) * $P3[$i]);
2547
+ }
2548
+ }
2549
+ $x = min($bounds[0]);
2550
+ $x2 = max($bounds[0]);
2551
+ $y = min($bounds[1]);
2552
+ $y2 = max($bounds[1]);
2553
+ return array($x, $y, $x2, $y2);
2554
+ }
2555
+
2556
+ // mPDF 5.0.040
2557
+ function _testIntersectCircle($cx, $cy, $cr) {
2558
+ // Tests whether a circle fully encloses a rectangle 0,0,1,1
2559
+ // to see if any further radial gradients need adding (SVG)
2560
+ // If centre of circle is inside 0,0,1,1 square
2561
+ if ($cx >= 0 && $cx <= 1 && $cy >= 0 && $cy <= 1) {
2562
+ $maxd = 1.5;
2563
+ }
2564
+ // distance to four corners
2565
+ else {
2566
+ $d1 = sqrt(pow(($cy-0),2) + pow(($cx-0),2));
2567
+ $d2 = sqrt(pow(($cy-1),2) + pow(($cx-0),2));
2568
+ $d3 = sqrt(pow(($cy-0),2) + pow(($cx-1),2));
2569
+ $d4 = sqrt(pow(($cy-1),2) + pow(($cx-1),2));
2570
+ $maxd = max($d1,$d2,$d3,$d4);
2571
+ }
2572
+ if ($cr < $maxd) { return true; }
2573
+ else { return false; }
2574
+ }
2575
+
2576
+ // mPDF 5.0.040
2577
+ function _testIntersect($x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4) {
2578
+ // Tests whether line (x1, y1) and (x2, y2) [a gradient axis (perpendicular)]
2579
+ // intersects with a specific line segment (x3, y3) and (x4, y4)
2580
+ $a1 = $y2-$y1;
2581
+ $b1 = $x1-$x2;
2582
+ $c1 = $a1*$x1+$b1*$y1;
2583
+ $a2 = $y4-$y3;
2584
+ $b2 = $x3-$x4;
2585
+ $c2 = $a2*$x3+$b2*$y3;
2586
+ $det = $a1*$b2 - $a2*$b1;
2587
+ if($det == 0){ //Lines are parallel
2588
+ return false;
2589
+ }
2590
+ else{
2591
+ $x = ($b2*$c1 - $b1*$c2)/$det;
2592
+ $y = ($a1*$c2 - $a2*$c1)/$det;
2593
+ if ($x >= $x3 && $x <= $x4 && $y >= $y3 && $y <= $y4) { return true; }
2594
+ }
2595
+ return false;
2596
+ }
2597
+
2598
+
2599
+
2600
+ ?>
mPDF/classes/tocontents.php ADDED
@@ -0,0 +1,468 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class tocontents {
4
+
5
+ var $mpdf = null;
6
+ var $_toc;
7
+ var $TOCmark;
8
+ var $TOCoutdent; // mPDF 5.6.31
9
+ var $TOCpreHTML;
10
+ var $TOCpostHTML;
11
+ var $TOCbookmarkText;
12
+ var $TOCusePaging;
13
+ var $TOCuseLinking;
14
+ var $TOCorientation;
15
+ var $TOC_margin_left;
16
+ var $TOC_margin_right;
17
+ var $TOC_margin_top;
18
+ var $TOC_margin_bottom;
19
+ var $TOC_margin_header;
20
+ var $TOC_margin_footer;
21
+ var $TOC_odd_header_name;
22
+ var $TOC_even_header_name;
23
+ var $TOC_odd_footer_name;
24
+ var $TOC_even_footer_name;
25
+ var $TOC_odd_header_value;
26
+ var $TOC_even_header_value;
27
+ var $TOC_odd_footer_value;
28
+ var $TOC_even_footer_value;
29
+ var $TOC_page_selector;
30
+ var $m_TOC;
31
+
32
+ function tocontents(&$mpdf) {
33
+ $this->mpdf = $mpdf;
34
+ $this->_toc=array();
35
+ $this->TOCmark = 0;
36
+ $this->m_TOC=array();
37
+ }
38
+
39
+ function TOCpagebreak($tocfont='', $tocfontsize='', $tocindent='', $TOCusePaging=true, $TOCuseLinking='', $toc_orientation='', $toc_mgl='',$toc_mgr='',$toc_mgt='',$toc_mgb='',$toc_mgh='',$toc_mgf='',$toc_ohname='',$toc_ehname='',$toc_ofname='',$toc_efname='',$toc_ohvalue=0,$toc_ehvalue=0,$toc_ofvalue=0, $toc_efvalue=0, $toc_preHTML='', $toc_postHTML='', $toc_bookmarkText='', $resetpagenum='', $pagenumstyle='', $suppress='', $orientation='', $mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf='',$ohname='',$ehname='',$ofname='',$efname='',$ohvalue=0,$ehvalue=0,$ofvalue=0,$efvalue=0, $toc_id=0, $pagesel='', $toc_pagesel='', $sheetsize='', $toc_sheetsize='', $tocoutdent='') { // mPDF 5.6.19
40
+ if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
41
+ else if (!$toc_id) { $toc_id = 0; }
42
+ else { $toc_id = strtolower($toc_id); }
43
+
44
+ if ($TOCusePaging === false || strtolower($TOCusePaging) == "off" || $TOCusePaging === 0 || $TOCusePaging === "0" || $TOCusePaging === "") { $TOCusePaging = false; }
45
+ else { $TOCusePaging = true; }
46
+ if (!$TOCuseLinking) { $TOCuseLinking = false; }
47
+ if ($toc_id) {
48
+ $this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
49
+ $this->m_TOC[$toc_id]['TOCoutdent'] = $tocoutdent;
50
+ $this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
51
+ $this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
52
+ $this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
53
+
54
+ if ($toc_preHTML) { $this->m_TOC[$toc_id]['TOCpreHTML'] = $toc_preHTML; }
55
+ if ($toc_postHTML) { $this->m_TOC[$toc_id]['TOCpostHTML'] = $toc_postHTML; }
56
+ if ($toc_bookmarkText) { $this->m_TOC[$toc_id]['TOCbookmarkText'] = $toc_bookmarkText; }
57
+
58
+ $this->m_TOC[$toc_id]['TOC_margin_left'] = $toc_mgl;
59
+ $this->m_TOC[$toc_id]['TOC_margin_right'] = $toc_mgr;
60
+ $this->m_TOC[$toc_id]['TOC_margin_top'] = $toc_mgt;
61
+ $this->m_TOC[$toc_id]['TOC_margin_bottom'] = $toc_mgb;
62
+ $this->m_TOC[$toc_id]['TOC_margin_header'] = $toc_mgh;
63
+ $this->m_TOC[$toc_id]['TOC_margin_footer'] = $toc_mgf;
64
+ $this->m_TOC[$toc_id]['TOC_odd_header_name'] = $toc_ohname;
65
+ $this->m_TOC[$toc_id]['TOC_even_header_name'] = $toc_ehname;
66
+ $this->m_TOC[$toc_id]['TOC_odd_footer_name'] = $toc_ofname;
67
+ $this->m_TOC[$toc_id]['TOC_even_footer_name'] = $toc_efname;
68
+ $this->m_TOC[$toc_id]['TOC_odd_header_value'] = $toc_ohvalue;
69
+ $this->m_TOC[$toc_id]['TOC_even_header_value'] = $toc_ehvalue;
70
+ $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = $toc_ofvalue;
71
+ $this->m_TOC[$toc_id]['TOC_even_footer_value'] = $toc_efvalue;
72
+ $this->m_TOC[$toc_id]['TOC_page_selector'] = $toc_pagesel;
73
+ $this->m_TOC[$toc_id]['TOCsheetsize'] = $toc_sheetsize;
74
+ }
75
+ else {
76
+ $this->TOCmark = $this->mpdf->page;
77
+ $this->TOCoutdent = $tocoutdent;
78
+ $this->TOCorientation = $toc_orientation;
79
+ $this->TOCuseLinking = $TOCuseLinking;
80
+ $this->TOCusePaging = $TOCusePaging;
81
+
82
+ if ($toc_preHTML) { $this->TOCpreHTML = $toc_preHTML; }
83
+ if ($toc_postHTML) { $this->TOCpostHTML = $toc_postHTML; }
84
+ if ($toc_bookmarkText) { $this->TOCbookmarkText = $toc_bookmarkText; }
85
+
86
+ $this->TOC_margin_left = $toc_mgl;
87
+ $this->TOC_margin_right = $toc_mgr;
88
+ $this->TOC_margin_top = $toc_mgt;
89
+ $this->TOC_margin_bottom = $toc_mgb;
90
+ $this->TOC_margin_header = $toc_mgh;
91
+ $this->TOC_margin_footer = $toc_mgf;
92
+ $this->TOC_odd_header_name = $toc_ohname;
93
+ $this->TOC_even_header_name = $toc_ehname;
94
+ $this->TOC_odd_footer_name = $toc_ofname;
95
+ $this->TOC_even_footer_name = $toc_efname;
96
+ $this->TOC_odd_header_value = $toc_ohvalue;
97
+ $this->TOC_even_header_value = $toc_ehvalue;
98
+ $this->TOC_odd_footer_value = $toc_ofvalue;
99
+ $this->TOC_even_footer_value = $toc_efvalue;
100
+ $this->TOC_page_selector = $toc_pagesel;
101
+ $this->TOCsheetsize = $toc_sheetsize;
102
+ }
103
+ }
104
+
105
+ // Initiate, and Mark a place for the Table of Contents to be inserted
106
+ function TOC($tocfont='', $tocfontsize=0, $tocindent=0, $resetpagenum='', $pagenumstyle='', $suppress='', $toc_orientation='', $TOCusePaging=true, $TOCuseLinking=false, $toc_id=0, $tocoutdent='') { // mPDF 5.6.19) {
107
+ if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
108
+ else if (!$toc_id) { $toc_id = 0; }
109
+ else { $toc_id = strtolower($toc_id); }
110
+ // To use odd and even pages
111
+ // Cannot start table of contents on an even page
112
+ if (($this->mpdf->mirrorMargins) && (($this->mpdf->page)%2==0)) { // EVEN
113
+ if ($this->mpdf->ColActive) {
114
+ if (count($this->mpdf->columnbuffer)) { $this->mpdf->printcolumnbuffer(); }
115
+ }
116
+ $this->mpdf->AddPage($this->mpdf->CurOrientation,'',$resetpagenum, $pagenumstyle, $suppress);
117
+ }
118
+ else {
119
+ $this->mpdf->PageNumSubstitutions[] = array('from'=>$this->mpdf->page, 'reset'=> $resetpagenum, 'type'=>$pagenumstyle, 'suppress'=>$suppress);
120
+ }
121
+ if ($toc_id) {
122
+ $this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
123
+ $this->m_TOC[$toc_id]['TOCoutdent'] = $tocoutdent;
124
+ $this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
125
+ $this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
126
+ $this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
127
+ }
128
+ else {
129
+ $this->TOCmark = $this->mpdf->page;
130
+ $this->TOCoutdent = $tocoutdent;
131
+ $this->TOCorientation = $toc_orientation;
132
+ $this->TOCuseLinking = $TOCuseLinking;
133
+ $this->TOCusePaging = $TOCusePaging;
134
+ }
135
+ }
136
+
137
+
138
+ function insertTOC() {
139
+ $notocs = 0;
140
+ if ($this->TOCmark) { $notocs = 1; }
141
+ $notocs += count($this->m_TOC);
142
+
143
+ if ($notocs==0) { return; }
144
+
145
+ if (count($this->m_TOC)) { reset($this->m_TOC); }
146
+ $added_toc_pages = 0;
147
+
148
+ if ($this->mpdf->ColActive) { $this->mpdf->SetColumns(0); }
149
+ if (($this->mpdf->mirrorMargins) && (($this->mpdf->page)%2==1)) { // ODD
150
+ $this->mpdf->AddPage($this->mpdf->CurOrientation);
151
+ $extrapage = true;
152
+ }
153
+ else { $extrapage = false; }
154
+
155
+ for ($toci = 0; $toci<$notocs; $toci++) {
156
+ if ($toci==0 && $this->TOCmark) {
157
+ $toc_id = 0;
158
+ $toc_page = $this->TOCmark;
159
+ $tocoutdent = $this->TOCoutdent;
160
+ $toc_orientation = $this->TOCorientation;
161
+ $TOCuseLinking = $this->TOCuseLinking;
162
+ $TOCusePaging = $this->TOCusePaging;
163
+ $toc_preHTML = $this->TOCpreHTML;
164
+ $toc_postHTML = $this->TOCpostHTML;
165
+ $toc_bookmarkText = $this->TOCbookmarkText;
166
+ $toc_mgl = $this->TOC_margin_left;
167
+ $toc_mgr = $this->TOC_margin_right;
168
+ $toc_mgt = $this->TOC_margin_top;
169
+ $toc_mgb = $this->TOC_margin_bottom;
170
+ $toc_mgh = $this->TOC_margin_header;
171
+ $toc_mgf = $this->TOC_margin_footer;
172
+ $toc_ohname = $this->TOC_odd_header_name;
173
+ $toc_ehname = $this->TOC_even_header_name;
174
+ $toc_ofname = $this->TOC_odd_footer_name;
175
+ $toc_efname = $this->TOC_even_footer_name;
176
+ $toc_ohvalue = $this->TOC_odd_header_value;
177
+ $toc_ehvalue = $this->TOC_even_header_value;
178
+ $toc_ofvalue = $this->TOC_odd_footer_value;
179
+ $toc_efvalue = $this->TOC_even_footer_value;
180
+ $toc_page_selector = $this->TOC_page_selector;
181
+ $toc_sheet_size = $this->TOCsheetsize;
182
+ }
183
+ else {
184
+ $arr = current($this->m_TOC);
185
+
186
+ $toc_id = key($this->m_TOC);
187
+ $toc_page = $this->m_TOC[$toc_id]['TOCmark'];
188
+ $tocoutdent = $this->m_TOC[$toc_id]['TOCoutdent'];
189
+ $toc_orientation = $this->m_TOC[$toc_id]['TOCorientation'];
190
+ $TOCuseLinking = $this->m_TOC[$toc_id]['TOCuseLinking'];
191
+ $TOCusePaging = $this->m_TOC[$toc_id]['TOCusePaging'];
192
+ if (isset($this->m_TOC[$toc_id]['TOCpreHTML'])) { $toc_preHTML = $this->m_TOC[$toc_id]['TOCpreHTML']; }
193
+ else { $toc_preHTML = ''; }
194
+ if (isset($this->m_TOC[$toc_id]['TOCpostHTML'])) { $toc_postHTML = $this->m_TOC[$toc_id]['TOCpostHTML']; }
195
+ else { $toc_postHTML = ''; }
196
+ if (isset($this->m_TOC[$toc_id]['TOCbookmarkText'])) { $toc_bookmarkText = $this->m_TOC[$toc_id]['TOCbookmarkText']; }
197
+ else { $toc_bookmarkText = ''; } // *BOOKMARKS*
198
+ $toc_mgl = $this->m_TOC[$toc_id]['TOC_margin_left'];
199
+ $toc_mgr = $this->m_TOC[$toc_id]['TOC_margin_right'];
200
+ $toc_mgt = $this->m_TOC[$toc_id]['TOC_margin_top'];
201
+ $toc_mgb = $this->m_TOC[$toc_id]['TOC_margin_bottom'];
202
+ $toc_mgh = $this->m_TOC[$toc_id]['TOC_margin_header'];
203
+ $toc_mgf = $this->m_TOC[$toc_id]['TOC_margin_footer'];
204
+ $toc_ohname = $this->m_TOC[$toc_id]['TOC_odd_header_name'];
205
+ $toc_ehname = $this->m_TOC[$toc_id]['TOC_even_header_name'];
206
+ $toc_ofname = $this->m_TOC[$toc_id]['TOC_odd_footer_name'];
207
+ $toc_efname = $this->m_TOC[$toc_id]['TOC_even_footer_name'];
208
+ $toc_ohvalue = $this->m_TOC[$toc_id]['TOC_odd_header_value'];
209
+ $toc_ehvalue = $this->m_TOC[$toc_id]['TOC_even_header_value'];
210
+ $toc_ofvalue = $this->m_TOC[$toc_id]['TOC_odd_footer_value'];
211
+ $toc_efvalue = $this->m_TOC[$toc_id]['TOC_even_footer_value'];
212
+ $toc_page_selector = $this->m_TOC[$toc_id]['TOC_page_selector'];
213
+ $toc_sheet_size = $this->m_TOC[$toc_id]['TOCsheetsize'];
214
+ next($this->m_TOC);
215
+ }
216
+
217
+ // mPDF 5.6.31
218
+
219
+ if (!$toc_orientation) { $toc_orientation= $this->mpdf->DefOrientation; }
220
+ $this->mpdf->AddPage($toc_orientation, '', '', '', "on", $toc_mgl, $toc_mgr, $toc_mgt, $toc_mgb, $toc_mgh, $toc_mgf, $toc_ohname, $toc_ehname, $toc_ofname, $toc_efname, $toc_ohvalue, $toc_ehvalue, $toc_ofvalue, $toc_efvalue, $toc_page_selector, $toc_sheet_size );
221
+
222
+ $this->mpdf->writingToC = true; // mPDF 5.6.38
223
+ // mPDF 5.6.31
224
+ $tocstart=count($this->mpdf->pages);
225
+ if ($toc_preHTML) { $this->mpdf->WriteHTML($toc_preHTML); }
226
+
227
+
228
+ // mPDF 5.6.19
229
+ $html ='<div class="mpdf_toc" id="mpdf_toc_'.$toc_id.'">';
230
+ foreach($this->_toc as $t) {
231
+ if ($t['toc_id']==='_mpdf_all' || $t['toc_id']===$toc_id ) {
232
+ $html .= '<div class="mpdf_toc_level_'.$t['l'].'">';
233
+ if ($TOCuseLinking) { $html .= '<a class="mpdf_toc_a" href="#__mpdfinternallink_'.$t['link'].'">'; }
234
+ $html .= '<span class="mpdf_toc_t_level_'.$t['l'].'">'.$t['t'].'</span>';
235
+ if ($TOCuseLinking) { $html .= '</a>'; }
236
+ if (!$tocoutdent) { $tocoutdent = '0'; }
237
+ if ($TOCusePaging) { $html .= ' <dottab outdent="'.$tocoutdent.'" /> ';
238
+ if ($TOCuseLinking) { $html .= '<a class="mpdf_toc_a" href="#__mpdfinternallink_'.$t['link'].'">'; }
239
+ $html .= '<span class="mpdf_toc_p_level_'.$t['l'].'">'.$this->mpdf->docPageNum($t['p']).'</span>';
240
+ if ($TOCuseLinking) { $html .= '</a>'; }
241
+ }
242
+ $html .= '</div>';
243
+ }
244
+ }
245
+ $html .= '</div>';
246
+ $this->mpdf->WriteHTML($html);
247
+
248
+ if ($toc_postHTML) { $this->mpdf->WriteHTML($toc_postHTML); }
249
+ $this->mpdf->writingToC = false; // mPDF 5.6.38
250
+ $this->mpdf->AddPage($toc_orientation,'E');
251
+
252
+ $n_toc = $this->mpdf->page - $tocstart + 1;
253
+
254
+ if ($toci==0 && $this->TOCmark) {
255
+ $TOC_start = $tocstart ;
256
+ $TOC_end = $this->mpdf->page;
257
+ $TOC_npages = $n_toc;
258
+ }
259
+ else {
260
+ $this->m_TOC[$toc_id]['start'] = $tocstart ;
261
+ $this->m_TOC[$toc_id]['end'] = $this->mpdf->page;
262
+ $this->m_TOC[$toc_id]['npages'] = $n_toc;
263
+ }
264
+ }
265
+
266
+ $s = '';
267
+
268
+ $s .= $this->mpdf->PrintBodyBackgrounds();
269
+
270
+ $s .= $this->mpdf->PrintPageBackgrounds();
271
+ $this->mpdf->pages[$this->mpdf->page] = preg_replace('/(___BACKGROUND___PATTERNS'.date('jY').')/', "\n".$s."\n".'\\1', $this->mpdf->pages[$this->mpdf->page]);
272
+ $this->mpdf->pageBackgrounds = array();
273
+
274
+ //Page footer
275
+ $this->mpdf->InFooter=true;
276
+ $this->mpdf->Footer();
277
+ $this->mpdf->InFooter=false;
278
+
279
+ // 2nd time through to move pages etc.
280
+ $added_toc_pages = 0;
281
+ if (count($this->m_TOC)) { reset($this->m_TOC); }
282
+
283
+ for ($toci = 0; $toci<$notocs; $toci++) {
284
+ if ($toci==0 && $this->TOCmark) {
285
+ $toc_id = 0;
286
+ $toc_page = $this->TOCmark + $added_toc_pages;
287
+ $toc_orientation = $this->TOCorientation;
288
+ $TOCuseLinking = $this->TOCuseLinking;
289
+ $TOCusePaging = $this->TOCusePaging;
290
+ $toc_bookmarkText = $this->TOCbookmarkText; // *BOOKMARKS*
291
+
292
+ $tocstart = $TOC_start ;
293
+ $tocend = $n = $TOC_end;
294
+ $n_toc = $TOC_npages;
295
+ }
296
+ else {
297
+ $arr = current($this->m_TOC);
298
+
299
+ $toc_id = key($this->m_TOC);
300
+ $toc_page = $this->m_TOC[$toc_id]['TOCmark'] + $added_toc_pages;
301
+ $toc_orientation = $this->m_TOC[$toc_id]['TOCorientation'];
302
+ $TOCuseLinking = $this->m_TOC[$toc_id]['TOCuseLinking'];
303
+ $TOCusePaging = $this->m_TOC[$toc_id]['TOCusePaging'];
304
+ $toc_bookmarkText = $this->m_TOC[$toc_id]['TOCbookmarkText']; // *BOOKMARKS*
305
+
306
+ $tocstart = $this->m_TOC[$toc_id]['start'] ;
307
+ $tocend = $n = $this->m_TOC[$toc_id]['end'] ;
308
+ $n_toc = $this->m_TOC[$toc_id]['npages'] ;
309
+
310
+ next($this->m_TOC);
311
+ }
312
+
313
+ // Now pages moved
314
+ $added_toc_pages += $n_toc;
315
+
316
+ $this->mpdf->MovePages($toc_page, $tocstart, $tocend) ;
317
+ $this->mpdf->pgsIns[$toc_page] = $tocend - $tocstart + 1;
318
+
319
+ /*-- BOOKMARKS --*/
320
+ // Insert new Bookmark for Bookmark
321
+ if ($toc_bookmarkText) {
322
+ $insert = -1;
323
+ foreach($this->mpdf->BMoutlines as $i=>$o) {
324
+ if($o['p']<$toc_page) { // i.e. before point of insertion
325
+ $insert = $i;
326
+ }
327
+ }
328
+ $txt = $this->mpdf->purify_utf8_text($toc_bookmarkText);
329
+ if ($this->mpdf->text_input_as_HTML) {
330
+ $txt = $this->mpdf->all_entities_to_utf8($txt);
331
+ }
332
+ $newBookmark[0] = array('t'=>$txt,'l'=>0,'y'=>0,'p'=>$toc_page );
333
+ array_splice($this->mpdf->BMoutlines,($insert+1),0,$newBookmark);
334
+ }
335
+ /*-- END BOOKMARKS --*/
336
+
337
+ }
338
+
339
+ // Delete empty page that was inserted earlier
340
+ if ($extrapage) {
341
+ unset($this->mpdf->pages[count($this->mpdf->pages)]);
342
+ $this->mpdf->page--; // Reset page pointer
343
+ }
344
+
345
+
346
+ }
347
+
348
+
349
+ function openTagTOC($attr) {
350
+ if (isset($attr['OUTDENT']) && $attr['OUTDENT']) { $tocoutdent = $attr['OUTDENT']; } else { $tocoutdent = ''; } // mPDF 5.6.19
351
+ if (isset($attr['RESETPAGENUM']) && $attr['RESETPAGENUM']) { $resetpagenum = $attr['RESETPAGENUM']; } else { $resetpagenum = ''; }
352
+ if (isset($attr['PAGENUMSTYLE']) && $attr['PAGENUMSTYLE']) { $pagenumstyle = $attr['PAGENUMSTYLE']; } else { $pagenumstyle= ''; }
353
+ if (isset($attr['SUPPRESS']) && $attr['SUPPRESS']) { $suppress = $attr['SUPPRESS']; } else { $suppress = ''; }
354
+ if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) { $toc_orientation = $attr['TOC-ORIENTATION']; } else { $toc_orientation = ''; }
355
+ if (isset($attr['PAGING']) && (strtoupper($attr['PAGING'])=='OFF' || $attr['PAGING']==='0')) { $paging = false; }
356
+ else { $paging = true; }
357
+ if (isset($attr['LINKS']) && (strtoupper($attr['LINKS'])=='ON' || $attr['LINKS']==1)) { $links = true; }
358
+ else { $links = false; }
359
+ if (isset($attr['NAME']) && $attr['NAME']) { $toc_id = strtolower($attr['NAME']); } else { $toc_id = 0; }
360
+ $this->TOC('',0,0,$resetpagenum, $pagenumstyle, $suppress, $toc_orientation, $paging, $links, $toc_id, $tocoutdent); // mPDF 5.6.19 5.6.31
361
+ }
362
+
363
+
364
+ function openTagTOCPAGEBREAK($attr) {
365
+ if (isset($attr['NAME']) && $attr['NAME']) { $toc_id = strtolower($attr['NAME']); } else { $toc_id = 0; }
366
+ if ($toc_id) {
367
+ if (isset($attr['OUTDENT']) && $attr['OUTDENT']) { $this->m_TOC[$toc_id]['TOCoutdent'] = $attr['OUTDENT']; } else { $this->m_TOC[$toc_id]['TOCoutdent'] = ''; } // mPDF 5.6.19
368
+ if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) { $this->m_TOC[$toc_id]['TOCorientation'] = $attr['TOC-ORIENTATION']; } else { $this->m_TOC[$toc_id]['TOCorientation'] = ''; }
369
+ if (isset($attr['PAGING']) && (strtoupper($attr['PAGING'])=='OFF' || $attr['PAGING']==='0')) { $this->m_TOC[$toc_id]['TOCusePaging'] = false; }
370
+ else { $this->m_TOC[$toc_id]['TOCusePaging'] = true; }
371
+ if (isset($attr['LINKS']) && (strtoupper($attr['LINKS'])=='ON' || $attr['LINKS']==1)) { $this->m_TOC[$toc_id]['TOCuseLinking'] = true; }
372
+ else { $this->m_TOC[$toc_id]['TOCuseLinking'] = false; }
373
+
374
+ $this->m_TOC[$toc_id]['TOC_margin_left'] = $this->m_TOC[$toc_id]['TOC_margin_right'] = $this->m_TOC[$toc_id]['TOC_margin_top'] = $this->m_TOC[$toc_id]['TOC_margin_bottom'] = $this->m_TOC[$toc_id]['TOC_margin_header'] = $this->m_TOC[$toc_id]['TOC_margin_footer'] = '';
375
+ if (isset($attr['TOC-MARGIN-RIGHT'])) { $this->m_TOC[$toc_id]['TOC_margin_right'] = $this->mpdf->ConvertSize($attr['TOC-MARGIN-RIGHT'],$this->mpdf->w,$this->mpdf->FontSize,false); }
376
+ if (isset($attr['TOC-MARGIN-LEFT'])) { $this->m_TOC[$toc_id]['TOC_margin_left'] = $this->mpdf->ConvertSize($attr['TOC-MARGIN-LEFT'],$this->mpdf->w,$this->mpdf->FontSize,false); }
377
+ if (isset($attr['TOC-MARGIN-TOP'])) { $this->m_TOC[$toc_id]['TOC_margin_top'] = $this->mpdf->ConvertSize($attr['TOC-MARGIN-TOP'],$this->mpdf->w,$this->mpdf->FontSize,false); }
378
+ if (isset($attr['TOC-MARGIN-BOTTOM'])) { $this->m_TOC[$toc_id]['TOC_margin_bottom'] = $this->mpdf->ConvertSize($attr['TOC-MARGIN-BOTTOM'],$this->mpdf->w,$this->mpdf->FontSize,false); }
379
+ if (isset($attr['TOC-MARGIN-HEADER'])) { $this->m_TOC[$toc_id]['TOC_margin_header'] = $this->mpdf->ConvertSize($attr['TOC-MARGIN-HEADER'],$this->mpdf->w,$this->mpdf->FontSize,false); }
380
+ if (isset($attr['TOC-MARGIN-FOOTER'])) { $this->m_TOC[$toc_id]['TOC_margin_footer'] = $this->mpdf->ConvertSize($attr['TOC-MARGIN-FOOTER'],$this->mpdf->w,$this->mpdf->FontSize,false); }
381
+ $this->m_TOC[$toc_id]['TOC_odd_header_name'] = $this->m_TOC[$toc_id]['TOC_even_header_name'] = $this->m_TOC[$toc_id]['TOC_odd_footer_name'] = $this->m_TOC[$toc_id]['TOC_even_footer_name'] = '';
382
+ if (isset($attr['TOC-ODD-HEADER-NAME']) && $attr['TOC-ODD-HEADER-NAME']) { $this->m_TOC[$toc_id]['TOC_odd_header_name'] = $attr['TOC-ODD-HEADER-NAME']; }
383
+ if (isset($attr['TOC-EVEN-HEADER-NAME']) && $attr['TOC-EVEN-HEADER-NAME']) { $this->m_TOC[$toc_id]['TOC_even_header_name'] = $attr['TOC-EVEN-HEADER-NAME']; }
384
+ if (isset($attr['TOC-ODD-FOOTER-NAME']) && $attr['TOC-ODD-FOOTER-NAME']) { $this->m_TOC[$toc_id]['TOC_odd_footer_name'] = $attr['TOC-ODD-FOOTER-NAME']; }
385
+ if (isset($attr['TOC-EVEN-FOOTER-NAME']) && $attr['TOC-EVEN-FOOTER-NAME']) { $this->m_TOC[$toc_id]['TOC_even_footer_name'] = $attr['TOC-EVEN-FOOTER-NAME']; }
386
+ $this->m_TOC[$toc_id]['TOC_odd_header_value'] = $this->m_TOC[$toc_id]['TOC_even_header_value'] = $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = $this->m_TOC[$toc_id]['TOC_even_footer_value'] = 0;
387
+ if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE']=='1' || strtoupper($attr['TOC-ODD-HEADER-VALUE'])=='ON')) { $this->m_TOC[$toc_id]['TOC_odd_header_value'] = 1; }
388
+ else if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE'])=='OFF')) { $this->m_TOC[$toc_id]['TOC_odd_header_value'] = -1; }
389
+ if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='ON')) { $this->m_TOC[$toc_id]['TOC_even_header_value'] = 1; }
390
+ else if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='OFF')) { $this->m_TOC[$toc_id]['TOC_even_header_value'] = -1; }
391
+ if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='ON')) { $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = 1; }
392
+ else if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='OFF')) { $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = -1; }
393
+ if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='ON')) { $this->m_TOC[$toc_id]['TOC_even_footer_value'] = 1; }
394
+ else if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='OFF')) { $this->m_TOC[$toc_id]['TOC_even_footer_value'] = -1; }
395
+ if (isset($attr['TOC-PAGE-SELECTOR']) && $attr['TOC-PAGE-SELECTOR']) { $this->m_TOC[$toc_id]['TOC_page_selector'] = $attr['TOC-PAGE-SELECTOR']; }
396
+ else { $this->m_TOC[$toc_id]['TOC_page_selector'] = ''; }
397
+ if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) { $this->m_TOC[$toc_id]['TOCsheetsize'] = $attr['TOC-SHEET-SIZE']; } else { $this->m_TOC[$toc_id]['TOCsheetsize'] = ''; }
398
+
399
+
400
+ if (isset($attr['TOC-PREHTML']) && $attr['TOC-PREHTML']) { $this->m_TOC[$toc_id]['TOCpreHTML'] = htmlspecialchars_decode($attr['TOC-PREHTML'],ENT_QUOTES); }
401
+ if (isset($attr['TOC-POSTHTML']) && $attr['TOC-POSTHTML']) { $this->m_TOC[$toc_id]['TOCpostHTML'] = htmlspecialchars_decode($attr['TOC-POSTHTML'],ENT_QUOTES); }
402
+
403
+ if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) { $this->m_TOC[$toc_id]['TOCbookmarkText'] = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'],ENT_QUOTES); } // *BOOKMARKS*
404
+ }
405
+ else {
406
+ if (isset($attr['OUTDENT']) && $attr['OUTDENT']) { $this->TOCoutdent = $attr['OUTDENT']; } else { $this->TOCoutdent = ''; } // mPDF 5.6.19
407
+ if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) { $this->TOCorientation = $attr['TOC-ORIENTATION']; } else { $this->TOCorientation = ''; }
408
+ if (isset($attr['PAGING']) && (strtoupper($attr['PAGING'])=='OFF' || $attr['PAGING']==='0')) { $this->TOCusePaging = false; }
409
+ else { $this->TOCusePaging = true; }
410
+ if (isset($attr['LINKS']) && (strtoupper($attr['LINKS'])=='ON' || $attr['LINKS']==1)) { $this->TOCuseLinking = true; }
411
+ else { $this->TOCuseLinking = false; }
412
+
413
+ $this->TOC_margin_left = $this->TOC_margin_right = $this->TOC_margin_top = $this->TOC_margin_bottom = $this->TOC_margin_header = $this->TOC_margin_footer = '';
414
+ if (isset($attr['TOC-MARGIN-RIGHT'])) { $this->TOC_margin_right = $this->mpdf->ConvertSize($attr['TOC-MARGIN-RIGHT'],$this->mpdf->w,$this->mpdf->FontSize,false); }
415
+ if (isset($attr['TOC-MARGIN-LEFT'])) { $this->TOC_margin_left = $this->mpdf->ConvertSize($attr['TOC-MARGIN-LEFT'],$this->mpdf->w,$this->mpdf->FontSize,false); }
416
+ if (isset($attr['TOC-MARGIN-TOP'])) { $this->TOC_margin_top = $this->mpdf->ConvertSize($attr['TOC-MARGIN-TOP'],$this->mpdf->w,$this->mpdf->FontSize,false); }
417
+ if (isset($attr['TOC-MARGIN-BOTTOM'])) { $this->TOC_margin_bottom = $this->mpdf->ConvertSize($attr['TOC-MARGIN-BOTTOM'],$this->mpdf->w,$this->mpdf->FontSize,false); }
418
+ if (isset($attr['TOC-MARGIN-HEADER'])) { $this->TOC_margin_header = $this->mpdf->ConvertSize($attr['TOC-MARGIN-HEADER'],$this->mpdf->w,$this->mpdf->FontSize,false); }
419
+ if (isset($attr['TOC-MARGIN-FOOTER'])) { $this->TOC_margin_footer = $this->mpdf->ConvertSize($attr['TOC-MARGIN-FOOTER'],$this->mpdf->w,$this->mpdf->FontSize,false); }
420
+ $this->TOC_odd_header_name = $this->TOC_even_header_name = $this->TOC_odd_footer_name = $this->TOC_even_footer_name = '';
421
+ if (isset($attr['TOC-ODD-HEADER-NAME']) && $attr['TOC-ODD-HEADER-NAME']) { $this->TOC_odd_header_name = $attr['TOC-ODD-HEADER-NAME']; }
422
+ if (isset($attr['TOC-EVEN-HEADER-NAME']) && $attr['TOC-EVEN-HEADER-NAME']) { $this->TOC_even_header_name = $attr['TOC-EVEN-HEADER-NAME']; }
423
+ if (isset($attr['TOC-ODD-FOOTER-NAME']) && $attr['TOC-ODD-FOOTER-NAME']) { $this->TOC_odd_footer_name = $attr['TOC-ODD-FOOTER-NAME']; }
424
+ if (isset($attr['TOC-EVEN-FOOTER-NAME']) && $attr['TOC-EVEN-FOOTER-NAME']) { $this->TOC_even_footer_name = $attr['TOC-EVEN-FOOTER-NAME']; }
425
+ $this->TOC_odd_header_value = $this->TOC_even_header_value = $this->TOC_odd_footer_value = $this->TOC_even_footer_value = 0;
426
+ if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE']=='1' || strtoupper($attr['TOC-ODD-HEADER-VALUE'])=='ON')) { $this->TOC_odd_header_value = 1; }
427
+ else if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE'])=='OFF')) { $this->TOC_odd_header_value = -1; }
428
+ if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='ON')) { $this->TOC_even_header_value = 1; }
429
+ else if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='OFF')) { $this->TOC_even_header_value = -1; }
430
+
431
+ if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='ON')) { $this->TOC_odd_footer_value = 1; }
432
+ else if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='OFF')) { $this->TOC_odd_footer_value = -1; }
433
+ if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='ON')) { $this->TOC_even_footer_value = 1; }
434
+ else if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='OFF')) { $this->TOC_even_footer_value = -1; }
435
+ if (isset($attr['TOC-PAGE-SELECTOR']) && $attr['TOC-PAGE-SELECTOR']) { $this->TOC_page_selector = $attr['TOC-PAGE-SELECTOR']; }
436
+ else { $this->TOC_page_selector = ''; }
437
+ if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) { $this->TOCsheetsize = $attr['TOC-SHEET-SIZE']; } else { $this->TOCsheetsize = ''; }
438
+
439
+ if (isset($attr['TOC-PREHTML']) && $attr['TOC-PREHTML']) { $this->TOCpreHTML = htmlspecialchars_decode($attr['TOC-PREHTML'],ENT_QUOTES); }
440
+ if (isset($attr['TOC-POSTHTML']) && $attr['TOC-POSTHTML']) { $this->TOCpostHTML = htmlspecialchars_decode($attr['TOC-POSTHTML'],ENT_QUOTES); }
441
+ if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) { $this->TOCbookmarkText = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'],ENT_QUOTES); }
442
+ }
443
+
444
+ if ($this->mpdf->y == $this->mpdf->tMargin && (!$this->mpdf->mirrorMargins ||($this->mpdf->mirrorMargins && $this->mpdf->page % 2==1))) {
445
+ if ($toc_id) { $this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page; }
446
+ else { $this->TOCmark = $this->mpdf->page; }
447
+ // Don't add a page
448
+ if ($this->mpdf->page==1 && count($this->mpdf->PageNumSubstitutions)==0) {
449
+ $resetpagenum = '';
450
+ $pagenumstyle = '';
451
+ $suppress = '';
452
+ if (isset($attr['RESETPAGENUM'])) { $resetpagenum = $attr['RESETPAGENUM']; }
453
+ if (isset($attr['PAGENUMSTYLE'])) { $pagenumstyle = $attr['PAGENUMSTYLE']; }
454
+ if (isset($attr['SUPPRESS'])) { $suppress = $attr['SUPPRESS']; }
455
+ if (!$suppress) { $suppress = 'off'; }
456
+ if (!$resetpagenum) { $resetpagenum= 1; }
457
+ $this->mpdf->PageNumSubstitutions[] = array('from'=>1, 'reset'=> $resetpagenum, 'type'=>$pagenumstyle, 'suppress'=> $suppress);
458
+ }
459
+ return array(true, $toc_id);
460
+ }
461
+ // No break - continues as PAGEBREAK...
462
+ return array(false, $toc_id);
463
+ }
464
+
465
+
466
+ }
467
+
468
+ ?>
mPDF/classes/ttfontsuni.php ADDED
@@ -0,0 +1,2066 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*******************************************************************************
4
+ * TTFontFile class *
5
+ * *
6
+ * Version: 2.01 *
7
+ * Date: 2012-02-25 *
8
+ * Author: Ian Back <ianb@bpm1.com> *
9
+ * License: LGPL *
10
+ * Copyright (c) Ian Back, 2010 *
11
+ * This class is based on The ReportLab Open Source PDF library *
12
+ * written in Python - http://www.reportlab.com/software/opensource/ *
13
+ * together with ideas from the OpenOffice source code and others. *
14
+ * This header must be retained in any redistribution or *
15
+ * modification of the file. *
16
+ * *
17
+ *******************************************************************************/
18
+
19
+ // Define the value used in the "head" table of a created TTF file
20
+ // 0x74727565 "true" for Mac
21
+ // 0x00010000 for Windows
22
+ // Either seems to work for a font embedded in a PDF file
23
+ // when read by Adobe Reader on a Windows PC(!)
24
+ if (!defined('_TTF_MAC_HEADER')) define("_TTF_MAC_HEADER", false);
25
+
26
+ // Recalculate correct metadata/profiles when making subset fonts (not SIP/SMP)
27
+ // e.g. xMin, xMax, maxNContours
28
+ if (!defined('_RECALC_PROFILE')) define("_RECALC_PROFILE", false);
29
+
30
+ // TrueType Font Glyph operators
31
+ define("GF_WORDS",(1 << 0));
32
+ define("GF_SCALE",(1 << 3));
33
+ define("GF_MORE",(1 << 5));
34
+ define("GF_XYSCALE",(1 << 6));
35
+ define("GF_TWOBYTWO",(1 << 7));
36
+
37
+
38
+
39
+ class TTFontFile {
40
+
41
+ var $unAGlyphs; // mPDF 5.4.05
42
+ var $panose;
43
+ var $maxUni;
44
+ var $sFamilyClass;
45
+ var $sFamilySubClass;
46
+ var $sipset;
47
+ var $smpset;
48
+ var $_pos;
49
+ var $numTables;
50
+ var $searchRange;
51
+ var $entrySelector;
52
+ var $rangeShift;
53
+ var $tables;
54
+ var $otables;
55
+ var $filename;
56
+ var $fh;
57
+ var $glyphPos;
58
+ var $charToGlyph;
59
+ var $ascent;
60
+ var $descent;
61
+ var $name;
62
+ var $familyName;
63
+ var $styleName;
64
+ var $fullName;
65
+ var $uniqueFontID;
66
+ var $unitsPerEm;
67
+ var $bbox;
68
+ var $capHeight;
69
+ var $stemV;
70
+ var $italicAngle;
71
+ var $flags;
72
+ var $underlinePosition;
73
+ var $underlineThickness;
74
+ var $charWidths;
75
+ var $defaultWidth;
76
+ var $maxStrLenRead;
77
+ var $numTTCFonts;
78
+ var $TTCFonts;
79
+ var $maxUniChar;
80
+ var $kerninfo;
81
+
82
+ function TTFontFile() {
83
+ $this->maxStrLenRead = 200000; // Maximum size of glyf table to read in as string (otherwise reads each glyph from file)
84
+ }
85
+
86
+
87
+ function getMetrics($file, $TTCfontID=0, $debug=false, $BMPonly=false, $kerninfo=false, $unAGlyphs=false) { // mPDF 5.4.05
88
+ $this->unAGlyphs = $unAGlyphs; // mPDF 5.4.05
89
+ $this->filename = $file;
90
+ $this->fh = fopen($file,'rb') or die('Can\'t open file ' . $file);
91
+ $this->_pos = 0;
92
+ $this->charWidths = '';
93
+ $this->glyphPos = array();
94
+ $this->charToGlyph = array();
95
+ $this->tables = array();
96
+ $this->otables = array();
97
+ $this->kerninfo = array();
98
+ $this->ascent = 0;
99
+ $this->descent = 0;
100
+ $this->numTTCFonts = 0;
101
+ $this->TTCFonts = array();
102
+ $this->version = $version = $this->read_ulong();
103
+ $this->panose = array();
104
+ if ($version==0x4F54544F)
105
+ die("Postscript outlines are not supported");
106
+ if ($version==0x74746366 && !$TTCfontID)
107
+ die("ERROR - You must define the TTCfontID for a TrueType Collection in config_fonts.php (". $file.")");
108
+ if (!in_array($version, array(0x00010000,0x74727565)) && !$TTCfontID)
109
+ die("Not a TrueType font: version=".$version);
110
+ if ($TTCfontID > 0) {
111
+ $this->version = $version = $this->read_ulong(); // TTC Header version now
112
+ if (!in_array($version, array(0x00010000,0x00020000)))
113
+ die("ERROR - Error parsing TrueType Collection: version=".$version." - " . $file);
114
+ $this->numTTCFonts = $this->read_ulong();
115
+ for ($i=1; $i<=$this->numTTCFonts; $i++) {
116
+ $this->TTCFonts[$i]['offset'] = $this->read_ulong();
117
+ }
118
+ $this->seek($this->TTCFonts[$TTCfontID]['offset']);
119
+ $this->version = $version = $this->read_ulong(); // TTFont version again now
120
+ }
121
+ $this->readTableDirectory($debug);
122
+ $this->extractInfo($debug, $BMPonly, $kerninfo);
123
+ fclose($this->fh);
124
+ }
125
+
126
+
127
+ function readTableDirectory($debug=false) {
128
+ $this->numTables = $this->read_ushort();
129
+ $this->searchRange = $this->read_ushort();
130
+ $this->entrySelector = $this->read_ushort();
131
+ $this->rangeShift = $this->read_ushort();
132
+ $this->tables = array();
133
+ for ($i=0;$i<$this->numTables;$i++) {
134
+ $record = array();
135
+ $record['tag'] = $this->read_tag();
136
+ $record['checksum'] = array($this->read_ushort(),$this->read_ushort());
137
+ $record['offset'] = $this->read_ulong();
138
+ $record['length'] = $this->read_ulong();
139
+ $this->tables[$record['tag']] = $record;
140
+ }
141
+ //if ($debug) $this->checksumTables();
142
+ }
143
+
144
+ function checksumTables() {
145
+ // Check the checksums for all tables
146
+ foreach($this->tables AS $t) {
147
+ if ($t['length'] > 0 && $t['length'] < $this->maxStrLenRead) { // 1.02
148
+ $table = $this->get_chunk($t['offset'], $t['length']);
149
+ $checksum = $this->calcChecksum($table);
150
+ if ($t['tag'] == 'head') {
151
+ $up = unpack('n*', substr($table,8,4));
152
+ $adjustment[0] = $up[1];
153
+ $adjustment[1] = $up[2];
154
+ $checksum = $this->sub32($checksum, $adjustment);
155
+ }
156
+ $xchecksum = $t['checksum'];
157
+
158
+ if ($xchecksum != $checksum)
159
+ die(sprintf('TTF file "%s": invalid checksum %s table: %s (expected %s)', $this->filename,dechex($checksum[0]).dechex($checksum[1]),$t['tag'],dechex($xchecksum[0]).dechex($xchecksum[1])));
160
+ }
161
+ }
162
+ }
163
+
164
+ function sub32($x, $y) {
165
+ $xlo = $x[1];
166
+ $xhi = $x[0];
167
+ $ylo = $y[1];
168
+ $yhi = $y[0];
169
+ if ($ylo > $xlo) { $xlo += 1 << 16; $yhi += 1; }
170
+ $reslo = $xlo-$ylo;
171
+ if ($yhi > $xhi) { $xhi += 1 << 16; }
172
+ $reshi = $xhi-$yhi;
173
+ $reshi = $reshi & 0xFFFF;
174
+ return array($reshi, $reslo);
175
+ }
176
+
177
+ function calcChecksum($data) {
178
+ if (strlen($data) % 4) { $data .= str_repeat("\0",(4-(strlen($data) % 4))); }
179
+ $len = strlen($data);
180
+ $hi=0x0000;
181
+ $lo=0x0000;
182
+ for($i=0;$i<$len;$i+=4) {
183
+ $hi += (ord($data[$i])<<8) + ord($data[$i+1]);
184
+ $lo += (ord($data[$i+2])<<8) + ord($data[$i+3]);
185
+ $hi += ($lo >> 16) & 0xFFFF;
186
+ $lo = $lo & 0xFFFF;
187
+ }
188
+ return array($hi, $lo);
189
+ }
190
+
191
+ function get_table_pos($tag) {
192
+ $offset = $this->tables[$tag]['offset'];
193
+ $length = $this->tables[$tag]['length'];
194
+ return array($offset, $length);
195
+ }
196
+
197
+ function seek($pos) {
198
+ $this->_pos = $pos;
199
+ fseek($this->fh,$this->_pos);
200
+ }
201
+
202
+ function skip($delta) {
203
+ $this->_pos = $this->_pos + $delta;
204
+ fseek($this->fh,$delta,SEEK_CUR);
205
+ }
206
+
207
+ function seek_table($tag, $offset_in_table = 0) {
208
+ $tpos = $this->get_table_pos($tag);
209
+ $this->_pos = $tpos[0] + $offset_in_table;
210
+ fseek($this->fh, $this->_pos);
211
+ return $this->_pos;
212
+ }
213
+
214
+ function read_tag() {
215
+ $this->_pos += 4;
216
+ return fread($this->fh,4);
217
+ }
218
+
219
+ function read_short() {
220
+ $this->_pos += 2;
221
+ $s = fread($this->fh,2);
222
+ $a = (ord($s[0])<<8) + ord($s[1]);
223
+ if ($a & (1 << 15) ) {
224
+ $a = ($a - (1 << 16));
225
+ }
226
+ return $a;
227
+ }
228
+
229
+ function unpack_short($s) {
230
+ $a = (ord($s[0])<<8) + ord($s[1]);
231
+ if ($a & (1 << 15) ) {
232
+ $a = ($a - (1 << 16));
233
+ }
234
+ return $a;
235
+ }
236
+
237
+ function read_ushort() {
238
+ $this->_pos += 2;
239
+ $s = fread($this->fh,2);
240
+ return (ord($s[0])<<8) + ord($s[1]);
241
+ }
242
+
243
+ function read_ulong() {
244
+ $this->_pos += 4;
245
+ $s = fread($this->fh,4);
246
+ // if large uInt32 as an integer, PHP converts it to -ve
247
+ return (ord($s[0])*16777216) + (ord($s[1])<<16) + (ord($s[2])<<8) + ord($s[3]); // 16777216 = 1<<24
248
+ }
249
+
250
+ function get_ushort($pos) {
251
+ fseek($this->fh,$pos);
252
+ $s = fread($this->fh,2);
253
+ return (ord($s[0])<<8) + ord($s[1]);
254
+ }
255
+
256
+ function get_ulong($pos) {
257
+ fseek($this->fh,$pos);
258
+ $s = fread($this->fh,4);
259
+ // iF large uInt32 as an integer, PHP converts it to -ve
260
+ return (ord($s[0])*16777216) + (ord($s[1])<<16) + (ord($s[2])<<8) + ord($s[3]); // 16777216 = 1<<24
261
+ }
262
+
263
+ function pack_short($val) {
264
+ if ($val<0) {
265
+ $val = abs($val);
266
+ $val = ~$val;
267
+ $val += 1;
268
+ }
269
+ return pack("n",$val);
270
+ }
271
+
272
+ function splice($stream, $offset, $value) {
273
+ return substr($stream,0,$offset) . $value . substr($stream,$offset+strlen($value));
274
+ }
275
+
276
+ function _set_ushort($stream, $offset, $value) {
277
+ $up = pack("n", $value);
278
+ return $this->splice($stream, $offset, $up);
279
+ }
280
+
281
+ function _set_short($stream, $offset, $val) {
282
+ if ($val<0) {
283
+ $val = abs($val);
284
+ $val = ~$val;
285
+ $val += 1;
286
+ }
287
+ $up = pack("n",$val);
288
+ return $this->splice($stream, $offset, $up);
289
+ }
290
+
291
+ function get_chunk($pos, $length) {
292
+ fseek($this->fh,$pos);
293
+ if ($length <1) { return ''; }
294
+ return (fread($this->fh,$length));
295
+ }
296
+
297
+ function get_table($tag) {
298
+ list($pos, $length) = $this->get_table_pos($tag);
299
+ if ($length == 0) { return ''; }
300
+ fseek($this->fh,$pos);
301
+ return (fread($this->fh,$length));
302
+ }
303
+
304
+ function add($tag, $data) {
305
+ if ($tag == 'head') {
306
+ $data = $this->splice($data, 8, "\0\0\0\0");
307
+ }
308
+ $this->otables[$tag] = $data;
309
+ }
310
+
311
+
312
+
313
+ /////////////////////////////////////////////////////////////////////////////////////////
314
+ function getCTG($file, $TTCfontID=0, $debug=false, $unAGlyphs=false) { // mPDF 5.4.05
315
+ $this->unAGlyphs = $unAGlyphs; // mPDF 5.4.05
316
+ $this->filename = $file;
317
+ $this->fh = fopen($file,'rb') or die('Can\'t open file ' . $file);
318
+ $this->_pos = 0;
319
+ $this->charWidths = '';
320
+ $this->glyphPos = array();
321
+ $this->charToGlyph = array();
322
+ $this->tables = array();
323
+ $this->numTTCFonts = 0;
324
+ $this->TTCFonts = array();
325
+ $this->skip(4);
326
+ if ($TTCfontID > 0) {
327
+ $this->version = $version = $this->read_ulong(); // TTC Header version now
328
+ if (!in_array($version, array(0x00010000,0x00020000)))
329
+ die("ERROR - Error parsing TrueType Collection: version=".$version." - " . $file);
330
+ $this->numTTCFonts = $this->read_ulong();
331
+ for ($i=1; $i<=$this->numTTCFonts; $i++) {
332
+ $this->TTCFonts[$i]['offset'] = $this->read_ulong();
333
+ }
334
+ $this->seek($this->TTCFonts[$TTCfontID]['offset']);
335
+ $this->version = $version = $this->read_ulong(); // TTFont version again now
336
+ }
337
+
338
+ $this->readTableDirectory($debug);
339
+
340
+ // cmap - Character to glyph index mapping table
341
+ $cmap_offset = $this->seek_table("cmap");
342
+ $this->skip(2);
343
+ $cmapTableCount = $this->read_ushort();
344
+ $unicode_cmap_offset = 0;
345
+ for ($i=0;$i<$cmapTableCount;$i++) {
346
+ $platformID = $this->read_ushort();
347
+ $encodingID = $this->read_ushort();
348
+ $offset = $this->read_ulong();
349
+ $save_pos = $this->_pos;
350
+ if ($platformID == 3 && $encodingID == 1) { // Microsoft, Unicode
351
+ $format = $this->get_ushort($cmap_offset + $offset);
352
+ if ($format == 4) {
353
+ $unicode_cmap_offset = $cmap_offset + $offset;
354
+ break;
355
+ }
356
+ }
357
+ else if ($platformID == 0) { // Unicode -- assume all encodings are compatible
358
+ $format = $this->get_ushort($cmap_offset + $offset);
359
+ if ($format == 4) {
360
+ $unicode_cmap_offset = $cmap_offset + $offset;
361
+ break;
362
+ }
363
+ }
364
+ $this->seek($save_pos );
365
+ }
366
+
367
+ $glyphToChar = array();
368
+ $charToGlyph = array();
369
+ $this->getCMAP4($unicode_cmap_offset, $glyphToChar, $charToGlyph );
370
+
371
+ fclose($this->fh);
372
+ return ($charToGlyph);
373
+ }
374
+
375
+ /////////////////////////////////////////////////////////////////////////////////////////
376
+ function getTTCFonts($file) {
377
+ $this->filename = $file;
378
+ $this->fh = fopen($file,'rb');
379
+ if (!$this->fh) { return ('ERROR - Can\'t open file ' . $file); }
380
+ $this->numTTCFonts = 0;
381
+ $this->TTCFonts = array();
382
+ $this->version = $version = $this->read_ulong();
383
+ if ($version==0x74746366) {
384
+ $this->version = $version = $this->read_ulong(); // TTC Header version now
385
+ if (!in_array($version, array(0x00010000,0x00020000)))
386
+ return("ERROR - Error parsing TrueType Collection: version=".$version." - " . $file);
387
+ }
388
+ else {
389
+ return("ERROR - Not a TrueType Collection: version=".$version." - " . $file);
390
+ }
391
+ $this->numTTCFonts = $this->read_ulong();
392
+ for ($i=1; $i<=$this->numTTCFonts; $i++) {
393
+ $this->TTCFonts[$i]['offset'] = $this->read_ulong();
394
+ }
395
+ }
396
+
397
+
398
+
399
+ /////////////////////////////////////////////////////////////////////////////////////////
400
+
401
+ /////////////////////////////////////////////////////////////////////////////////////////
402
+
403
+ function extractInfo($debug=false, $BMPonly=false, $kerninfo=false) {
404
+ $this->panose = array();
405
+ $this->sFamilyClass = 0;
406
+ $this->sFamilySubClass = 0;
407
+ ///////////////////////////////////
408
+ // name - Naming table
409
+ ///////////////////////////////////
410
+ $name_offset = $this->seek_table("name");
411
+ $format = $this->read_ushort();
412
+ if ($format != 0 && $format != 1)
413
+ die("Unknown name table format ".$format);
414
+ $numRecords = $this->read_ushort();
415
+ $string_data_offset = $name_offset + $this->read_ushort();
416
+ $names = array(1=>'',2=>'',3=>'',4=>'',6=>'');
417
+ $K = array_keys($names);
418
+ $nameCount = count($names);
419
+ for ($i=0;$i<$numRecords; $i++) {
420
+ $platformId = $this->read_ushort();
421
+ $encodingId = $this->read_ushort();
422
+ $languageId = $this->read_ushort();
423
+ $nameId = $this->read_ushort();
424
+ $length = $this->read_ushort();
425
+ $offset = $this->read_ushort();
426
+ if (!in_array($nameId,$K)) continue;
427
+ $N = '';
428
+ if ($platformId == 3 && $encodingId == 1 && $languageId == 0x409) { // Microsoft, Unicode, US English, PS Name
429
+ $opos = $this->_pos;
430
+ $this->seek($string_data_offset + $offset);
431
+ if ($length % 2 != 0)
432
+ die("PostScript name is UTF-16BE string of odd length");
433
+ $length /= 2;
434
+ $N = '';
435
+ while ($length > 0) {
436
+ $char = $this->read_ushort();
437
+ $N .= (chr($char));
438
+ $length -= 1;
439
+ }
440
+ $this->_pos = $opos;
441
+ $this->seek($opos);
442
+ }
443
+ else if ($platformId == 1 && $encodingId == 0 && $languageId == 0) { // Macintosh, Roman, English, PS Name
444
+ $opos = $this->_pos;
445
+ $N = $this->get_chunk($string_data_offset + $offset, $length);
446
+ $this->_pos = $opos;
447
+ $this->seek($opos);
448
+ }
449
+ if ($N && $names[$nameId]=='') {
450
+ $names[$nameId] = $N;
451
+ $nameCount -= 1;
452
+ if ($nameCount==0) break;
453
+ }
454
+ }
455
+ if ($names[6])
456
+ $psName = $names[6];
457
+ else if ($names[4])
458
+ $psName = preg_replace('/ /','-',$names[4]);
459
+ else if ($names[1])
460
+ $psName = preg_replace('/ /','-',$names[1]);
461
+ else
462
+ $psName = '';
463
+ if (!$psName)
464
+ die("Could not find PostScript font name: ".$this->filename);
465
+ if ($debug) {
466
+ for ($i=0;$i<count($psName);$i++) {
467
+ $c = $psName[$i];
468
+ $oc = ord($c);
469
+ if ($oc>126 || strpos(' [](){}<>/%',$c)!==false)
470
+ die("psName=".$psName." contains invalid character ".$c." ie U+".ord(c));
471
+ }
472
+ }
473
+ $this->name = $psName;
474
+ if ($names[1]) { $this->familyName = $names[1]; } else { $this->familyName = $psName; }
475
+ if ($names[2]) { $this->styleName = $names[2]; } else { $this->styleName = 'Regular'; }
476
+ if ($names[4]) { $this->fullName = $names[4]; } else { $this->fullName = $psName; }
477
+ if ($names[3]) { $this->uniqueFontID = $names[3]; } else { $this->uniqueFontID = $psName; }
478
+
479
+ if ($names[6]) { $this->fullName = $names[6]; }
480
+
481
+ ///////////////////////////////////
482
+ // head - Font header table
483
+ ///////////////////////////////////
484
+ $this->seek_table("head");
485
+ if ($debug) {
486
+ $ver_maj = $this->read_ushort();
487
+ $ver_min = $this->read_ushort();
488
+ if ($ver_maj != 1)
489
+ die('Unknown head table version '. $ver_maj .'.'. $ver_min);
490
+ $this->fontRevision = $this->read_ushort() . $this->read_ushort();
491
+
492
+ $this->skip(4);
493
+ $magic = $this->read_ulong();
494
+ if ($magic != 0x5F0F3CF5)
495
+ die('Invalid head table magic ' .$magic);
496
+ $this->skip(2);
497
+ }
498
+ else {
499
+ $this->skip(18);
500
+ }
501
+ $this->unitsPerEm = $unitsPerEm = $this->read_ushort();
502
+ $scale = 1000 / $unitsPerEm;
503
+ $this->skip(16);
504
+ $xMin = $this->read_short();
505
+ $yMin = $this->read_short();
506
+ $xMax = $this->read_short();
507
+ $yMax = $this->read_short();
508
+ $this->bbox = array(($xMin*$scale), ($yMin*$scale), ($xMax*$scale), ($yMax*$scale));
509
+ $this->skip(3*2);
510
+ $indexToLocFormat = $this->read_ushort();
511
+ $glyphDataFormat = $this->read_ushort();
512
+ if ($glyphDataFormat != 0)
513
+ die('Unknown glyph data format '.$glyphDataFormat);
514
+
515
+ ///////////////////////////////////
516
+ // hhea metrics table
517
+ ///////////////////////////////////
518
+ // ttf2t1 seems to use this value rather than the one in OS/2 - so put in for compatibility
519
+ if (isset($this->tables["hhea"])) {
520
+ $this->seek_table("hhea");
521
+ $this->skip(4);
522
+ $hheaAscender = $this->read_short();
523
+ $hheaDescender = $this->read_short();
524
+ $this->ascent = ($hheaAscender *$scale);
525
+ $this->descent = ($hheaDescender *$scale);
526
+ }
527
+
528
+ ///////////////////////////////////
529
+ // OS/2 - OS/2 and Windows metrics table
530
+ ///////////////////////////////////
531
+ if (isset($this->tables["OS/2"])) {
532
+ $this->seek_table("OS/2");
533
+ $version = $this->read_ushort();
534
+ $this->skip(2);
535
+ $usWeightClass = $this->read_ushort();
536
+ $this->skip(2);
537
+ $fsType = $this->read_ushort();
538
+ if ($fsType == 0x0002 || ($fsType & 0x0300) != 0) {
539
+ global $overrideTTFFontRestriction;
540
+ if (!$overrideTTFFontRestriction) die('ERROR - Font file '.$this->filename.' cannot be embedded due to copyright restrictions.');
541
+ $this->restrictedUse = true;
542
+ }
543
+ $this->skip(20);
544
+ $sF = $this->read_short();
545
+ $this->sFamilyClass = ($sF >> 8);
546
+ $this->sFamilySubClass = ($sF & 0xFF);
547
+ $this->_pos += 10; //PANOSE = 10 byte length
548
+ $panose = fread($this->fh,10);
549
+ $this->panose = array();
550
+ for ($p=0;$p<strlen($panose);$p++) { $this->panose[] = ord($panose[$p]); }
551
+ $this->skip(26);
552
+ $sTypoAscender = $this->read_short();
553
+ $sTypoDescender = $this->read_short();
554
+ if (!$this->ascent) $this->ascent = ($sTypoAscender*$scale);
555
+ if (!$this->descent) $this->descent = ($sTypoDescender*$scale);
556
+ if ($version > 1) {
557
+ $this->skip(16);
558
+ $sCapHeight = $this->read_short();
559
+ $this->capHeight = ($sCapHeight*$scale);
560
+ }
561
+ else {
562
+ $this->capHeight = $this->ascent;
563
+ }
564
+ }
565
+ else {
566
+ $usWeightClass = 500;
567
+ if (!$this->ascent) $this->ascent = ($yMax*$scale);
568
+ if (!$this->descent) $this->descent = ($yMin*$scale);
569
+ $this->capHeight = $this->ascent;
570
+ }
571
+ $this->stemV = 50 + intval(pow(($usWeightClass / 65.0),2));
572
+
573
+ ///////////////////////////////////
574
+ // post - PostScript table
575
+ ///////////////////////////////////
576
+ $this->seek_table("post");
577
+ if ($debug) {
578
+ $ver_maj = $this->read_ushort();
579
+ $ver_min = $this->read_ushort();
580
+ if ($ver_maj <1 || $ver_maj >4)
581
+ die('Unknown post table version '.$ver_maj);
582
+ }
583
+ else {
584
+ $this->skip(4);
585
+ }
586
+ $this->italicAngle = $this->read_short() + $this->read_ushort() / 65536.0;
587
+ $this->underlinePosition = $this->read_short() * $scale;
588
+ $this->underlineThickness = $this->read_short() * $scale;
589
+ $isFixedPitch = $this->read_ulong();
590
+
591
+ $this->flags = 4;
592
+
593
+ if ($this->italicAngle!= 0)
594
+ $this->flags = $this->flags | 64;
595
+ if ($usWeightClass >= 600)
596
+ $this->flags = $this->flags | 262144;
597
+ if ($isFixedPitch)
598
+ $this->flags = $this->flags | 1;
599
+
600
+ ///////////////////////////////////
601
+ // hhea - Horizontal header table
602
+ ///////////////////////////////////
603
+ $this->seek_table("hhea");
604
+ if ($debug) {
605
+ $ver_maj = $this->read_ushort();
606
+ $ver_min = $this->read_ushort();
607
+ if ($ver_maj != 1)
608
+ die('Unknown hhea table version '.$ver_maj);
609
+ $this->skip(28);
610
+ }
611
+ else {
612
+ $this->skip(32);
613
+ }
614
+ $metricDataFormat = $this->read_ushort();
615
+ if ($metricDataFormat != 0)
616
+ die('Unknown horizontal metric data format '.$metricDataFormat);
617
+ $numberOfHMetrics = $this->read_ushort();
618
+ if ($numberOfHMetrics == 0)
619
+ die('Number of horizontal metrics is 0');
620
+
621
+ ///////////////////////////////////
622
+ // maxp - Maximum profile table
623
+ ///////////////////////////////////
624
+ $this->seek_table("maxp");
625
+ if ($debug) {
626
+ $ver_maj = $this->read_ushort();
627
+ $ver_min = $this->read_ushort();
628
+ if ($ver_maj != 1)
629
+ die('Unknown maxp table version '.$ver_maj);
630
+ }
631
+ else {
632
+ $this->skip(4);
633
+ }
634
+ $numGlyphs = $this->read_ushort();
635
+
636
+
637
+ ///////////////////////////////////
638
+ // cmap - Character to glyph index mapping table
639
+ ///////////////////////////////////
640
+ $cmap_offset = $this->seek_table("cmap");
641
+ $this->skip(2);
642
+ $cmapTableCount = $this->read_ushort();
643
+ $unicode_cmap_offset = 0;
644
+ for ($i=0;$i<$cmapTableCount;$i++) {
645
+ $platformID = $this->read_ushort();
646
+ $encodingID = $this->read_ushort();
647
+ $offset = $this->read_ulong();
648
+ $save_pos = $this->_pos;
649
+ if (($platformID == 3 && $encodingID == 1) || $platformID == 0) { // Microsoft, Unicode
650
+ $format = $this->get_ushort($cmap_offset + $offset);
651
+ if ($format == 4) {
652
+ if (!$unicode_cmap_offset) $unicode_cmap_offset = $cmap_offset + $offset;
653
+ if ($BMPonly) break;
654
+ }
655
+ }
656
+ // Microsoft, Unicode Format 12 table HKCS
657
+ else if ((($platformID == 3 && $encodingID == 10) || $platformID == 0) && !$BMPonly) {
658
+ $format = $this->get_ushort($cmap_offset + $offset);
659
+ if ($format == 12) {
660
+ $unicode_cmap_offset = $cmap_offset + $offset;
661
+ break;
662
+ }
663
+ }
664
+ $this->seek($save_pos );
665
+ }
666
+ if (!$unicode_cmap_offset)
667
+ die('Font ('.$this->filename .') does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)');
668
+
669
+
670
+ $sipset = false;
671
+ $smpset = false;
672
+ // Format 12 CMAP does characters above Unicode BMP i.e. some HKCS characters U+20000 and above
673
+ if ($format == 12 && !$BMPonly) {
674
+ $this->maxUniChar = 0;
675
+ $this->seek($unicode_cmap_offset + 4);
676
+ $length = $this->read_ulong();
677
+ $limit = $unicode_cmap_offset + $length;
678
+ $this->skip(4);
679
+
680
+ $nGroups = $this->read_ulong();
681
+
682
+ $glyphToChar = array();
683
+ $charToGlyph = array();
684
+ for($i=0; $i<$nGroups ; $i++) {
685
+ $startCharCode = $this->read_ulong();
686
+ $endCharCode = $this->read_ulong();
687
+ $startGlyphCode = $this->read_ulong();
688
+ if (($endCharCode > 0x20000 && $endCharCode < 0x2A6DF) || ($endCharCode > 0x2F800 && $endCharCode < 0x2FA1F)) {
689
+ $sipset = true;
690
+ }
691
+ else if ($endCharCode > 0x10000 && $endCharCode < 0x1FFFF) {
692
+ $smpset = true;
693
+ }
694
+ $offset = 0;
695
+ for ($unichar=$startCharCode;$unichar<=$endCharCode;$unichar++) {
696
+ $glyph = $startGlyphCode + $offset ;
697
+ $offset++;
698
+ $charToGlyph[$unichar] = $glyph;
699
+ if ($unichar < 196608) { $this->maxUniChar = max($unichar,$this->maxUniChar); }
700
+ $glyphToChar[$glyph][] = $unichar;
701
+ }
702
+ }
703
+ }
704
+ else {
705
+
706
+ $glyphToChar = array();
707
+ $charToGlyph = array();
708
+ $this->getCMAP4($unicode_cmap_offset, $glyphToChar, $charToGlyph );
709
+
710
+ }
711
+ $this->sipset = $sipset ;
712
+ $this->smpset = $smpset ;
713
+
714
+ ///////////////////////////////////
715
+ // hmtx - Horizontal metrics table
716
+ ///////////////////////////////////
717
+ $this->getHMTX($numberOfHMetrics, $numGlyphs, $glyphToChar, $scale);
718
+
719
+ ///////////////////////////////////
720
+ // kern - Kerning pair table
721
+ ///////////////////////////////////
722
+ if ($kerninfo) {
723
+ // Recognises old form of Kerning table - as required by Windows - Format 0 only
724
+ $kern_offset = $this->seek_table("kern");
725
+ $version = $this->read_ushort();
726
+ $nTables = $this->read_ushort();
727
+ // subtable header
728
+ $sversion = $this->read_ushort();
729
+ $slength = $this->read_ushort();
730
+ $scoverage = $this->read_ushort();
731
+ $format = $scoverage >> 8;
732
+ if ($kern_offset && $version==0 && $format==0) {
733
+ // Format 0
734
+ $nPairs = $this->read_ushort();
735
+ $this->skip(6);
736
+ for ($i=0; $i<$nPairs; $i++) {
737
+ $left = $this->read_ushort();
738
+ $right = $this->read_ushort();
739
+ $val = $this->read_short();
740
+ if (count($glyphToChar[$left])==1 && count($glyphToChar[$right])==1) {
741
+ if ($left != 32 && $right != 32) {
742
+ $this->kerninfo[$glyphToChar[$left][0]][$glyphToChar[$right][0]] = intval($val*$scale);
743
+ }
744
+ }
745
+ }
746
+ }
747
+ }
748
+ }
749
+
750
+
751
+ /////////////////////////////////////////////////////////////////////////////////////////
752
+
753
+
754
+ function makeSubset($file, &$subset, $TTCfontID=0, $debug=false, $unAGlyphs=false) { // mPDF 5.4.05
755
+ $this->unAGlyphs = $unAGlyphs; // mPDF 5.4.05
756
+ $this->filename = $file;
757
+ $this->fh = fopen($file ,'rb') or die('Can\'t open file ' . $file);
758
+ $this->_pos = 0;
759
+ $this->charWidths = '';
760
+ $this->glyphPos = array();
761
+ $this->charToGlyph = array();
762
+ $this->tables = array();
763
+ $this->otables = array();
764
+ $this->ascent = 0;
765
+ $this->descent = 0;
766
+ $this->numTTCFonts = 0;
767
+ $this->TTCFonts = array();
768
+ $this->skip(4);
769
+ $this->maxUni = 0;
770
+ if ($TTCfontID > 0) {
771
+ $this->version = $version = $this->read_ulong(); // TTC Header version now
772
+ if (!in_array($version, array(0x00010000,0x00020000)))
773
+ die("ERROR - Error parsing TrueType Collection: version=".$version." - " . $file);
774
+ $this->numTTCFonts = $this->read_ulong();
775
+ for ($i=1; $i<=$this->numTTCFonts; $i++) {
776
+ $this->TTCFonts[$i]['offset'] = $this->read_ulong();
777
+ }
778
+ $this->seek($this->TTCFonts[$TTCfontID]['offset']);
779
+ $this->version = $version = $this->read_ulong(); // TTFont version again now
780
+ }
781
+ $this->readTableDirectory($debug);
782
+
783
+ ///////////////////////////////////
784
+ // head - Font header table
785
+ ///////////////////////////////////
786
+ $this->seek_table("head");
787
+ $this->skip(50);
788
+ $indexToLocFormat = $this->read_ushort();
789
+ $glyphDataFormat = $this->read_ushort();
790
+
791
+ ///////////////////////////////////
792
+ // hhea - Horizontal header table
793
+ ///////////////////////////////////
794
+ $this->seek_table("hhea");
795
+ $this->skip(32);
796
+ $metricDataFormat = $this->read_ushort();
797
+ $orignHmetrics = $numberOfHMetrics = $this->read_ushort();
798
+
799
+ ///////////////////////////////////
800
+ // maxp - Maximum profile table
801
+ ///////////////////////////////////
802
+ $this->seek_table("maxp");
803
+ $this->skip(4);
804
+ $numGlyphs = $this->read_ushort();
805
+
806
+
807
+ ///////////////////////////////////
808
+ // cmap - Character to glyph index mapping table
809
+ ///////////////////////////////////
810
+ $cmap_offset = $this->seek_table("cmap");
811
+ $this->skip(2);
812
+ $cmapTableCount = $this->read_ushort();
813
+ $unicode_cmap_offset = 0;
814
+ for ($i=0;$i<$cmapTableCount;$i++) {
815
+ $platformID = $this->read_ushort();
816
+ $encodingID = $this->read_ushort();
817
+ $offset = $this->read_ulong();
818
+ $save_pos = $this->_pos;
819
+ if (($platformID == 3 && $encodingID == 1) || $platformID == 0) { // Microsoft, Unicode
820
+ $format = $this->get_ushort($cmap_offset + $offset);
821
+ if ($format == 4) {
822
+ $unicode_cmap_offset = $cmap_offset + $offset;
823
+ break;
824
+ }
825
+ }
826
+ $this->seek($save_pos );
827
+ }
828
+
829
+ if (!$unicode_cmap_offset)
830
+ die('Font ('.$this->filename .') does not have Unicode cmap (platform 3, encoding 1, format 4, or platform 0 [any encoding] format 4)');
831
+
832
+
833
+ $glyphToChar = array();
834
+ $charToGlyph = array();
835
+ $this->getCMAP4($unicode_cmap_offset, $glyphToChar, $charToGlyph );
836
+
837
+ $this->charToGlyph = $charToGlyph;
838
+
839
+
840
+ ///////////////////////////////////
841
+ // hmtx - Horizontal metrics table
842
+ ///////////////////////////////////
843
+ $scale = 1; // not used
844
+ $this->getHMTX($numberOfHMetrics, $numGlyphs, $glyphToChar, $scale);
845
+
846
+ ///////////////////////////////////
847
+ // loca - Index to location
848
+ ///////////////////////////////////
849
+ $this->getLOCA($indexToLocFormat, $numGlyphs);
850
+
851
+ $subsetglyphs = array(0=>0, 1=>1, 2=>2);
852
+ $subsetCharToGlyph = array();
853
+ foreach($subset AS $code) {
854
+ if (isset($this->charToGlyph[$code])) {
855
+ $subsetglyphs[$this->charToGlyph[$code]] = $code; // Old Glyph ID => Unicode
856
+ $subsetCharToGlyph[$code] = $this->charToGlyph[$code]; // Unicode to old GlyphID
857
+
858
+ }
859
+ $this->maxUni = max($this->maxUni, $code);
860
+ }
861
+
862
+ list($start,$dummy) = $this->get_table_pos('glyf');
863
+
864
+ $glyphSet = array();
865
+ ksort($subsetglyphs);
866
+ $n = 0;
867
+ $fsLastCharIndex = 0; // maximum Unicode index (character code) in this font, according to the cmap subtable for platform ID 3 and platform- specific encoding ID 0 or 1.
868
+ foreach($subsetglyphs AS $originalGlyphIdx => $uni) {
869
+ $fsLastCharIndex = max($fsLastCharIndex , $uni);
870
+ $glyphSet[$originalGlyphIdx] = $n; // old glyphID to new glyphID
871
+ $n++;
872
+ }
873
+
874
+ ksort($subsetCharToGlyph);
875
+ foreach($subsetCharToGlyph AS $uni => $originalGlyphIdx) {
876
+ $codeToGlyph[$uni] = $glyphSet[$originalGlyphIdx] ;
877
+ }
878
+ $this->codeToGlyph = $codeToGlyph;
879
+
880
+ ksort($subsetglyphs);
881
+ foreach($subsetglyphs AS $originalGlyphIdx => $uni) {
882
+ $this->getGlyphs($originalGlyphIdx, $start, $glyphSet, $subsetglyphs);
883
+ }
884
+
885
+ $numGlyphs = $numberOfHMetrics = count($subsetglyphs );
886
+
887
+ ///////////////////////////////////
888
+ // name - table copied from the original
889
+ ///////////////////////////////////
890
+ $this->add('name', $this->get_table('name'));
891
+
892
+ ///////////////////////////////////
893
+ //tables copied from the original
894
+ ///////////////////////////////////
895
+ $tags = array ('cvt ', 'fpgm', 'prep', 'gasp');
896
+ foreach($tags AS $tag) {
897
+ if (isset($this->tables[$tag])) { $this->add($tag, $this->get_table($tag)); }
898
+ }
899
+
900
+ ///////////////////////////////////
901
+ // post - PostScript
902
+ ///////////////////////////////////
903
+ if (isset($this->tables['post'])) {
904
+ $opost = $this->get_table('post');
905
+ $post = "\x00\x03\x00\x00" . substr($opost,4,12) . "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
906
+ $this->add('post', $post);
907
+ }
908
+
909
+ ///////////////////////////////////
910
+ // Sort CID2GID map into segments of contiguous codes
911
+ ///////////////////////////////////
912
+ ksort($codeToGlyph);
913
+ unset($codeToGlyph[0]);
914
+ //unset($codeToGlyph[65535]);
915
+ $rangeid = 0;
916
+ $range = array();
917
+ $prevcid = -2;
918
+ $prevglidx = -1;
919
+ // for each character
920
+ foreach ($codeToGlyph as $cid => $glidx) {
921
+ if ($cid == ($prevcid + 1) && $glidx == ($prevglidx + 1)) {
922
+ $range[$rangeid][] = $glidx;
923
+ } else {
924
+ // new range
925
+ $rangeid = $cid;
926
+ $range[$rangeid] = array();
927
+ $range[$rangeid][] = $glidx;
928
+ }
929
+ $prevcid = $cid;
930
+ $prevglidx = $glidx;
931
+ }
932
+
933
+
934
+
935
+ ///////////////////////////////////
936
+ // CMap table
937
+ ///////////////////////////////////
938
+ // cmap - Character to glyph mapping
939
+ $segCount = count($range) + 1; // + 1 Last segment has missing character 0xFFFF
940
+ $searchRange = 1;
941
+ $entrySelector = 0;
942
+ while ($searchRange * 2 <= $segCount ) {
943
+ $searchRange = $searchRange * 2;
944
+ $entrySelector = $entrySelector + 1;
945
+ }
946
+ $searchRange = $searchRange * 2;
947
+ $rangeShift = $segCount * 2 - $searchRange;
948
+ $length = 16 + (8*$segCount ) + ($numGlyphs+1);
949
+ $cmap = array(0, 3, // Index : version, number of encoding subtables
950
+ 0, 0, // Encoding Subtable : platform (UNI=0), encoding 0
951
+ 0, 28, // Encoding Subtable : offset (hi,lo)
952
+ 0, 3, // Encoding Subtable : platform (UNI=0), encoding 3
953
+ 0, 28, // Encoding Subtable : offset (hi,lo)
954
+ 3, 1, // Encoding Subtable : platform (MS=3), encoding 1
955
+ 0, 28, // Encoding Subtable : offset (hi,lo)
956
+ 4, $length, 0, // Format 4 Mapping subtable: format, length, language
957
+ $segCount*2,
958
+ $searchRange,
959
+ $entrySelector,
960
+ $rangeShift);
961
+
962
+ // endCode(s)
963
+ foreach($range AS $start=>$subrange) {
964
+ $endCode = $start + (count($subrange)-1);
965
+ $cmap[] = $endCode; // endCode(s)
966
+ }
967
+ $cmap[] = 0xFFFF; // endCode of last Segment
968
+ $cmap[] = 0; // reservedPad
969
+
970
+ // startCode(s)
971
+ foreach($range AS $start=>$subrange) {
972
+ $cmap[] = $start; // startCode(s)
973
+ }
974
+ $cmap[] = 0xFFFF; // startCode of last Segment
975
+ // idDelta(s)
976
+ foreach($range AS $start=>$subrange) {
977
+ $idDelta = -($start-$subrange[0]);
978
+ $n += count($subrange);
979
+ $cmap[] = $idDelta; // idDelta(s)
980
+ }
981
+ $cmap[] = 1; // idDelta of last Segment
982
+ // idRangeOffset(s)
983
+ foreach($range AS $subrange) {
984
+ $cmap[] = 0; // idRangeOffset[segCount] Offset in bytes to glyph indexArray, or 0
985
+
986
+ }
987
+ $cmap[] = 0; // idRangeOffset of last Segment
988
+ foreach($range AS $subrange) {
989
+ foreach($subrange AS $glidx) {
990
+ $cmap[] = $glidx;
991
+ }
992
+ }
993
+ $cmap[] = 0; // Mapping for last character
994
+ $cmapstr = '';
995
+ foreach($cmap AS $cm) { $cmapstr .= pack("n",$cm); }
996
+ $this->add('cmap', $cmapstr);
997
+
998
+
999
+ ///////////////////////////////////
1000
+ // glyf - Glyph data
1001
+ ///////////////////////////////////
1002
+ list($glyfOffset,$glyfLength) = $this->get_table_pos('glyf');
1003
+ if ($glyfLength < $this->maxStrLenRead) {
1004
+ $glyphData = $this->get_table('glyf');
1005
+ }
1006
+
1007
+ $offsets = array();
1008
+ $glyf = '';
1009
+ $pos = 0;
1010
+ $hmtxstr = '';
1011
+ $xMinT = 0;
1012
+ $yMinT = 0;
1013
+ $xMaxT = 0;
1014
+ $yMaxT = 0;
1015
+ $advanceWidthMax = 0;
1016
+ $minLeftSideBearing = 0;
1017
+ $minRightSideBearing = 0;
1018
+ $xMaxExtent = 0;
1019
+ $maxPoints = 0; // points in non-compound glyph
1020
+ $maxContours = 0; // contours in non-compound glyph
1021
+ $maxComponentPoints = 0; // points in compound glyph
1022
+ $maxComponentContours = 0; // contours in compound glyph
1023
+ $maxComponentElements = 0; // number of glyphs referenced at top level
1024
+ $maxComponentDepth = 0; // levels of recursion, set to 0 if font has only simple glyphs
1025
+ $this->glyphdata = array();
1026
+
1027
+ foreach($subsetglyphs AS $originalGlyphIdx => $uni) {
1028
+ // hmtx - Horizontal Metrics
1029
+ $hm = $this->getHMetric($orignHmetrics, $originalGlyphIdx);
1030
+ $hmtxstr .= $hm;
1031
+
1032
+ $offsets[] = $pos;
1033
+ $glyphPos = $this->glyphPos[$originalGlyphIdx];
1034
+ $glyphLen = $this->glyphPos[$originalGlyphIdx + 1] - $glyphPos;
1035
+ if ($glyfLength < $this->maxStrLenRead) {
1036
+ $data = substr($glyphData,$glyphPos,$glyphLen);
1037
+ }
1038
+ else {
1039
+ if ($glyphLen > 0) $data = $this->get_chunk($glyfOffset+$glyphPos,$glyphLen);
1040
+ else $data = '';
1041
+ }
1042
+
1043
+ if ($glyphLen > 0) {
1044
+ if (_RECALC_PROFILE) {
1045
+ $xMin = $this->unpack_short(substr($data,2,2));
1046
+ $yMin = $this->unpack_short(substr($data,4,2));
1047
+ $xMax = $this->unpack_short(substr($data,6,2));
1048
+ $yMax = $this->unpack_short(substr($data,8,2));
1049
+ $xMinT = min($xMinT,$xMin);
1050
+ $yMinT = min($yMinT,$yMin);
1051
+ $xMaxT = max($xMaxT,$xMax);
1052
+ $yMaxT = max($yMaxT,$yMax);
1053
+ $aw = $this->unpack_short(substr($hm,0,2));
1054
+ $lsb = $this->unpack_short(substr($hm,2,2));
1055
+ $advanceWidthMax = max($advanceWidthMax,$aw);
1056
+ $minLeftSideBearing = min($minLeftSideBearing,$lsb);
1057
+ $minRightSideBearing = min($minRightSideBearing,($aw - $lsb - ($xMax - $xMin)));
1058
+ $xMaxExtent = max($xMaxExtent,($lsb + ($xMax - $xMin)));
1059
+ }
1060
+ $up = unpack("n", substr($data,0,2));
1061
+ }
1062
+ if ($glyphLen > 2 && ($up[1] & (1 << 15)) ) { // If number of contours <= -1 i.e. composiste glyph
1063
+ $pos_in_glyph = 10;
1064
+ $flags = GF_MORE;
1065
+ $nComponentElements = 0;
1066
+ while ($flags & GF_MORE) {
1067
+ $nComponentElements += 1; // number of glyphs referenced at top level
1068
+ $up = unpack("n", substr($data,$pos_in_glyph,2));
1069
+ $flags = $up[1];
1070
+ $up = unpack("n", substr($data,$pos_in_glyph+2,2));
1071
+ $glyphIdx = $up[1];
1072
+ $this->glyphdata[$originalGlyphIdx]['compGlyphs'][] = $glyphIdx;
1073
+ $data = $this->_set_ushort($data, $pos_in_glyph + 2, $glyphSet[$glyphIdx]);
1074
+ $pos_in_glyph += 4;
1075
+ if ($flags & GF_WORDS) { $pos_in_glyph += 4; }
1076
+ else { $pos_in_glyph += 2; }
1077
+ if ($flags & GF_SCALE) { $pos_in_glyph += 2; }
1078
+ else if ($flags & GF_XYSCALE) { $pos_in_glyph += 4; }
1079
+ else if ($flags & GF_TWOBYTWO) { $pos_in_glyph += 8; }
1080
+ }
1081
+ $maxComponentElements = max($maxComponentElements, $nComponentElements);
1082
+ }
1083
+ // Simple Glyph
1084
+ else if (_RECALC_PROFILE && $glyphLen > 2 && $up[1] < (1 << 15) && $up[1] > 0) { // Number of contours > 0 simple glyph
1085
+ $nContours = $up[1];
1086
+ $this->glyphdata[$originalGlyphIdx]['nContours'] = $nContours;
1087
+ $maxContours = max($maxContours, $nContours);
1088
+
1089
+ // Count number of points in simple glyph
1090
+ $pos_in_glyph = 10 + ($nContours * 2) - 2; // Last endContourPoint
1091
+ $up = unpack("n", substr($data,$pos_in_glyph,2));
1092
+ $points = $up[1]+1;
1093
+ $this->glyphdata[$originalGlyphIdx]['nPoints'] = $points;
1094
+ $maxPoints = max($maxPoints, $points);
1095
+ }
1096
+
1097
+ $glyf .= $data;
1098
+ $pos += $glyphLen;
1099
+ if ($pos % 4 != 0) {
1100
+ $padding = 4 - ($pos % 4);
1101
+ $glyf .= str_repeat("\0",$padding);
1102
+ $pos += $padding;
1103
+ }
1104
+ }
1105
+
1106
+ if (_RECALC_PROFILE) {
1107
+ foreach($this->glyphdata AS $originalGlyphIdx => $val) {
1108
+ $maxdepth = $depth = -1;
1109
+ $points = 0;
1110
+ $contours = 0;
1111
+ $this->getGlyphData($originalGlyphIdx, $maxdepth, $depth, $points, $contours) ;
1112
+ $maxComponentDepth = max($maxComponentDepth , $maxdepth);
1113
+ $maxComponentPoints = max($maxComponentPoints , $points);
1114
+ $maxComponentContours = max($maxComponentContours , $contours);
1115
+ }
1116
+ }
1117
+
1118
+
1119
+ $offsets[] = $pos;
1120
+ $this->add('glyf', $glyf);
1121
+
1122
+ ///////////////////////////////////
1123
+ // hmtx - Horizontal Metrics
1124
+ ///////////////////////////////////
1125
+ $this->add('hmtx', $hmtxstr);
1126
+
1127
+
1128
+ ///////////////////////////////////
1129
+ // loca - Index to location
1130
+ ///////////////////////////////////
1131
+ $locastr = '';
1132
+ if ((($pos + 1) >> 1) > 0xFFFF) {
1133
+ $indexToLocFormat = 1; // long format
1134
+ foreach($offsets AS $offset) { $locastr .= pack("N",$offset); }
1135
+ }
1136
+ else {
1137
+ $indexToLocFormat = 0; // short format
1138
+ foreach($offsets AS $offset) { $locastr .= pack("n",($offset/2)); }
1139
+ }
1140
+ $this->add('loca', $locastr);
1141
+
1142
+ ///////////////////////////////////
1143
+ // head - Font header
1144
+ ///////////////////////////////////
1145
+ $head = $this->get_table('head');
1146
+ $head = $this->_set_ushort($head, 50, $indexToLocFormat);
1147
+ if (_RECALC_PROFILE) {
1148
+ $head = $this->_set_short($head, 36, $xMinT); // for all glyph bounding boxes
1149
+ $head = $this->_set_short($head, 38, $yMinT); // for all glyph bounding boxes
1150
+ $head = $this->_set_short($head, 40, $xMaxT); // for all glyph bounding boxes
1151
+ $head = $this->_set_short($head, 42, $yMaxT); // for all glyph bounding boxes
1152
+ $head[17] = chr($head[17] & ~(1 << 4)); // Unset Bit 4 (as hdmx/LTSH tables not included)
1153
+ }
1154
+ $this->add('head', $head);
1155
+
1156
+
1157
+ ///////////////////////////////////
1158
+ // hhea - Horizontal Header
1159
+ ///////////////////////////////////
1160
+ $hhea = $this->get_table('hhea');
1161
+ $hhea = $this->_set_ushort($hhea, 34, $numberOfHMetrics);
1162
+ if (_RECALC_PROFILE) {
1163
+ $hhea = $this->_set_ushort($hhea, 10, $advanceWidthMax);
1164
+ $hhea = $this->_set_short($hhea, 12, $minLeftSideBearing);
1165
+ $hhea = $this->_set_short($hhea, 14, $minRightSideBearing);
1166
+ $hhea = $this->_set_short($hhea, 16, $xMaxExtent);
1167
+ }
1168
+ $this->add('hhea', $hhea);
1169
+
1170
+ ///////////////////////////////////
1171
+ // maxp - Maximum Profile
1172
+ ///////////////////////////////////
1173
+ $maxp = $this->get_table('maxp');
1174
+ $maxp = $this->_set_ushort($maxp, 4, $numGlyphs);
1175
+ if (_RECALC_PROFILE) {
1176
+ $maxp = $this->_set_ushort($maxp, 6, $maxPoints); // points in non-compound glyph
1177
+ $maxp = $this->_set_ushort($maxp, 8, $maxContours); // contours in non-compound glyph
1178
+ $maxp = $this->_set_ushort($maxp, 10, $maxComponentPoints); // points in compound glyph
1179
+ $maxp = $this->_set_ushort($maxp, 12, $maxComponentContours); // contours in compound glyph
1180
+ $maxp = $this->_set_ushort($maxp, 28, $maxComponentElements); // number of glyphs referenced at top level
1181
+ $maxp = $this->_set_ushort($maxp, 30, $maxComponentDepth); // levels of recursion, set to 0 if font has only simple glyphs
1182
+ }
1183
+ $this->add('maxp', $maxp);
1184
+
1185
+
1186
+ ///////////////////////////////////
1187
+ // OS/2 - OS/2
1188
+ ///////////////////////////////////
1189
+ if (isset($this->tables['OS/2'])) {
1190
+ $os2_offset = $this->seek_table("OS/2");
1191
+ if (_RECALC_PROFILE) {
1192
+ $fsSelection = $this->get_ushort($os2_offset+62);
1193
+ $fsSelection = ($fsSelection & ~(1 << 6)); // 2-byte bit field containing information concerning the nature of the font patterns
1194
+ // bit#0 = Italic; bit#5=Bold
1195
+ // Match name table's font subfamily string
1196
+ // Clear bit#6 used for 'Regular' and optional
1197
+ }
1198
+
1199
+ // NB Currently this method never subsets characters above BMP
1200
+ // Could set nonBMP bit according to $this->maxUni
1201
+ $nonBMP = $this->get_ushort($os2_offset+46);
1202
+ $nonBMP = ($nonBMP & ~(1 << 9)); // Unset Bit 57 (indicates non-BMP) - for interactive forms
1203
+
1204
+ $os2 = $this->get_table('OS/2');
1205
+ if (_RECALC_PROFILE) {
1206
+ $os2 = $this->_set_ushort($os2, 62, $fsSelection);
1207
+ $os2 = $this->_set_ushort($os2, 66, $fsLastCharIndex);
1208
+ $os2 = $this->_set_ushort($os2, 42, 0x0000); // ulCharRange (ulUnicodeRange) bits 24-31 | 16-23
1209
+ $os2 = $this->_set_ushort($os2, 44, 0x0000); // ulCharRange (Unicode ranges) bits 8-15 | 0-7
1210
+ $os2 = $this->_set_ushort($os2, 46, $nonBMP); // ulCharRange (Unicode ranges) bits 56-63 | 48-55
1211
+ $os2 = $this->_set_ushort($os2, 48, 0x0000); // ulCharRange (Unicode ranges) bits 40-47 | 32-39
1212
+ $os2 = $this->_set_ushort($os2, 50, 0x0000); // ulCharRange (Unicode ranges) bits 88-95 | 80-87
1213
+ $os2 = $this->_set_ushort($os2, 52, 0x0000); // ulCharRange (Unicode ranges) bits 72-79 | 64-71
1214
+ $os2 = $this->_set_ushort($os2, 54, 0x0000); // ulCharRange (Unicode ranges) bits 120-127 | 112-119
1215
+ $os2 = $this->_set_ushort($os2, 56, 0x0000); // ulCharRange (Unicode ranges) bits 104-111 | 96-103
1216
+ }
1217
+ $os2 = $this->_set_ushort($os2, 46, $nonBMP); // Unset Bit 57 (indicates non-BMP) - for interactive forms
1218
+
1219
+ $this->add('OS/2', $os2 );
1220
+ }
1221
+
1222
+ fclose($this->fh);
1223
+ // Put the TTF file together
1224
+ $stm = '';
1225
+ $this->endTTFile($stm);
1226
+ //file_put_contents('testfont.ttf', $stm); exit;
1227
+ return $stm ;
1228
+ }
1229
+
1230
+ //================================================================================
1231
+
1232
+ // Also does SMP
1233
+ function makeSubsetSIP($file, &$subset, $TTCfontID=0, $debug=false) {
1234
+ $this->fh = fopen($file ,'rb') or die('Can\'t open file ' . $file);
1235
+ $this->filename = $file;
1236
+ $this->_pos = 0;
1237
+ $this->unAGlyphs = false; // mPDF 5.4.05
1238
+ $this->charWidths = '';
1239
+ $this->glyphPos = array();
1240
+ $this->charToGlyph = array();
1241
+ $this->tables = array();
1242
+ $this->otables = array();
1243
+ $this->ascent = 0;
1244
+ $this->descent = 0;
1245
+ $this->numTTCFonts = 0;
1246
+ $this->TTCFonts = array();
1247
+ $this->skip(4);
1248
+ if ($TTCfontID > 0) {
1249
+ $this->version = $version = $this->read_ulong(); // TTC Header version now
1250
+ if (!in_array($version, array(0x00010000,0x00020000)))
1251
+ die("ERROR - Error parsing TrueType Collection: version=".$version." - " . $file);
1252
+ $this->numTTCFonts = $this->read_ulong();
1253
+ for ($i=1; $i<=$this->numTTCFonts; $i++) {
1254
+ $this->TTCFonts[$i]['offset'] = $this->read_ulong();
1255
+ }
1256
+ $this->seek($this->TTCFonts[$TTCfontID]['offset']);
1257
+ $this->version = $version = $this->read_ulong(); // TTFont version again now
1258
+ }
1259
+ $this->readTableDirectory($debug);
1260
+
1261
+
1262
+
1263
+ ///////////////////////////////////
1264
+ // head - Font header table
1265
+ ///////////////////////////////////
1266
+ $this->seek_table("head");
1267
+ $this->skip(50);
1268
+ $indexToLocFormat = $this->read_ushort();
1269
+ $glyphDataFormat = $this->read_ushort();
1270
+
1271
+ ///////////////////////////////////
1272
+ // hhea - Horizontal header table
1273
+ ///////////////////////////////////
1274
+ $this->seek_table("hhea");
1275
+ $this->skip(32);
1276
+ $metricDataFormat = $this->read_ushort();
1277
+ $orignHmetrics = $numberOfHMetrics = $this->read_ushort();
1278
+
1279
+ ///////////////////////////////////
1280
+ // maxp - Maximum profile table
1281
+ ///////////////////////////////////
1282
+ $this->seek_table("maxp");
1283
+ $this->skip(4);
1284
+ $numGlyphs = $this->read_ushort();
1285
+
1286
+
1287
+ ///////////////////////////////////
1288
+ // cmap - Character to glyph index mapping table
1289
+ ///////////////////////////////////
1290
+
1291
+ $cmap_offset = $this->seek_table("cmap");
1292
+ $this->skip(2);
1293
+ $cmapTableCount = $this->read_ushort();
1294
+ $unicode_cmap_offset = 0;
1295
+ for ($i=0;$i<$cmapTableCount;$i++) {
1296
+ $platformID = $this->read_ushort();
1297
+ $encodingID = $this->read_ushort();
1298
+ $offset = $this->read_ulong();
1299
+ $save_pos = $this->_pos;
1300
+ if (($platformID == 3 && $encodingID == 10) || $platformID == 0) { // Microsoft, Unicode Format 12 table HKCS
1301
+ $format = $this->get_ushort($cmap_offset + $offset);
1302
+ if ($format == 12) {
1303
+ $unicode_cmap_offset = $cmap_offset + $offset;
1304
+ break;
1305
+ }
1306
+ }
1307
+ $this->seek($save_pos );
1308
+ }
1309
+
1310
+ if (!$unicode_cmap_offset)
1311
+ die('Font does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)');
1312
+ // Format 12 CMAP does characters above Unicode BMP i.e. some HKCS characters U+20000 and above
1313
+ if ($format == 12) {
1314
+ $this->maxUniChar = 0;
1315
+ $this->seek($unicode_cmap_offset + 4);
1316
+ $length = $this->read_ulong();
1317
+ $limit = $unicode_cmap_offset + $length;
1318
+ $this->skip(4);
1319
+
1320
+ $nGroups = $this->read_ulong();
1321
+
1322
+ $glyphToChar = array();
1323
+ $charToGlyph = array();
1324
+ for($i=0; $i<$nGroups ; $i++) {
1325
+ $startCharCode = $this->read_ulong();
1326
+ $endCharCode = $this->read_ulong();
1327
+ $startGlyphCode = $this->read_ulong();
1328
+ $offset = 0;
1329
+ for ($unichar=$startCharCode;$unichar<=$endCharCode;$unichar++) {
1330
+ $glyph = $startGlyphCode + $offset ;
1331
+ $offset++;
1332
+ $charToGlyph[$unichar] = $glyph;
1333
+ if ($unichar < 196608) { $this->maxUniChar = max($unichar,$this->maxUniChar); }
1334
+ $glyphToChar[$glyph][] = $unichar;
1335
+ }
1336
+ }
1337
+ }
1338
+ else
1339
+ die('Font does not have cmap for Unicode (format 12)');
1340
+
1341
+
1342
+ ///////////////////////////////////
1343
+ // hmtx - Horizontal metrics table
1344
+ ///////////////////////////////////
1345
+ $scale = 1; // not used here
1346
+ $this->getHMTX($numberOfHMetrics, $numGlyphs, $glyphToChar, $scale);
1347
+
1348
+ ///////////////////////////////////
1349
+ // loca - Index to location
1350
+ ///////////////////////////////////
1351
+ $this->getLOCA($indexToLocFormat, $numGlyphs);
1352
+
1353
+ ///////////////////////////////////////////////////////////////////
1354
+
1355
+ $glyphMap = array(0=>0);
1356
+ $glyphSet = array(0=>0);
1357
+ $codeToGlyph = array();
1358
+ // Set a substitute if ASCII characters do not have glyphs
1359
+ if (isset($charToGlyph[0x3F])) { $subs = $charToGlyph[0x3F]; } // Question mark
1360
+ else { $subs = $charToGlyph[32]; }
1361
+ foreach($subset AS $code) {
1362
+ if (isset($charToGlyph[$code]))
1363
+ $originalGlyphIdx = $charToGlyph[$code];
1364
+ else if ($code<128) {
1365
+ $originalGlyphIdx = $subs;
1366
+ }
1367
+ else { $originalGlyphIdx = 0; }
1368
+ if (!isset($glyphSet[$originalGlyphIdx])) {
1369
+ $glyphSet[$originalGlyphIdx] = count($glyphMap);
1370
+ $glyphMap[] = $originalGlyphIdx;
1371
+ }
1372
+ $codeToGlyph[$code] = $glyphSet[$originalGlyphIdx];
1373
+ }
1374
+
1375
+ list($start,$dummy) = $this->get_table_pos('glyf');
1376
+
1377
+ $n = 0;
1378
+ while ($n < count($glyphMap)) {
1379
+ $originalGlyphIdx = $glyphMap[$n];
1380
+ $glyphPos = $this->glyphPos[$originalGlyphIdx];
1381
+ $glyphLen = $this->glyphPos[$originalGlyphIdx + 1] - $glyphPos;
1382
+ $n += 1;
1383
+ if (!$glyphLen) continue;
1384
+ $this->seek($start + $glyphPos);
1385
+ $numberOfContours = $this->read_short();
1386
+ if ($numberOfContours < 0) {
1387
+ $this->skip(8);
1388
+ $flags = GF_MORE;
1389
+ while ($flags & GF_MORE) {
1390
+ $flags = $this->read_ushort();
1391
+ $glyphIdx = $this->read_ushort();
1392
+ if (!isset($glyphSet[$glyphIdx])) {
1393
+ $glyphSet[$glyphIdx] = count($glyphMap);
1394
+ $glyphMap[] = $glyphIdx;
1395
+ }
1396
+ if ($flags & GF_WORDS)
1397
+ $this->skip(4);
1398
+ else
1399
+ $this->skip(2);
1400
+ if ($flags & GF_SCALE)
1401
+ $this->skip(2);
1402
+ else if ($flags & GF_XYSCALE)
1403
+ $this->skip(4);
1404
+ else if ($flags & GF_TWOBYTWO)
1405
+ $this->skip(8);
1406
+ }
1407
+ }
1408
+ }
1409
+
1410
+ $numGlyphs = $n = count($glyphMap);
1411
+ $numberOfHMetrics = $n;
1412
+
1413
+ ///////////////////////////////////
1414
+ // name
1415
+ ///////////////////////////////////
1416
+ // Needs to have a name entry in 3,0 (e.g. symbol) - original font will be 3,1 (i.e. Unicode)
1417
+ $name = $this->get_table('name');
1418
+ $name_offset = $this->seek_table("name");
1419
+ $format = $this->read_ushort();
1420
+ $numRecords = $this->read_ushort();
1421
+ $string_data_offset = $name_offset + $this->read_ushort();
1422
+ for ($i=0;$i<$numRecords; $i++) {
1423
+ $platformId = $this->read_ushort();
1424
+ $encodingId = $this->read_ushort();
1425
+ if ($platformId == 3 && $encodingId == 1) {
1426
+ $pos = 6 + ($i * 12) + 2;
1427
+ $name = $this->_set_ushort($name, $pos, 0x00); // Change encoding to 3,0 rather than 3,1
1428
+ }
1429
+ $this->skip(8);
1430
+ }
1431
+ $this->add('name', $name);
1432
+
1433
+ ///////////////////////////////////
1434
+ // OS/2
1435
+ ///////////////////////////////////
1436
+ if (isset($this->tables['OS/2'])) {
1437
+ $os2 = $this->get_table('OS/2');
1438
+ $os2 = $this->_set_ushort($os2, 42, 0x00); // ulCharRange (Unicode ranges)
1439
+ $os2 = $this->_set_ushort($os2, 44, 0x00); // ulCharRange (Unicode ranges)
1440
+ $os2 = $this->_set_ushort($os2, 46, 0x00); // ulCharRange (Unicode ranges)
1441
+ $os2 = $this->_set_ushort($os2, 48, 0x00); // ulCharRange (Unicode ranges)
1442
+
1443
+ $os2 = $this->_set_ushort($os2, 50, 0x00); // ulCharRange (Unicode ranges)
1444
+ $os2 = $this->_set_ushort($os2, 52, 0x00); // ulCharRange (Unicode ranges)
1445
+ $os2 = $this->_set_ushort($os2, 54, 0x00); // ulCharRange (Unicode ranges)
1446
+ $os2 = $this->_set_ushort($os2, 56, 0x00); // ulCharRange (Unicode ranges)
1447
+ // Set Symbol character only in ulCodePageRange
1448
+ $os2 = $this->_set_ushort($os2, 78, 0x8000); // ulCodePageRange = Bit #31 Symbol **** 78 = Bit 16-31
1449
+ $os2 = $this->_set_ushort($os2, 80, 0x0000); // ulCodePageRange = Bit #31 Symbol **** 80 = Bit 0-15
1450
+ $os2 = $this->_set_ushort($os2, 82, 0x0000); // ulCodePageRange = Bit #32- Symbol **** 82 = Bits 48-63
1451
+ $os2 = $this->_set_ushort($os2, 84, 0x0000); // ulCodePageRange = Bit #32- Symbol **** 84 = Bits 32-47
1452
+
1453
+ $os2 = $this->_set_ushort($os2, 64, 0x01); // FirstCharIndex
1454
+ $os2 = $this->_set_ushort($os2, 66, count($subset)); // LastCharIndex
1455
+ // Set PANOSE first bit to 5 for Symbol
1456
+ $os2 = $this->splice($os2, 32, chr(5).chr(0).chr(1).chr(0).chr(1).chr(0).chr(0).chr(0).chr(0).chr(0));
1457
+ $this->add('OS/2', $os2 );
1458
+ }
1459
+
1460
+
1461
+ ///////////////////////////////////
1462
+ //tables copied from the original
1463
+ ///////////////////////////////////
1464
+ $tags = array ('cvt ', 'fpgm', 'prep', 'gasp');
1465
+ foreach($tags AS $tag) { // 1.02
1466
+ if (isset($this->tables[$tag])) { $this->add($tag, $this->get_table($tag)); }
1467
+ }
1468
+
1469
+ ///////////////////////////////////
1470
+ // post - PostScript
1471
+ ///////////////////////////////////
1472
+ if (isset($this->tables['post'])) {
1473
+ $opost = $this->get_table('post');
1474
+ $post = "\x00\x03\x00\x00" . substr($opost,4,12) . "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
1475
+ }
1476
+ $this->add('post', $post);
1477
+
1478
+ ///////////////////////////////////
1479
+ // hhea - Horizontal Header
1480
+ ///////////////////////////////////
1481
+ $hhea = $this->get_table('hhea');
1482
+ $hhea = $this->_set_ushort($hhea, 34, $numberOfHMetrics);
1483
+ $this->add('hhea', $hhea);
1484
+
1485
+ ///////////////////////////////////
1486
+ // maxp - Maximum Profile
1487
+ ///////////////////////////////////
1488
+ $maxp = $this->get_table('maxp');
1489
+ $maxp = $this->_set_ushort($maxp, 4, $numGlyphs);
1490
+ $this->add('maxp', $maxp);
1491
+
1492
+
1493
+ ///////////////////////////////////
1494
+ // CMap table Formats [1,0,]6 and [3,0,]4
1495
+ ///////////////////////////////////
1496
+ ///////////////////////////////////
1497
+ // Sort CID2GID map into segments of contiguous codes
1498
+ ///////////////////////////////////
1499
+ $rangeid = 0;
1500
+ $range = array();
1501
+ $prevcid = -2;
1502
+ $prevglidx = -1;
1503
+ // for each character
1504
+ foreach ($subset as $cid => $code) {
1505
+ $glidx = $codeToGlyph[$code];
1506
+ if ($cid == ($prevcid + 1) && $glidx == ($prevglidx + 1)) {
1507
+ $range[$rangeid][] = $glidx;
1508
+ } else {
1509
+ // new range
1510
+ $rangeid = $cid;
1511
+ $range[$rangeid] = array();
1512
+ $range[$rangeid][] = $glidx;
1513
+ }
1514
+ $prevcid = $cid;
1515
+ $prevglidx = $glidx;
1516
+ }
1517
+ // cmap - Character to glyph mapping
1518
+ $segCount = count($range) + 1; // + 1 Last segment has missing character 0xFFFF
1519
+ $searchRange = 1;
1520
+ $entrySelector = 0;
1521
+ while ($searchRange * 2 <= $segCount ) {
1522
+ $searchRange = $searchRange * 2;
1523
+ $entrySelector = $entrySelector + 1;
1524
+ }
1525
+ $searchRange = $searchRange * 2;
1526
+ $rangeShift = $segCount * 2 - $searchRange;
1527
+ $length = 16 + (8*$segCount ) + ($numGlyphs+1);
1528
+ $cmap = array(
1529
+ 4, $length, 0, // Format 4 Mapping subtable: format, length, language
1530
+ $segCount*2,
1531
+ $searchRange,
1532
+ $entrySelector,
1533
+ $rangeShift);
1534
+
1535
+ // endCode(s)
1536
+ foreach($range AS $start=>$subrange) {
1537
+ $endCode = $start + (count($subrange)-1);
1538
+ $cmap[] = $endCode; // endCode(s)
1539
+ }
1540
+ $cmap[] = 0xFFFF; // endCode of last Segment
1541
+ $cmap[] = 0; // reservedPad
1542
+
1543
+ // startCode(s)
1544
+ foreach($range AS $start=>$subrange) {
1545
+ $cmap[] = $start; // startCode(s)
1546
+ }
1547
+ $cmap[] = 0xFFFF; // startCode of last Segment
1548
+ // idDelta(s)
1549
+ foreach($range AS $start=>$subrange) {
1550
+ $idDelta = -($start-$subrange[0]);
1551
+ $n += count($subrange);
1552
+ $cmap[] = $idDelta; // idDelta(s)
1553
+ }
1554
+ $cmap[] = 1; // idDelta of last Segment
1555
+ // idRangeOffset(s)
1556
+ foreach($range AS $subrange) {
1557
+ $cmap[] = 0; // idRangeOffset[segCount] Offset in bytes to glyph indexArray, or 0
1558
+
1559
+ }
1560
+ $cmap[] = 0; // idRangeOffset of last Segment
1561
+ foreach($range AS $subrange) {
1562
+ foreach($subrange AS $glidx) {
1563
+ $cmap[] = $glidx;
1564
+ }
1565
+ }
1566
+ $cmap[] = 0; // Mapping for last character
1567
+ $cmapstr4 = '';
1568
+ foreach($cmap AS $cm) { $cmapstr4 .= pack("n",$cm); }
1569
+
1570
+ ///////////////////////////////////
1571
+ // cmap - Character to glyph mapping
1572
+ ///////////////////////////////////
1573
+ $entryCount = count($subset);
1574
+ $length = 10 + $entryCount * 2;
1575
+
1576
+ $off = 20 + $length;
1577
+ $hoff = $off >> 16;
1578
+ $loff = $off & 0xFFFF;
1579
+
1580
+ $cmap = array(0, 2, // Index : version, number of subtables
1581
+ 1, 0, // Subtable : platform, encoding
1582
+ 0, 20, // offset (hi,lo)
1583
+ 3, 0, // Subtable : platform, encoding
1584
+ $hoff, $loff, // offset (hi,lo)
1585
+ 6, $length, // Format 6 Mapping table: format, length
1586
+ 0, 1, // language, First char code
1587
+ $entryCount
1588
+ );
1589
+ $cmapstr = '';
1590
+ foreach($subset AS $code) { $cmap[] = $codeToGlyph[$code]; }
1591
+ foreach($cmap AS $cm) { $cmapstr .= pack("n",$cm); }
1592
+ $cmapstr .= $cmapstr4;
1593
+ $this->add('cmap', $cmapstr);
1594
+
1595
+ ///////////////////////////////////
1596
+ // hmtx - Horizontal Metrics
1597
+ ///////////////////////////////////
1598
+ $hmtxstr = '';
1599
+ for($n=0;$n<$numGlyphs;$n++) {
1600
+ $originalGlyphIdx = $glyphMap[$n];
1601
+ $hm = $this->getHMetric($orignHmetrics, $originalGlyphIdx);
1602
+ $hmtxstr .= $hm;
1603
+ }
1604
+ $this->add('hmtx', $hmtxstr);
1605
+
1606
+ ///////////////////////////////////
1607
+ // glyf - Glyph data
1608
+ ///////////////////////////////////
1609
+ list($glyfOffset,$glyfLength) = $this->get_table_pos('glyf');
1610
+ if ($glyfLength < $this->maxStrLenRead) {
1611
+ $glyphData = $this->get_table('glyf');
1612
+ }
1613
+
1614
+ $offsets = array();
1615
+ $glyf = '';
1616
+ $pos = 0;
1617
+ for ($n=0;$n<$numGlyphs;$n++) {
1618
+ $offsets[] = $pos;
1619
+ $originalGlyphIdx = $glyphMap[$n];
1620
+ $glyphPos = $this->glyphPos[$originalGlyphIdx];
1621
+ $glyphLen = $this->glyphPos[$originalGlyphIdx + 1] - $glyphPos;
1622
+ if ($glyfLength < $this->maxStrLenRead) {
1623
+ $data = substr($glyphData,$glyphPos,$glyphLen);
1624
+ }
1625
+ else {
1626
+ if ($glyphLen > 0) $data = $this->get_chunk($glyfOffset+$glyphPos,$glyphLen);
1627
+ else $data = '';
1628
+ }
1629
+ if ($glyphLen > 0) $up = unpack("n", substr($data,0,2));
1630
+ if ($glyphLen > 2 && ($up[1] & (1 << 15)) ) {
1631
+ $pos_in_glyph = 10;
1632
+ $flags = GF_MORE;
1633
+ while ($flags & GF_MORE) {
1634
+ $up = unpack("n", substr($data,$pos_in_glyph,2));
1635
+ $flags = $up[1];
1636
+ $up = unpack("n", substr($data,$pos_in_glyph+2,2));
1637
+ $glyphIdx = $up[1];
1638
+ $data = $this->_set_ushort($data, $pos_in_glyph + 2, $glyphSet[$glyphIdx]);
1639
+ $pos_in_glyph += 4;
1640
+ if ($flags & GF_WORDS) { $pos_in_glyph += 4; }
1641
+ else { $pos_in_glyph += 2; }
1642
+ if ($flags & GF_SCALE) { $pos_in_glyph += 2; }
1643
+ else if ($flags & GF_XYSCALE) { $pos_in_glyph += 4; }
1644
+ else if ($flags & GF_TWOBYTWO) { $pos_in_glyph += 8; }
1645
+ }
1646
+ }
1647
+ $glyf .= $data;
1648
+ $pos += $glyphLen;
1649
+ if ($pos % 4 != 0) {
1650
+ $padding = 4 - ($pos % 4);
1651
+ $glyf .= str_repeat("\0",$padding);
1652
+ $pos += $padding;
1653
+ }
1654
+ }
1655
+ $offsets[] = $pos;
1656
+ $this->add('glyf', $glyf);
1657
+
1658
+ ///////////////////////////////////
1659
+ // loca - Index to location
1660
+ ///////////////////////////////////
1661
+ $locastr = '';
1662
+ if ((($pos + 1) >> 1) > 0xFFFF) {
1663
+ $indexToLocFormat = 1; // long format
1664
+ foreach($offsets AS $offset) { $locastr .= pack("N",$offset); }
1665
+ }
1666
+ else {
1667
+ $indexToLocFormat = 0; // short format
1668
+ foreach($offsets AS $offset) { $locastr .= pack("n",($offset/2)); }
1669
+ }
1670
+ $this->add('loca', $locastr);
1671
+
1672
+ ///////////////////////////////////
1673
+ // head - Font header
1674
+ ///////////////////////////////////
1675
+ $head = $this->get_table('head');
1676
+ $head = $this->_set_ushort($head, 50, $indexToLocFormat);
1677
+ $this->add('head', $head);
1678
+
1679
+ fclose($this->fh);
1680
+
1681
+ // Put the TTF file together
1682
+ $stm = '';
1683
+ $this->endTTFile($stm);
1684
+ //file_put_contents('testfont.ttf', $stm); exit;
1685
+ return $stm ;
1686
+ }
1687
+
1688
+ //////////////////////////////////////////////////////////////////////////////////
1689
+ // Recursively get composite glyph data
1690
+ function getGlyphData($originalGlyphIdx, &$maxdepth, &$depth, &$points, &$contours) {
1691
+ $depth++;
1692
+ $maxdepth = max($maxdepth, $depth);
1693
+ if (count($this->glyphdata[$originalGlyphIdx]['compGlyphs'])) {
1694
+ foreach($this->glyphdata[$originalGlyphIdx]['compGlyphs'] AS $glyphIdx) {
1695
+ $this->getGlyphData($glyphIdx, $maxdepth, $depth, $points, $contours);
1696
+ }
1697
+ }
1698
+ else if (($this->glyphdata[$originalGlyphIdx]['nContours'] > 0) && $depth > 0) { // simple
1699
+ $contours += $this->glyphdata[$originalGlyphIdx]['nContours'];
1700
+ $points += $this->glyphdata[$originalGlyphIdx]['nPoints'];
1701
+ }
1702
+ $depth--;
1703
+ }
1704
+
1705
+
1706
+ //////////////////////////////////////////////////////////////////////////////////
1707
+ // Recursively get composite glyphs
1708
+ function getGlyphs($originalGlyphIdx, &$start, &$glyphSet, &$subsetglyphs) {
1709
+ $glyphPos = $this->glyphPos[$originalGlyphIdx];
1710
+ $glyphLen = $this->glyphPos[$originalGlyphIdx + 1] - $glyphPos;
1711
+ if (!$glyphLen) {
1712
+ return;
1713
+ }
1714
+ $this->seek($start + $glyphPos);
1715
+ $numberOfContours = $this->read_short();
1716
+ if ($numberOfContours < 0) {
1717
+ $this->skip(8);
1718
+ $flags = GF_MORE;
1719
+ while ($flags & GF_MORE) {
1720
+ $flags = $this->read_ushort();
1721
+ $glyphIdx = $this->read_ushort();
1722
+ if (!isset($glyphSet[$glyphIdx])) {
1723
+ $glyphSet[$glyphIdx] = count($subsetglyphs); // old glyphID to new glyphID
1724
+ $subsetglyphs[$glyphIdx] = true;
1725
+ }
1726
+ $savepos = ftell($this->fh);
1727
+ $this->getGlyphs($glyphIdx, $start, $glyphSet, $subsetglyphs);
1728
+ $this->seek($savepos);
1729
+ if ($flags & GF_WORDS)
1730
+ $this->skip(4);
1731
+ else
1732
+ $this->skip(2);
1733
+ if ($flags & GF_SCALE)
1734
+ $this->skip(2);
1735
+ else if ($flags & GF_XYSCALE)
1736
+ $this->skip(4);
1737
+ else if ($flags & GF_TWOBYTWO)
1738
+ $this->skip(8);
1739
+ }
1740
+ }
1741
+ }
1742
+
1743
+ //////////////////////////////////////////////////////////////////////////////////
1744
+
1745
+ function getHMTX($numberOfHMetrics, $numGlyphs, &$glyphToChar, $scale) {
1746
+ $start = $this->seek_table("hmtx");
1747
+ $aw = 0;
1748
+ $this->charWidths = str_pad('', 256*256*2, "\x00");
1749
+ if ($this->maxUniChar > 65536) { $this->charWidths .= str_pad('', 256*256*2, "\x00"); } // Plane 1 SMP
1750
+ if ($this->maxUniChar > 131072) { $this->charWidths .= str_pad('', 256*256*2, "\x00"); } // Plane 2 SMP
1751
+ $nCharWidths = 0;
1752
+ if (($numberOfHMetrics*4) < $this->maxStrLenRead) {
1753
+ $data = $this->get_chunk($start,($numberOfHMetrics*4));
1754
+ $arr = unpack("n*", $data);
1755
+ }
1756
+ else { $this->seek($start); }
1757
+ for( $glyph=0; $glyph<$numberOfHMetrics; $glyph++) {
1758
+ if (($numberOfHMetrics*4) < $this->maxStrLenRead) {
1759
+ $aw = $arr[($glyph*2)+1];
1760
+ }
1761
+ else {
1762
+ $aw = $this->read_ushort();
1763
+ $lsb = $this->read_ushort();
1764
+ }
1765
+ if (isset($glyphToChar[$glyph]) || $glyph == 0) {
1766
+
1767
+ if ($aw >= (1 << 15) ) { $aw = 0; } // 1.03 Some (arabic) fonts have -ve values for width
1768
+ // although should be unsigned value - comes out as e.g. 65108 (intended -50)
1769
+ if ($glyph == 0) {
1770
+ $this->defaultWidth = $scale*$aw;
1771
+ continue;
1772
+ }
1773
+ foreach($glyphToChar[$glyph] AS $char) {
1774
+ //$this->charWidths[$char] = intval(round($scale*$aw));
1775
+ if ($char != 0 && $char != 65535) {
1776
+ $w = intval(round($scale*$aw));
1777
+ if ($w == 0) { $w = 65535; }
1778
+ if ($char < 196608) {
1779
+ $this->charWidths[$char*2] = chr($w >> 8);
1780
+ $this->charWidths[$char*2 + 1] = chr($w & 0xFF);
1781
+ $nCharWidths++;
1782
+ }
1783
+ }
1784
+ }
1785
+ }
1786
+ }
1787
+ $data = $this->get_chunk(($start+$numberOfHMetrics*4),($numGlyphs*2));
1788
+ $arr = unpack("n*", $data);
1789
+ $diff = $numGlyphs-$numberOfHMetrics;
1790
+ $w = intval(round($scale*$aw));
1791
+ if ($w == 0) { $w = 65535; }
1792
+ for( $pos=0; $pos<$diff; $pos++) {
1793
+ $glyph = $pos + $numberOfHMetrics;
1794
+ if (isset($glyphToChar[$glyph])) {
1795
+ foreach($glyphToChar[$glyph] AS $char) {
1796
+ if ($char != 0 && $char != 65535) {
1797
+ if ($char < 196608) {
1798
+ $this->charWidths[$char*2] = chr($w >> 8);
1799
+ $this->charWidths[$char*2 + 1] = chr($w & 0xFF);
1800
+ $nCharWidths++;
1801
+ }
1802
+ }
1803
+ }
1804
+ }
1805
+ }
1806
+ // NB 65535 is a set width of 0
1807
+ // First bytes define number of chars in font
1808
+ $this->charWidths[0] = chr($nCharWidths >> 8);
1809
+ $this->charWidths[1] = chr($nCharWidths & 0xFF);
1810
+ }
1811
+
1812
+ function getHMetric($numberOfHMetrics, $gid) {
1813
+ $start = $this->seek_table("hmtx");
1814
+ if ($gid < $numberOfHMetrics) {
1815
+ $this->seek($start+($gid*4));
1816
+ $hm = fread($this->fh,4);
1817
+ }
1818
+ else {
1819
+ $this->seek($start+(($numberOfHMetrics-1)*4));
1820
+ $hm = fread($this->fh,2);
1821
+ $this->seek($start+($numberOfHMetrics*2)+($gid*2));
1822
+ $hm .= fread($this->fh,2);
1823
+ }
1824
+ return $hm;
1825
+ }
1826
+
1827
+ function getLOCA($indexToLocFormat, $numGlyphs) {
1828
+ $start = $this->seek_table('loca');
1829
+ $this->glyphPos = array();
1830
+ if ($indexToLocFormat == 0) {
1831
+ $data = $this->get_chunk($start,($numGlyphs*2)+2);
1832
+ $arr = unpack("n*", $data);
1833
+ for ($n=0; $n<=$numGlyphs; $n++) {
1834
+ $this->glyphPos[] = ($arr[$n+1] * 2);
1835
+ }
1836
+ }
1837
+ else if ($indexToLocFormat == 1) {
1838
+ $data = $this->get_chunk($start,($numGlyphs*4)+4);
1839
+ $arr = unpack("N*", $data);
1840
+ for ($n=0; $n<=$numGlyphs; $n++) {
1841
+ $this->glyphPos[] = ($arr[$n+1]);
1842
+ }
1843
+ }
1844
+ else
1845
+ die('Unknown location table format '.$indexToLocFormat);
1846
+ }
1847
+
1848
+
1849
+ // CMAP Format 4
1850
+ function getCMAP4($unicode_cmap_offset, &$glyphToChar, &$charToGlyph ) {
1851
+ $this->maxUniChar = 0;
1852
+ $this->seek($unicode_cmap_offset + 2);
1853
+ $length = $this->read_ushort();
1854
+ $limit = $unicode_cmap_offset + $length;
1855
+ $this->skip(2);
1856
+
1857
+ $segCount = $this->read_ushort() / 2;
1858
+ $this->skip(6);
1859
+ $endCount = array();
1860
+ for($i=0; $i<$segCount; $i++) { $endCount[] = $this->read_ushort(); }
1861
+ $this->skip(2);
1862
+ $startCount = array();
1863
+ for($i=0; $i<$segCount; $i++) { $startCount[] = $this->read_ushort(); }
1864
+ $idDelta = array();
1865
+ for($i=0; $i<$segCount; $i++) { $idDelta[] = $this->read_short(); } // ???? was unsigned short
1866
+ $idRangeOffset_start = $this->_pos;
1867
+ $idRangeOffset = array();
1868
+ for($i=0; $i<$segCount; $i++) { $idRangeOffset[] = $this->read_ushort(); }
1869
+
1870
+ for ($n=0;$n<$segCount;$n++) {
1871
+ $endpoint = ($endCount[$n] + 1);
1872
+ for ($unichar=$startCount[$n];$unichar<$endpoint;$unichar++) {
1873
+ if ($idRangeOffset[$n] == 0)
1874
+ $glyph = ($unichar + $idDelta[$n]) & 0xFFFF;
1875
+ else {
1876
+ $offset = ($unichar - $startCount[$n]) * 2 + $idRangeOffset[$n];
1877
+ $offset = $idRangeOffset_start + 2 * $n + $offset;
1878
+ if ($offset >= $limit)
1879
+ $glyph = 0;
1880
+ else {
1881
+ $glyph = $this->get_ushort($offset);
1882
+ if ($glyph != 0)
1883
+ $glyph = ($glyph + $idDelta[$n]) & 0xFFFF;
1884
+ }
1885
+ }
1886
+ $charToGlyph[$unichar] = $glyph;
1887
+ if ($unichar < 196608) { $this->maxUniChar = max($unichar,$this->maxUniChar); }
1888
+ $glyphToChar[$glyph][] = $unichar;
1889
+ }
1890
+ }
1891
+
1892
+ // mPDF 5.4.05
1893
+ if ($this->unAGlyphs) {
1894
+ if (isset($this->tables['post'])) {
1895
+ $this->seek_table("post");
1896
+ $formata = $this->read_ushort();
1897
+ $formatb = $this->read_ushort();
1898
+ // Only works on Format 2.0
1899
+ if ($formata != 2 || $formatb != 0) { die("Cannot set unAGlyphs for this font (".$file."). POST table must be in Format 2."); }
1900
+ $this->skip(28);
1901
+ $nGlyfs = $this->read_ushort();
1902
+ $glyphNameIndex = array();
1903
+ for ($i=0; $i<$nGlyfs; $i++) {
1904
+ $glyphNameIndex[($this->read_ushort())] = $i;
1905
+ }
1906
+
1907
+ $opost = $this->get_table('post');
1908
+ $ptr = 34+($nGlyfs*2);
1909
+ for ($i=0; $i<$nGlyfs; $i++) {
1910
+ $len = ord(substr($opost,$ptr,1));
1911
+ $ptr++;
1912
+ $name = substr($opost,$ptr,$len);
1913
+ $gid = $glyphNameIndex[$i+258];
1914
+ // Select uni0600.xxx(x) - uni06FF.xxx(x)
1915
+ if (preg_match('/^uni(06[0-9a-f]{2})\.(fina|medi|init|fin|med|ini)$/i',$name,$m)) {
1916
+ if (!isset($glyphToChar[$gid]) || (isset($glyphToChar[$gid]) && is_array($glyphToChar[$gid]) && count($glyphToChar[$gid])==1 && $glyphToChar[$gid][0]>57343 && $glyphToChar[$gid][0]<63489)) { // if set in PUA private use area E000-F8FF, or NOT Unicode mapped
1917
+ $uni = hexdec($m[1]);
1918
+ $form = strtoupper(substr($m[2],0,1));
1919
+ // Assign new PUA Unicode between F500 - F7FF
1920
+ $bit = $uni & 0xFF;
1921
+ if ($form == 'I') { $bit += 0xF600; }
1922
+ else if ($form == 'M') { $bit += 0xF700; }
1923
+ else { $bit += 0xF500; }
1924
+ // ADD TO CMAP
1925
+ $glyphToChar[$gid][] = $bit;
1926
+ $charToGlyph[$bit] = $gid;
1927
+ }
1928
+ }
1929
+ // LAM with ALEF ligatures (Mandatory ligatures)
1930
+ else if (preg_match('/^uni064406(22|23|25|27)(\.fina|\.fin){0,1}$/i',$name,$m)) {
1931
+ if ($m[1]=='22') {
1932
+ if ($m[2]) { $uni = hexdec('FEF6'); } else { $uni = hexdec('FEF5'); }
1933
+ }
1934
+ else if ($m[1]=='23') {
1935
+ if ($m[2]) { $uni = hexdec('FEF8'); } else { $uni = hexdec('FEF7'); }
1936
+ }
1937
+ else if ($m[1]=='25') {
1938
+ if ($m[2]) { $uni = hexdec('FEFA'); } else { $uni = hexdec('FEF9'); }
1939
+ }
1940
+ else if ($m[1]=='27') {
1941
+ if ($m[2]) { $uni = hexdec('FEFC'); } else { $uni = hexdec('FEFB'); }
1942
+ }
1943
+ if (!isset($glyphToChar[$gid]) || (isset($glyphToChar[$gid]) && is_array($glyphToChar[$gid]) && count($glyphToChar[$gid])==1 && $glyphToChar[$gid][0]>57343 && $glyphToChar[$gid][0]<63489)) { // if set in PUA private use area E000-F8FF, or NOT Unicode mapped
1944
+ // ADD TO CMAP
1945
+ $glyphToChar[$gid][] = $uni;
1946
+ $charToGlyph[$uni] = $gid;
1947
+ }
1948
+ }
1949
+ $ptr += $len;
1950
+ }
1951
+ }
1952
+ }
1953
+
1954
+ }
1955
+
1956
+
1957
+ // Put the TTF file together
1958
+ function endTTFile(&$stm) {
1959
+ $stm = '';
1960
+ $numTables = count($this->otables);
1961
+ $searchRange = 1;
1962
+ $entrySelector = 0;
1963
+ while ($searchRange * 2 <= $numTables) {
1964
+ $searchRange = $searchRange * 2;
1965
+ $entrySelector = $entrySelector + 1;
1966
+ }
1967
+ $searchRange = $searchRange * 16;
1968
+ $rangeShift = $numTables * 16 - $searchRange;
1969
+
1970
+ // Header
1971
+ if (_TTF_MAC_HEADER) {
1972
+ $stm .= (pack("Nnnnn", 0x74727565, $numTables, $searchRange, $entrySelector, $rangeShift)); // Mac
1973
+ }
1974
+ else {
1975
+ $stm .= (pack("Nnnnn", 0x00010000 , $numTables, $searchRange, $entrySelector, $rangeShift)); // Windows
1976
+ }
1977
+
1978
+ // Table directory
1979
+ $tables = $this->otables;
1980
+ ksort ($tables);
1981
+ $offset = 12 + $numTables * 16;
1982
+ foreach ($tables AS $tag=>$data) {
1983
+ if ($tag == 'head') { $head_start = $offset; }
1984
+ $stm .= $tag;
1985
+ $checksum = $this->calcChecksum($data);
1986
+ $stm .= pack("nn", $checksum[0],$checksum[1]);
1987
+ $stm .= pack("NN", $offset, strlen($data));
1988
+ $paddedLength = (strlen($data)+3)&~3;
1989
+ $offset = $offset + $paddedLength;
1990
+ }
1991
+
1992
+ // Table data
1993
+ foreach ($tables AS $tag=>$data) {
1994
+ $data .= "\0\0\0";
1995
+ $stm .= substr($data,0,(strlen($data)&~3));
1996
+ }
1997
+
1998
+ $checksum = $this->calcChecksum($stm);
1999
+ $checksum = $this->sub32(array(0xB1B0,0xAFBA), $checksum);
2000
+ $chk = pack("nn", $checksum[0],$checksum[1]);
2001
+ $stm = $this->splice($stm,($head_start + 8),$chk);
2002
+ return $stm ;
2003
+ }
2004
+
2005
+
2006
+ function repackageTTF($file, $TTCfontID=0, $debug=false, $unAGlyphs=false) { // mPDF 5.4.05
2007
+ $this->unAGlyphs = $unAGlyphs; // mPDF 5.4.05
2008
+ $this->filename = $file;
2009
+ $this->fh = fopen($file ,'rb') or die('Can\'t open file ' . $file);
2010
+ $this->_pos = 0;
2011
+ $this->charWidths = '';
2012
+ $this->glyphPos = array();
2013
+ $this->charToGlyph = array();
2014
+ $this->tables = array();
2015
+ $this->otables = array();
2016
+ $this->ascent = 0;
2017
+ $this->descent = 0;
2018
+ $this->numTTCFonts = 0;
2019
+ $this->TTCFonts = array();
2020
+ $this->skip(4);
2021
+ $this->maxUni = 0;
2022
+ if ($TTCfontID > 0) {
2023
+ $this->version = $version = $this->read_ulong(); // TTC Header version now
2024
+ if (!in_array($version, array(0x00010000,0x00020000)))
2025
+ die("ERROR - Error parsing TrueType Collection: version=".$version." - " . $file);
2026
+ $this->numTTCFonts = $this->read_ulong();
2027
+ for ($i=1; $i<=$this->numTTCFonts; $i++) {
2028
+ $this->TTCFonts[$i]['offset'] = $this->read_ulong();
2029
+ }
2030
+ $this->seek($this->TTCFonts[$TTCfontID]['offset']);
2031
+ $this->version = $version = $this->read_ulong(); // TTFont version again now
2032
+ }
2033
+ $this->readTableDirectory($debug);
2034
+ $tags = array ('OS/2', 'cmap', 'glyf', 'head', 'hhea', 'hmtx', 'loca', 'maxp', 'name', 'post', 'cvt ', 'fpgm', 'gasp', 'prep');
2035
+ /*
2036
+ Tables which require glyphIndex
2037
+ hdmx
2038
+ kern
2039
+ LTSH
2040
+
2041
+ Tables which do NOT require glyphIndex
2042
+ VDMX
2043
+
2044
+ GDEF
2045
+ GPOS
2046
+ GSUB
2047
+ JSTF
2048
+
2049
+ DSIG
2050
+ PCLT - not recommended
2051
+ */
2052
+
2053
+ foreach($tags AS $tag) {
2054
+ if (isset($this->tables[$tag])) { $this->add($tag, $this->get_table($tag)); }
2055
+ }
2056
+ fclose($this->fh);
2057
+ $stm = '';
2058
+ $this->endTTFile($stm);
2059
+ return $stm ;
2060
+ }
2061
+
2062
+
2063
+ }
2064
+
2065
+
2066
+ ?>
mPDF/classes/ttfontsuni_analysis.php ADDED
@@ -0,0 +1,463 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once(_MPDF_PATH.'classes/ttfontsuni.php');
4
+
5
+ class TTFontFile_Analysis EXTENDS TTFontFile {
6
+
7
+ // Used to get font information from files in directory
8
+ function extractCoreInfo($file, $TTCfontID=0) {
9
+ $this->filename = $file;
10
+ $this->fh = fopen($file,'rb');
11
+ if (!$this->fh) { return ('ERROR - Can\'t open file ' . $file); }
12
+ $this->_pos = 0;
13
+ $this->charWidths = '';
14
+ $this->glyphPos = array();
15
+ $this->charToGlyph = array();
16
+ $this->tables = array();
17
+ $this->otables = array();
18
+ $this->ascent = 0;
19
+ $this->descent = 0;
20
+ $this->numTTCFonts = 0;
21
+ $this->TTCFonts = array();
22
+ $this->version = $version = $this->read_ulong();
23
+ $this->panose = array(); // mPDF 5.0
24
+ if ($version==0x4F54544F)
25
+ return("ERROR - NOT ADDED as Postscript outlines are not supported - " . $file);
26
+ if ($version==0x74746366) {
27
+ if ($TTCfontID > 0) {
28
+ $this->version = $version = $this->read_ulong(); // TTC Header version now
29
+ if (!in_array($version, array(0x00010000,0x00020000)))
30
+ return("ERROR - NOT ADDED as Error parsing TrueType Collection: version=".$version." - " . $file);
31
+ }
32
+ else return("ERROR - Error parsing TrueType Collection - " . $file);
33
+ $this->numTTCFonts = $this->read_ulong();
34
+ for ($i=1; $i<=$this->numTTCFonts; $i++) {
35
+ $this->TTCFonts[$i]['offset'] = $this->read_ulong();
36
+ }
37
+ $this->seek($this->TTCFonts[$TTCfontID]['offset']);
38
+ $this->version = $version = $this->read_ulong(); // TTFont version again now
39
+ $this->readTableDirectory(false);
40
+ }
41
+ else {
42
+ if (!in_array($version, array(0x00010000,0x74727565)))
43
+ return("ERROR - NOT ADDED as Not a TrueType font: version=".$version." - " . $file);
44
+ $this->readTableDirectory(false);
45
+ }
46
+
47
+ /* Included for testing...
48
+ $cmap_offset = $this->seek_table("cmap");
49
+ $this->skip(2);
50
+ $cmapTableCount = $this->read_ushort();
51
+ $unicode_cmap_offset = 0;
52
+ for ($i=0;$i<$cmapTableCount;$i++) {
53
+ $x[$i]['platformId'] = $this->read_ushort();
54
+ $x[$i]['encodingId'] = $this->read_ushort();
55
+ $x[$i]['offset'] = $this->read_ulong();
56
+ $save_pos = $this->_pos;
57
+ $x[$i]['format'] = $this->get_ushort($cmap_offset + $x[$i]['offset'] );
58
+ $this->seek($save_pos );
59
+ }
60
+ print_r($x); exit;
61
+ */
62
+ ///////////////////////////////////
63
+ // name - Naming table
64
+ ///////////////////////////////////
65
+
66
+ /* Test purposes - displays table of names
67
+ $name_offset = $this->seek_table("name");
68
+ $format = $this->read_ushort();
69
+ if ($format != 0 && $format != 1) // mPDF 5.3.73
70
+ die("Unknown name table format ".$format);
71
+ $numRecords = $this->read_ushort();
72
+ $string_data_offset = $name_offset + $this->read_ushort();
73
+ for ($i=0;$i<$numRecords; $i++) {
74
+ $x[$i]['platformId'] = $this->read_ushort();
75
+ $x[$i]['encodingId'] = $this->read_ushort();
76
+ $x[$i]['languageId'] = $this->read_ushort();
77
+ $x[$i]['nameId'] = $this->read_ushort();
78
+ $x[$i]['length'] = $this->read_ushort();
79
+ $x[$i]['offset'] = $this->read_ushort();
80
+
81
+ $N = '';
82
+ if ($x[$i]['platformId'] == 1 && $x[$i]['encodingId'] == 0 && $x[$i]['languageId'] == 0) { // Roman
83
+ $opos = $this->_pos;
84
+ $N = $this->get_chunk($string_data_offset + $x[$i]['offset'] , $x[$i]['length'] );
85
+ $this->_pos = $opos;
86
+ $this->seek($opos);
87
+ }
88
+ else { // Unicode
89
+ $opos = $this->_pos;
90
+ $this->seek($string_data_offset + $x[$i]['offset'] );
91
+ $length = $x[$i]['length'] ;
92
+ if ($length % 2 != 0)
93
+ $length -= 1;
94
+ // die("PostScript name is UTF-16BE string of odd length");
95
+ $length /= 2;
96
+ $N = '';
97
+ while ($length > 0) {
98
+ $char = $this->read_ushort();
99
+ $N .= (chr($char));
100
+ $length -= 1;
101
+ }
102
+ $this->_pos = $opos;
103
+ $this->seek($opos);
104
+ }
105
+ $x[$i]['names'][$nameId] = $N;
106
+ }
107
+ print_r($x); exit;
108
+ */
109
+
110
+ $name_offset = $this->seek_table("name");
111
+ $format = $this->read_ushort();
112
+ if ($format != 0 && $format != 1) // mPDF 5.3.73
113
+ return("ERROR - NOT ADDED as Unknown name table format ".$format." - " . $file);
114
+ $numRecords = $this->read_ushort();
115
+ $string_data_offset = $name_offset + $this->read_ushort();
116
+ $names = array(1=>'',2=>'',3=>'',4=>'',6=>'');
117
+ $K = array_keys($names);
118
+ $nameCount = count($names);
119
+ for ($i=0;$i<$numRecords; $i++) {
120
+ $platformId = $this->read_ushort();
121
+ $encodingId = $this->read_ushort();
122
+ $languageId = $this->read_ushort();
123
+ $nameId = $this->read_ushort();
124
+ $length = $this->read_ushort();
125
+ $offset = $this->read_ushort();
126
+ if (!in_array($nameId,$K)) continue;
127
+ $N = '';
128
+ if ($platformId == 3 && $encodingId == 1 && $languageId == 0x409) { // Microsoft, Unicode, US English, PS Name
129
+ $opos = $this->_pos;
130
+ $this->seek($string_data_offset + $offset);
131
+ if ($length % 2 != 0)
132
+ $length += 1;
133
+ $length /= 2;
134
+ $N = '';
135
+ while ($length > 0) {
136
+ $char = $this->read_ushort();
137
+ $N .= (chr($char));
138
+ $length -= 1;
139
+ }
140
+ $this->_pos = $opos;
141
+ $this->seek($opos);
142
+ }
143
+ else if ($platformId == 1 && $encodingId == 0 && $languageId == 0) { // Macintosh, Roman, English, PS Name
144
+ $opos = $this->_pos;
145
+ $N = $this->get_chunk($string_data_offset + $offset, $length);
146
+ $this->_pos = $opos;
147
+ $this->seek($opos);
148
+ }
149
+ if ($N && $names[$nameId]=='') {
150
+ $names[$nameId] = $N;
151
+ $nameCount -= 1;
152
+ if ($nameCount==0) break;
153
+ }
154
+ }
155
+ if ($names[6])
156
+ $psName = preg_replace('/ /','-',$names[6]);
157
+ else if ($names[4])
158
+ $psName = preg_replace('/ /','-',$names[4]);
159
+ else if ($names[1])
160
+ $psName = preg_replace('/ /','-',$names[1]);
161
+ else
162
+ $psName = '';
163
+ if (!$names[1] && !$psName)
164
+ return("ERROR - NOT ADDED as Could not find valid font name - " . $file);
165
+ $this->name = $psName;
166
+ if ($names[1]) { $this->familyName = $names[1]; } else { $this->familyName = $psName; }
167
+ if ($names[2]) { $this->styleName = $names[2]; } else { $this->styleName = 'Regular'; }
168
+
169
+ ///////////////////////////////////
170
+ // head - Font header table
171
+ ///////////////////////////////////
172
+ $this->seek_table("head");
173
+ $ver_maj = $this->read_ushort();
174
+ $ver_min = $this->read_ushort();
175
+ if ($ver_maj != 1)
176
+ return('ERROR - NOT ADDED as Unknown head table version '. $ver_maj .'.'. $ver_min." - " . $file);
177
+ $this->fontRevision = $this->read_ushort() . $this->read_ushort();
178
+ $this->skip(4);
179
+ $magic = $this->read_ulong();
180
+ if ($magic != 0x5F0F3CF5)
181
+ return('ERROR - NOT ADDED as Invalid head table magic ' .$magic." - " . $file);
182
+ $this->skip(2);
183
+ $this->unitsPerEm = $unitsPerEm = $this->read_ushort();
184
+ $scale = 1000 / $unitsPerEm;
185
+ $this->skip(24);
186
+ $macStyle = $this->read_short();
187
+ $this->skip(4);
188
+ $indexLocFormat = $this->read_short();
189
+
190
+ ///////////////////////////////////
191
+ // OS/2 - OS/2 and Windows metrics table
192
+ ///////////////////////////////////
193
+ $sFamily = '';
194
+ $panose = '';
195
+ $fsSelection = '';
196
+ if (isset($this->tables["OS/2"])) {
197
+ $this->seek_table("OS/2");
198
+ $this->skip(30);
199
+ $sF = $this->read_short();
200
+ $sFamily = ($sF >> 8);
201
+ $this->_pos += 10; //PANOSE = 10 byte length
202
+ $panose = fread($this->fh,10);
203
+ $this->panose = array();
204
+ for ($p=0;$p<strlen($panose);$p++) { $this->panose[] = ord($panose[$p]); }
205
+ $this->skip(20);
206
+ $fsSelection = $this->read_short();
207
+ }
208
+
209
+ ///////////////////////////////////
210
+ // post - PostScript table
211
+ ///////////////////////////////////
212
+ $this->seek_table("post");
213
+ $this->skip(4);
214
+ $this->italicAngle = $this->read_short() + $this->read_ushort() / 65536.0;
215
+ $this->skip(4);
216
+ $isFixedPitch = $this->read_ulong();
217
+
218
+
219
+
220
+ ///////////////////////////////////
221
+ // cmap - Character to glyph index mapping table
222
+ ///////////////////////////////////
223
+ $cmap_offset = $this->seek_table("cmap");
224
+ $this->skip(2);
225
+ $cmapTableCount = $this->read_ushort();
226
+ $unicode_cmap_offset = 0;
227
+ for ($i=0;$i<$cmapTableCount;$i++) {
228
+ $platformID = $this->read_ushort();
229
+ $encodingID = $this->read_ushort();
230
+ $offset = $this->read_ulong();
231
+ $save_pos = $this->_pos;
232
+ if (($platformID == 3 && $encodingID == 1) || $platformID == 0) { // Microsoft, Unicode
233
+ $format = $this->get_ushort($cmap_offset + $offset);
234
+ if ($format == 4) {
235
+ if (!$unicode_cmap_offset) $unicode_cmap_offset = $cmap_offset + $offset;
236
+ }
237
+ }
238
+ else if ((($platformID == 3 && $encodingID == 10) || $platformID == 0)) { // Microsoft, Unicode Format 12 table HKCS
239
+ $format = $this->get_ushort($cmap_offset + $offset);
240
+ if ($format == 12) {
241
+ $unicode_cmap_offset = $cmap_offset + $offset;
242
+ break;
243
+ }
244
+ }
245
+ $this->seek($save_pos );
246
+ }
247
+
248
+ if (!$unicode_cmap_offset)
249
+ return('ERROR - Font ('.$this->filename .') NOT ADDED as it is not Unicode encoded, and cannot be used by mPDF');
250
+
251
+ $rtl = false;
252
+ $indic = false;
253
+ $cjk = false;
254
+ $sip = false;
255
+ $smp = false;
256
+ $pua = false;
257
+ $puaag = false;
258
+ $glyphToChar = array();
259
+ $unAGlyphs = '';
260
+ // Format 12 CMAP does characters above Unicode BMP i.e. some HKCS characters U+20000 and above
261
+ if ($format == 12) {
262
+ $this->seek($unicode_cmap_offset + 4);
263
+ $length = $this->read_ulong();
264
+ $limit = $unicode_cmap_offset + $length;
265
+ $this->skip(4);
266
+ $nGroups = $this->read_ulong();
267
+ for($i=0; $i<$nGroups ; $i++) {
268
+ $startCharCode = $this->read_ulong();
269
+ $endCharCode = $this->read_ulong();
270
+ $startGlyphCode = $this->read_ulong();
271
+ if (($endCharCode > 0x20000 && $endCharCode < 0x2A6DF) || ($endCharCode > 0x2F800 && $endCharCode < 0x2FA1F)) {
272
+ $sip = true;
273
+ }
274
+ if ($endCharCode > 0x10000 && $endCharCode < 0x1FFFF) {
275
+ $smp = true;
276
+ }
277
+ if (($endCharCode > 0x0590 && $endCharCode < 0x077F) || ($endCharCode > 0xFE70 && $endCharCode < 0xFEFF) || ($endCharCode > 0xFB50 && $endCharCode < 0xFDFF)) {
278
+ $rtl = true;
279
+ }
280
+ if ($endCharCode > 0x0900 && $endCharCode < 0x0DFF) {
281
+ $indic = true;
282
+ }
283
+ if ($endCharCode > 0xE000 && $endCharCode < 0xF8FF) {
284
+ $pua = true;
285
+ if ($endCharCode > 0xF500 && $endCharCode < 0xF7FF) {
286
+ $puaag = true;
287
+ }
288
+ }
289
+ if (($endCharCode > 0x2E80 && $endCharCode < 0x4DC0) || ($endCharCode > 0x4E00 && $endCharCode < 0xA4CF) || ($endCharCode > 0xAC00 && $endCharCode < 0xD7AF) || ($endCharCode > 0xF900 && $endCharCode < 0xFAFF) || ($endCharCode > 0xFE30 && $endCharCode < 0xFE4F)) {
290
+ $cjk = true;
291
+ }
292
+
293
+ $offset = 0;
294
+ // Get each glyphToChar - only point if going to analyse un-mapped Arabic Glyphs
295
+ if (isset($this->tables['post'])) {
296
+ for ($unichar=$startCharCode;$unichar<=$endCharCode;$unichar++) {
297
+ $glyph = $startGlyphCode + $offset ;
298
+ $offset++;
299
+ $glyphToChar[$glyph][] = $unichar;
300
+ }
301
+ }
302
+
303
+
304
+ }
305
+ }
306
+
307
+ else { // Format 4 CMap
308
+ $this->seek($unicode_cmap_offset + 2);
309
+ $length = $this->read_ushort();
310
+ $limit = $unicode_cmap_offset + $length;
311
+ $this->skip(2);
312
+
313
+ $segCount = $this->read_ushort() / 2;
314
+ $this->skip(6);
315
+ $endCount = array();
316
+ for($i=0; $i<$segCount; $i++) { $endCount[] = $this->read_ushort(); }
317
+ $this->skip(2);
318
+ $startCount = array();
319
+ for($i=0; $i<$segCount; $i++) { $startCount[] = $this->read_ushort(); }
320
+ $idDelta = array();
321
+ for($i=0; $i<$segCount; $i++) { $idDelta[] = $this->read_short(); }
322
+ $idRangeOffset_start = $this->_pos;
323
+ $idRangeOffset = array();
324
+ for($i=0; $i<$segCount; $i++) { $idRangeOffset[] = $this->read_ushort(); }
325
+
326
+ for ($n=0;$n<$segCount;$n++) {
327
+ if (($endCount[$n] > 0x0590 && $endCount[$n] < 0x077F) || ($endCount[$n] > 0xFE70 && $endCount[$n] < 0xFEFF) || ($endCount[$n] > 0xFB50 && $endCount[$n] < 0xFDFF)) {
328
+ $rtl = true;
329
+ }
330
+ if ($endCount[$n] > 0x0900 && $endCount[$n] < 0x0DFF) {
331
+ $indic = true;
332
+ }
333
+ if (($endCount[$n] > 0x2E80 && $endCount[$n] < 0x4DC0) || ($endCount[$n] > 0x4E00 && $endCount[$n] < 0xA4CF) || ($endCount[$n] > 0xAC00 && $endCount[$n] < 0xD7AF) || ($endCount[$n] > 0xF900 && $endCount[$n] < 0xFAFF) || ($endCount[$n] > 0xFE30 && $endCount[$n] < 0xFE4F)) {
334
+ $cjk = true;
335
+ }
336
+ if ($endCount[$n] > 0xE000 && $endCount[$n] < 0xF8FF) {
337
+ $pua = true;
338
+ if ($endCount[$n] > 0xF500 && $endCount[$n] < 0xF7FF) {
339
+ $puaag = true;
340
+ }
341
+ }
342
+ // Get each glyphToChar - only point if going to analyse un-mapped Arabic Glyphs
343
+ if (isset($this->tables['post'])) {
344
+ $endpoint = ($endCount[$n] + 1);
345
+ for ($unichar=$startCount[$n];$unichar<$endpoint;$unichar++) {
346
+ if ($idRangeOffset[$n] == 0)
347
+ $glyph = ($unichar + $idDelta[$n]) & 0xFFFF;
348
+ else {
349
+ $offset = ($unichar - $startCount[$n]) * 2 + $idRangeOffset[$n];
350
+ $offset = $idRangeOffset_start + 2 * $n + $offset;
351
+ if ($offset >= $limit)
352
+ $glyph = 0;
353
+ else {
354
+ $glyph = $this->get_ushort($offset);
355
+ if ($glyph != 0)
356
+ $glyph = ($glyph + $idDelta[$n]) & 0xFFFF;
357
+ }
358
+ }
359
+ $glyphToChar[$glyph][] = $unichar;
360
+ }
361
+ }
362
+
363
+ }
364
+ }
365
+ // 'POST' table for un-mapped arabic glyphs
366
+ if (isset($this->tables['post'])) {
367
+ $this->seek_table("post");
368
+ // Only works on Format 2.0
369
+ $formata = $this->read_ushort();
370
+ $formatb = $this->read_ushort();
371
+ if ($formata == 2 && $formatb == 0) {
372
+ $this->skip(28);
373
+ $nGlyfs = $this->read_ushort();
374
+ $glyphNameIndex = array();
375
+ for ($i=0; $i<$nGlyfs; $i++) {
376
+ $glyphNameIndex[($this->read_ushort())] = $i;
377
+ }
378
+
379
+ $opost = $this->get_table('post');
380
+ $ptr = 34+($nGlyfs*2);
381
+ for ($i=0; $i<$nGlyfs; $i++) {
382
+ $len = ord(substr($opost,$ptr,1));
383
+ $ptr++;
384
+ $name = substr($opost,$ptr,$len);
385
+ $gid = $glyphNameIndex[$i+258];
386
+ // Select uni0600.xxx(x) - uni06FF.xxx(x)
387
+ if (preg_match('/^uni(06[0-9a-f]{2})\.(fina|medi|init|fin|med|ini)$/i',$name,$m)) {
388
+ if (!isset($glyphToChar[$gid]) || (isset($glyphToChar[$gid]) && is_array($glyphToChar[$gid]) && count($glyphToChar[$gid])==1 && $glyphToChar[$gid][0]>57343 && $glyphToChar[$gid][0]<63489)) { // if set in PUA private use area E000-F8FF, or NOT Unicode mapped
389
+ $uni = hexdec($m[1]);
390
+ $form = strtoupper(substr($m[2],0,1));
391
+ // Assign new PUA Unicode between F500 - F7FF
392
+ $bit = $uni & 0xFF;
393
+ if ($form == 'I') { $bit += 0xF600; }
394
+ else if ($form == 'M') { $bit += 0xF700; }
395
+ else { $bit += 0xF500; }
396
+ $unAGlyphs .= $gid;
397
+ $name = 'uni'.strtoupper($m[1]).'.'.strtolower($m[2]);
398
+ $unAGlyphs .= ' : '.$name;
399
+ $unihexstr = $m[1];
400
+ $unAGlyphs .= ' : '.$unihexstr;
401
+ $unAGlyphs .= ' : '.$uni;
402
+ $unAGlyphs .= ' : '.$form;
403
+ // if already set in PUA private use area E000-F8FF
404
+ if (isset($glyphToChar[$gid]) && $glyphToChar[$gid][0]>57343 && $glyphToChar[$gid][0]<63489) {
405
+ $unAGlyphs .= ' : '.$glyphToChar[$gid][0].' {'.dechex($glyphToChar[$gid][0]).'}';
406
+ }
407
+ //else $unAGlyphs .= ':';
408
+ $unAGlyphs .= ' : '.strtoupper(dechex($bit));
409
+ $unAGlyphs .= '<br />';
410
+ }
411
+ }
412
+ $ptr += $len;
413
+ }
414
+ if ($unAGlyphs) {
415
+ $unAGlyphs = 'GID:Name:Unicode base Hex:Dec:Form:PUA Unicode<br />'.$unAGlyphs ;
416
+ }
417
+ }
418
+ }
419
+
420
+
421
+
422
+ $bold = false;
423
+ $italic = false;
424
+ $ftype = '';
425
+ if ($macStyle & (1 << 0)) { $bold = true; } // bit 0 bold
426
+ else if ($fsSelection & (1 << 5)) { $bold = true; } // 5 BOLD Characters are emboldened
427
+
428
+ if ($macStyle & (1 << 1)) { $italic = true; } // bit 1 italic
429
+ else if ($fsSelection & (1 << 0)) { $italic = true; } // 0 ITALIC Font contains Italic characters, otherwise they are upright
430
+ else if ($this->italicAngle <> 0) { $italic = true; }
431
+
432
+ if ($isFixedPitch ) { $ftype = 'mono'; }
433
+ else if ($sFamily >0 && $sFamily <8) { $ftype = 'serif'; }
434
+ else if ($sFamily ==8) { $ftype = 'sans'; }
435
+ else if ($sFamily ==10) { $ftype = 'cursive'; }
436
+ // Use PANOSE
437
+ if ($panose) {
438
+ $bFamilyType=ord($panose[0]);
439
+ if ($bFamilyType==2) {
440
+ $bSerifStyle=ord($panose[1]);
441
+ if (!$ftype) {
442
+ if ($bSerifStyle>1 && $bSerifStyle<11) { $ftype = 'serif'; }
443
+ else if ($bSerifStyle>10) { $ftype = 'sans'; }
444
+ }
445
+ $bProportion=ord($panose[3]);
446
+ if ($bProportion==9 || $bProportion==1) { $ftype = 'mono'; } // ==1 i.e. No Fit needed for OCR-a and -b
447
+ }
448
+ else if ($bFamilyType==3) {
449
+ $ftype = 'cursive';
450
+ }
451
+ }
452
+
453
+ fclose($this->fh);
454
+ return array($this->familyName, $bold, $italic, $ftype, $TTCfontID, $rtl, $indic, $cjk, $sip, $smp, $puaag, $pua, $unAGlyphs);
455
+ }
456
+
457
+
458
+
459
+
460
+ }
461
+
462
+
463
+ ?>
mPDF/classes/wmf.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class wmf {
4
+
5
+ var $mpdf = null;
6
+ var $gdiObjectArray;
7
+
8
+ function wmf(&$mpdf) {
9
+ $this->mpdf = $mpdf;
10
+ }
11
+
12
+
13
+ function _getWMFimage($data) {
14
+ $k = _MPDFK;
15
+
16
+ $this->gdiObjectArray = array();
17
+ $a=unpack('stest',"\1\0");
18
+ if ($a['test']!=1)
19
+ return array(0, 'Error parsing WMF image - Big-endian architecture not supported');
20
+ // check for Aldus placeable metafile header
21
+ $key = unpack('Lmagic', substr($data, 0, 4));
22
+ $p = 18; // WMF header
23
+ if ($key['magic'] == (int)0x9AC6CDD7) { $p +=22; } // Aldus header
24
+ // define some state variables
25
+ $wo=null; // window origin
26
+ $we=null; // window extent
27
+ $polyFillMode = 0;
28
+ $nullPen = false;
29
+ $nullBrush = false;
30
+ $endRecord = false;
31
+ $wmfdata = '';
32
+ while ($p < strlen($data) && !$endRecord) {
33
+ $recordInfo = unpack('Lsize/Sfunc', substr($data, $p, 6)); $p += 6;
34
+ // size of record given in WORDs (= 2 bytes)
35
+ $size = $recordInfo['size'];
36
+ // func is number of GDI function
37
+ $func = $recordInfo['func'];
38
+ if ($size > 3) {
39
+ $parms = substr($data, $p, 2*($size-3)); $p += 2*($size-3);
40
+ }
41
+ switch ($func) {
42
+ case 0x020b: // SetWindowOrg
43
+ // do not allow window origin to be changed
44
+ // after drawing has begun
45
+ if (!$wmfdata)
46
+ $wo = array_reverse(unpack('s2', $parms));
47
+ break;
48
+ case 0x020c: // SetWindowExt
49
+ // do not allow window extent to be changed
50
+ // after drawing has begun
51
+ if (!$wmfdata)
52
+ $we = array_reverse(unpack('s2', $parms));
53
+ break;
54
+ case 0x02fc: // CreateBrushIndirect
55
+ $brush = unpack('sstyle/Cr/Cg/Cb/Ca/Shatch', $parms);
56
+ $brush['type'] = 'B';
57
+ $this->_AddGDIObject($brush);
58
+ break;
59
+ case 0x02fa: // CreatePenIndirect
60
+ $pen = unpack('Sstyle/swidth/sdummy/Cr/Cg/Cb/Ca', $parms);
61
+ // convert width from twips to user unit
62
+ $pen['width'] /= (20 * $k);
63
+ $pen['type'] = 'P';
64
+ $this->_AddGDIObject($pen);
65
+ break;
66
+
67
+ // MUST create other GDI objects even if we don't handle them
68
+ case 0x06fe: // CreateBitmap
69
+ case 0x02fd: // CreateBitmapIndirect
70
+ case 0x00f8: // CreateBrush
71
+ case 0x02fb: // CreateFontIndirect
72
+ case 0x00f7: // CreatePalette
73
+ case 0x01f9: // CreatePatternBrush
74
+ case 0x06ff: // CreateRegion
75
+ case 0x0142: // DibCreatePatternBrush
76
+ $dummyObject = array('type'=>'D');
77
+ $this->_AddGDIObject($dummyObject);
78
+ break;
79
+ case 0x0106: // SetPolyFillMode
80
+ $polyFillMode = unpack('smode', $parms);
81
+ $polyFillMode = $polyFillMode['mode'];
82
+ break;
83
+ case 0x01f0: // DeleteObject
84
+ $idx = unpack('Sidx', $parms);
85
+ $idx = $idx['idx'];
86
+ $this->_DeleteGDIObject($idx);
87
+ break;
88
+ case 0x012d: // SelectObject
89
+ $idx = unpack('Sidx', $parms);
90
+ $idx = $idx['idx'];
91
+ $obj = $this->_GetGDIObject($idx);
92
+ switch ($obj['type']) {
93
+ case 'B':
94
+ $nullBrush = false;
95
+ if ($obj['style'] == 1) { $nullBrush = true; }
96
+ else {
97
+ $wmfdata .= $this->mpdf->SetFColor($this->mpdf->ConvertColor('rgb('.$obj['r'].','.$obj['g'].','.$obj['b'].')'), true)."\n";
98
+ }
99
+ break;
100
+ case 'P':
101
+ $nullPen = false;
102
+ $dashArray = array();
103
+ // dash parameters are custom
104
+ switch ($obj['style']) {
105
+ case 0: // PS_SOLID
106
+ break;
107
+ case 1: // PS_DASH
108
+ $dashArray = array(3,1);
109
+ break;
110
+ case 2: // PS_DOT
111
+ $dashArray = array(0.5,0.5);
112
+ break;
113
+ case 3: // PS_DASHDOT
114
+ $dashArray = array(2,1,0.5,1);
115
+ break;
116
+ case 4: // PS_DASHDOTDOT
117
+ $dashArray = array(2,1,0.5,1,0.5,1);
118
+ break;
119
+ case 5: // PS_NULL
120
+ $nullPen = true;
121
+ break;
122
+ }
123
+ if (!$nullPen) {
124
+ $wmfdata .= $this->mpdf->SetDColor($this->mpdf->ConvertColor('rgb('.$obj['r'].','.$obj['g'].','.$obj['b'].')'), true)."\n";
125
+ $wmfdata .= sprintf("%.3F w\n",$obj['width']*$k);
126
+ }
127
+ if (!empty($dashArray)) {
128
+ $s = '[';
129
+ for ($i=0; $i<count($dashArray);$i++) {
130
+ $s .= $dashArray[$i] * $k;
131
+ if ($i != count($dashArray)-1) { $s .= ' '; }
132
+ }
133
+ $s .= '] 0 d';
134
+ $wmfdata .= $s."\n";
135
+ }
136
+ break;
137
+ }
138
+ break;
139
+ case 0x0325: // Polyline
140
+ case 0x0324: // Polygon
141
+ $coords = unpack('s'.($size-3), $parms);
142
+ $numpoints = $coords[1];
143
+ for ($i = $numpoints; $i > 0; $i--) {
144
+ $px = $coords[2*$i];
145
+ $py = $coords[2*$i+1];
146
+
147
+ if ($i < $numpoints) { $wmfdata .= $this->_LineTo($px, $py); }
148
+ else { $wmfdata .= $this->_MoveTo($px, $py); }
149
+ }
150
+ if ($func == 0x0325) { $op = 's'; }
151
+ else if ($func == 0x0324) {
152
+ if ($nullPen) {
153
+ if ($nullBrush) { $op = 'n'; } // no op
154
+ else { $op = 'f'; } // fill
155
+ }
156
+ else {
157
+ if ($nullBrush) { $op = 's'; } // stroke
158
+ else { $op = 'b'; } // stroke and fill
159
+ }
160
+ if ($polyFillMode==1 && ($op=='b' || $op=='f')) { $op .= '*'; } // use even-odd fill rule
161
+ }
162
+ $wmfdata .= $op."\n";
163
+ break;
164
+ case 0x0538: // PolyPolygon
165
+ $coords = unpack('s'.($size-3), $parms);
166
+ $numpolygons = $coords[1];
167
+ $adjustment = $numpolygons;
168
+ for ($j = 1; $j <= $numpolygons; $j++) {
169
+ $numpoints = $coords[$j + 1];
170
+ for ($i = $numpoints; $i > 0; $i--) {
171
+ $px = $coords[2*$i + $adjustment];
172
+ $py = $coords[2*$i+1 + $adjustment];
173
+ if ($i == $numpoints) { $wmfdata .= $this->_MoveTo($px, $py); }
174
+ else { $wmfdata .= $this->_LineTo($px, $py); }
175
+ }
176
+ $adjustment += $numpoints * 2;
177
+ }
178
+
179
+ if ($nullPen) {
180
+ if ($nullBrush) { $op = 'n'; } // no op
181
+ else { $op = 'f'; } // fill
182
+ }
183
+ else {
184
+ if ($nullBrush) { $op = 's'; } // stroke
185
+ else { $op = 'b'; } // stroke and fill
186
+ }
187
+ if ($polyFillMode==1 && ($op=='b' || $op=='f')) { $op .= '*'; } // use even-odd fill rule
188
+ $wmfdata .= $op."\n";
189
+ break;
190
+ case 0x0000:
191
+ $endRecord = true;
192
+ break;
193
+ }
194
+ }
195
+
196
+
197
+ return array(1,$wmfdata,$wo,$we);
198
+ }
199
+
200
+
201
+ function _MoveTo($x, $y) {
202
+ return "$x $y m\n";
203
+ }
204
+
205
+ // a line must have been started using _MoveTo() first
206
+ function _LineTo($x, $y) {
207
+ return "$x $y l\n";
208
+ }
209
+
210
+ function _AddGDIObject($obj) {
211
+ // find next available slot
212
+ $idx = 0;
213
+ if (!empty($this->gdiObjectArray)) {
214
+ $empty = false;
215
+ $i = 0;
216
+ while (!$empty) {
217
+ $empty = !isset($this->gdiObjectArray[$i]);
218
+ $i++;
219
+ }
220
+ $idx = $i-1;
221
+ }
222
+ $this->gdiObjectArray[$idx] = $obj;
223
+ }
224
+
225
+ function _GetGDIObject($idx) {
226
+ return $this->gdiObjectArray[$idx];
227
+ }
228
+
229
+ function _DeleteGDIObject($idx) {
230
+ unset($this->gdiObjectArray[$idx]);
231
+ }
232
+
233
+
234
+ }
235
+
236
+ ?>
mPDF/compress.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $excl = array( 'HTML-CSS', 'DIRECTW', 'TABLES', 'LISTS', 'IMAGES-CORE',
4
+ 'IMAGES-BMP', 'IMAGES-WMF', 'TABLES-ADVANCED-BORDERS', 'HTMLHEADERS-FOOTERS', 'COLUMNS', 'TOC', 'INDEX', 'BOOKMARKS', 'BARCODES', 'FORMS', 'WATERMARK', 'CJK-FONTS', 'RTL', 'INDIC', 'ANNOTATIONS', 'BACKGROUNDS', 'CSS-FLOAT', 'CSS-IMAGE-FLOAT', 'CSS-POSITION', 'CSS-PAGE', 'BORDER-RADIUS', 'HYPHENATION', 'ENCRYPTION', 'IMPORTS', 'PROGRESS-BAR');
5
+
6
+
7
+ // *DIRECTW* = Write, WriteText, WriteCell, Text, Shaded_box, AutosizeText
8
+ // IMAGES-CORE = [PNG, GIF, and JPG] NB background-images and watermark images
9
+
10
+ // Excluding 'HTML-CSS' will also exclude: 'TABLES', 'LISTS', 'TABLES-ADVANCED-BORDERS', 'HTMLHEADERS-FOOTERS', 'FORMS', 'BACKGROUNDS', 'CSS-FLOAT', 'CSS-IMAGE-FLOAT', 'CSS-POSITION', 'CSS-PAGE', 'BORDER-RADIUS'
11
+
12
+ // Text is marked in mpdf_source.php with e.g. :
13
+ /*-- TABLES-ADVANCED-BORDERS --*/
14
+ /*-- END TABLES-ADVANCED-BORDERS --*/
15
+ // *TABLES-ADVANCED-BORDERS*
16
+
17
+
18
+ if (!isset($_POST['generate']) || $_POST['generate']!='generate') {
19
+
20
+
21
+ if (!file_exists('mpdf_source.php')) {
22
+ die("ERROR - Could not find mpdf_source.php file in current directory. Please rename mpdf.php as mpdf_source.php");
23
+ }
24
+
25
+
26
+
27
+
28
+ echo '<html>
29
+ <head>
30
+ <script language=javascript>
31
+ checked=false;
32
+ function checkedAll (frm1) {
33
+ var aa= document.getElementById("frm1");
34
+ if (checked == false)
35
+ {
36
+ checked = true
37
+ }
38
+ else
39
+ {
40
+ checked = false
41
+ }
42
+ for (var i =0; i < aa.elements.length; i++)
43
+ {
44
+ aa.elements[i].checked = checked;
45
+ }
46
+ }
47
+ </script>
48
+ </head>
49
+ <body>
50
+ <p><span style="color:red; font-weight: bold;">WARNING</span>: This utility will OVERWRITE mpdf.php file in the current directory.</p>
51
+ <p>Select the functions you wish to INCLUDE in your mpdf.php program. When you click generate, a new mpdf.php file will be written to the current directory.</p>
52
+ <div><b>Notes</b>
53
+ <ul>
54
+ <li>HTML-CSS is required for many of the other functions to work including: Tables, Lists, Backgrounds, Forms, Border-radius and all other CSS</li>
55
+ <li>DIRECTW includes the functions to Write directly to the PDF file e.g. Write, WriteText, WriteCell, Text, Shaded_box, AutosizeText</li>
56
+ <li>You must include either HTML-CSS or DIRECTW</li>
57
+ <li>JPG, PNG and JPG images are supported with IMAGES-CORE</li>
58
+ <li>For WMF Images, you must include both IMAGES-CORE and IMAGES-WMF</li>
59
+ <li>IMAGES-CORE are required for BACKGROUNDS (IMAGES) or WATERMARKS to work</li>
60
+ </ul>
61
+ </div>
62
+ <input type="checkbox" name="checkall" onclick="checkedAll(frm1);"> <i>Select/Unselect All</i><br /><br />
63
+
64
+ <form id="frm1" action="compress.php" method="POST">
65
+ ';
66
+ foreach($excl AS $k=>$ex) {
67
+ echo '<input type="checkbox" value="1" name="inc['.$ex.']"';
68
+ if ($k==0 || ($k > 1 && $k < 5)) {
69
+ echo ' checked="checked"';
70
+ }
71
+ echo ' /> '.$ex.'<br />';
72
+ }
73
+
74
+ echo '<br />
75
+ <input type="submit" name="generate" value="generate" />
76
+ </form>
77
+ </body>
78
+ </html>';
79
+ exit;
80
+ }
81
+
82
+ $inc = $_POST['inc'];
83
+ if (is_array($inc) && count($inc)>0 ) {
84
+ foreach($inc AS $i=>$v) {
85
+ $key = array_search($i, $excl);
86
+ unset($excl[$key]);
87
+ }
88
+ }
89
+
90
+ if (!defined('PHP_VERSION_ID')) {
91
+ $version = explode('.', PHP_VERSION);
92
+ define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
93
+ }
94
+ if (PHP_VERSION_ID < 50300) { $mqr = @get_magic_quotes_runtime(); }
95
+ else { $mqr=0; }
96
+ if ($mqr) { set_magic_quotes_runtime(0); }
97
+
98
+ $l = file('mpdf_source.php');
99
+ if (!count($l)) { die("ERROR - Could not find mpdf_source.php file in current directory"); }
100
+ $exclflags = array();
101
+ $x = '';
102
+
103
+ // Excluding 'HTML-CSS' will also exclude: 'TABLES', 'LISTS', 'TABLES-ADVANCED-BORDERS', 'HTMLHEADERS-FOOTERS', 'FORMS', 'BACKGROUNDS', 'CSS-FLOAT', 'CSS-IMAGE-FLOAT', 'CSS-POSITION', 'CSS-PAGE', 'BORDER-RADIUS'
104
+ if ($excl[0]=='HTML-CSS') {
105
+ $excl[] = 'TABLES';
106
+ $excl[] = 'LISTS';
107
+ $excl[] = 'TABLES-ADVANCED-BORDERS';
108
+ $excl[] = 'HTMLHEADERS-FOOTERS';
109
+ $excl[] = 'FORMS';
110
+ $excl[] = 'BACKGROUNDS';
111
+ $excl[] = 'CSS-FLOAT';
112
+ $excl[] = 'CSS-IMAGE-FLOAT';
113
+ $excl[] = 'CSS-POSITION';
114
+ $excl[] = 'CSS-PAGE';
115
+ $excl[] = 'BORDER-RADIUS';
116
+ }
117
+ $excl = array_unique($excl);
118
+
119
+ foreach($l AS $k=>$ln) {
120
+ $exclude = false;
121
+ // *XXXXX*
122
+ preg_match_all("/\/\/ \*([A-Za-z\-]+)\*/", $ln, $m);
123
+ foreach($m[1] AS $mm) {
124
+ if (in_array($mm, $excl)) {
125
+ $exclude = true;
126
+ }
127
+ }
128
+ /*-- XXXXX --*/
129
+ preg_match_all("/\/\*-- ([A-Za-z\-]+) --\*\//", $ln, $m);
130
+ foreach($m[1] AS $mm) {
131
+ if (in_array($mm, $excl)) {
132
+ $exclflags[$mm] = true;
133
+ }
134
+ $exclude = true;
135
+ }
136
+ $exclflags = array_unique($exclflags);
137
+ /*-- END XXXX --*/
138
+ preg_match_all("/\/\*-- END ([A-Za-z\-]+) --\*\//", $ln, $m);
139
+ foreach($m[1] AS $mm) {
140
+ if (in_array($mm, $excl)) {
141
+ unset($exclflags[$mm]);
142
+ }
143
+ $exclude = true;
144
+ }
145
+ if (count($exclflags)==0 && !$exclude) {
146
+ $x .= $ln;
147
+ }
148
+ }
149
+ // mPDF 5.0
150
+ if (function_exists('file_put_contents')) {
151
+ $check = file_put_contents('mpdf.php', $x);
152
+ }
153
+ else {
154
+ $f=fopen('mpdf.php', 'w');
155
+ $check = fwrite($f, $x);
156
+ fclose($f);
157
+ }
158
+ if (!$check) { die("ERROR - Could not write to mpdf.php file. Are permissions correctly set?"); }
159
+ echo '<p><b>mPDF file generated successfully!</b></p>';
160
+ echo '<div>mPDF file size '.number_format((strlen($x)/1024)).' kB</div>';
161
+
162
+ unset($l);
163
+ unset($x);
164
+
165
+ include('mpdf.php');
166
+ $mpdf = new mPDF();
167
+
168
+ echo '<div>Memory usage on loading mPDF class '.number_format((memory_get_usage(true)/(1024*1024)),2).' MB</div>';
169
+
170
+ exit;
171
+
172
+ ?>
mPDF/config.php ADDED
@@ -0,0 +1,592 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // mPDF 5.7
4
+ // Specify whether to automatically generate bookmarks or ToC entries from h1 - h6 tags
5
+ $this->h2bookmarks = array();
6
+ $this->h2toc = array();
7
+ /* Define arrays with e.g. the tag=>ToC-level
8
+ Remember bookmark and ToC levels start at 0
9
+ (does not work inside tables)
10
+ Only the default ToC will be used if > 1 ToCs are defined for the document
11
+ H1 - H6 must be uppercase
12
+ $this->h2toc = array('H1'=>0, 'H2'=>1, 'H3'=>2);
13
+ $this->h2bookmarks = array('H1'=>0, 'H2'=>1, 'H3'=>2);
14
+ */
15
+
16
+ // mPDF 5.7
17
+ // Text-align on decimal marks
18
+ // Allowed characters for alignment on decimal marks. Additional codes must start with D
19
+ // Non-ASCII characters should be in utf-8 encoding
20
+ // DM - middot U+00B7
21
+ // DA - arabic decimal mark U+066B
22
+ $this->decimal_align = array('DP'=>'.', 'DC'=>',', 'DM'=>"\xc2\xb7", 'DA'=>"\xd9\xab", 'DD'=>'-');
23
+
24
+ // PAGING
25
+ $this->mirrorMargins = 0;
26
+ $this->restoreBlockPagebreaks = false;
27
+ $this->forcePortraitMargins = false;
28
+ $this->displayDefaultOrientation = false;
29
+ $this->printers_info = false; // Adds date and page info for printer when using @page and "marks:crop;"
30
+ $this->bleedMargin = 5;
31
+ $this->crossMarkMargin = 5; // Distance of cross mark from margin in mm
32
+ $this->cropMarkMargin = 8; // Distance of crop mark from margin in mm
33
+ $this->cropMarkLength = 18; // Default length in mm of crop line
34
+ $this->nonPrintMargin = 8; // Non-printable border at edge of paper sheet in mm
35
+ // mPDF 5.5
36
+ // Avoid just the border/background-color of the end of a block being moved on to next page
37
+ $this->margBuffer = 2; // Allows an (empty) end of block to extend beyond the bottom margin by this amount (mm)
38
+
39
+
40
+ // PAGE NUMBERING
41
+ $this->pagenumPrefix;
42
+ $this->pagenumSuffix;
43
+ $this->nbpgPrefix;
44
+ $this->nbpgSuffix;
45
+
46
+
47
+ // FONTS, LANGUAGES & CHARACTER SETS
48
+ // Set maximum size of TTF font file to allow non-subsets - in kB
49
+ // Used to avoid e.g. Arial Unicode MS (perhaps used for substitutions) to ever be fully embedded
50
+ // NB Free serif is 1.5MB, most files are <= 600kB (most 200-400KB)
51
+ $this->maxTTFFilesize = 2000;
52
+
53
+ // this value determines whether to subset or not
54
+ // 0 - 100 = percent characters
55
+ // i.e. if ==40, mPDF will embed whole font if >40% characters in that font
56
+ // or embed subset if <40% characters
57
+ // 0 will force whole file to be embedded (NO subsetting)
58
+ // 100 will force always to subset
59
+ // This value is overridden if you set new mPDF('s)
60
+ // and/or Can set at runtime
61
+ $this->percentSubset = 60;
62
+
63
+ $this->useAdobeCJK = true; // Uses Adobe CJK fonts for CJK languages
64
+ // default TRUE; only set false if you have defined some available fonts that support CJK
65
+ // If true this will not stop use of other CJK fonts if specified by font-family:
66
+ // and vice versa i.e. only dictates behaviour when specified by lang="" incl. AutoFont()
67
+
68
+ // When embedding full TTF font files, remakes the font file using only core tables
69
+ // May improve function with some PostScript printers (GhostScript/GSView)
70
+ // Does not work with TTC font collections
71
+ // Slightly smaller file; increased processing time
72
+ (defined('PDF_REPACK_FONT') && PDF_REPACK_FONT === true) ? $this->repackageTTF = true : $this->repackageTTF = false;
73
+
74
+ // Allows automatic character set conversion if "charset=xxx" detected in html header (WriteHTML() )
75
+ $this->allow_charset_conversion = true;
76
+ $this->biDirectional=false; // automatically determine BIDI text in LTR page
77
+ $this->autoFontGroupSize = 2; // 1: individual words are spanned; 2: words+; 3: as big chunks as possible.
78
+ $this->useLang = true; // Default changed in mPDF 4.0
79
+
80
+ $this->useSubstitutions = true; // Substitute missing characters in UTF-8(multibyte) documents - from other fonts
81
+ $this->falseBoldWeight = 5; // Weight for bold text when using an artificial (outline) bold; value 0 (off) - 10 (rec. max)
82
+
83
+ // CONFIGURATION
84
+ $this->allow_output_buffering = true;
85
+
86
+ $this->enableImports = true; // Adding mPDFI functions
87
+
88
+ $this->collapseBlockMargins = true; // Allows top and bottom margins to collapse between block elements
89
+ $this->progressBar = 0; // Shows progress-bars whilst generating file 0 off, 1 simple, 2 advanced
90
+ $this->progbar_heading = 'mPDF file progress';
91
+ $this->progbar_altHTML = ''; // Should include <html> and <body> but NOT end tags
92
+ // Can incude <head> and link to stylesheet etc.
93
+ // e.g. '<html><body><p><img src="loading.gif" /> Creating PDF file. Please wait...</p>';
94
+
95
+ $this->dpi = 96; // To interpret "px" pixel values in HTML/CSS (see img_dpi below)
96
+
97
+ // Automatically correct for tags where HTML specifies optional end tags e.g. P,LI,DD,TD
98
+ // If you are confident input html is valid XHTML, turning this off may make it more reliable(?)
99
+ $this->allow_html_optional_endtags = true;
100
+
101
+ $this->ignore_invalid_utf8 = true;
102
+ $this->text_input_as_HTML = false; // Converts all entities in Text inputs to UTF-8 before encoding
103
+ $this->useGraphs = false;
104
+
105
+
106
+ // When writing a block element with position:fixed and overflow:auto, mPDF scales it down to fit in the space
107
+ // by repeatedly rewriting it and making adjustments. These values give the adjustments used, depending how far out
108
+ // the previous guess was. The lower the number, the quicker it will finish, but the less accurate the fit may be.
109
+ // FPR1 is for coarse adjustments, and FPR4 for fine adjustments when it is getting closer.
110
+ $this->incrementFPR1 = 10; // i.e. will alter by 1/[10]th of width and try again until within closer limits
111
+ $this->incrementFPR2 = 20;
112
+ $this->incrementFPR3 = 30;
113
+ $this->incrementFPR4 = 50; // i.e. will alter by 1/[50]th of width and try again when it nearly fits
114
+
115
+
116
+ // COLORSPACE
117
+ // 1 - allow GRAYSCALE only [convert CMYK/RGB->gray]
118
+ // 2 - allow RGB / SPOT COLOR / Grayscale [convert CMYK->RGB]
119
+ // 3 - allow CMYK / SPOT COLOR / Grayscale [convert RGB->CMYK]
120
+ $this->restrictColorSpace = 0;
121
+
122
+ // PDFX/1-a Compliant files
123
+ $this->PDFX = false; // true=Forces compliance with PDFX-1a spec
124
+ // Cannot be used with $this->restrictColorSpace (i.e. no RGB)
125
+ $this->PDFXauto = false; // Overrides warnings making changes when possible to force PDFX1-a compliance
126
+
127
+
128
+ // PDFA1-b Compliant files
129
+ $this->PDFA = false; // true=Forces compliance with PDFA-1b spec
130
+ // Can use with $this->restrictColorSpace=3 (for a CMYK file)
131
+ // Any other settings, uses RGB profile
132
+ $this->PDFAauto = false; // Overrides warnings making changes when possible to force PDFA1-b compliance
133
+ $this->ICCProfile = ''; // Colour profile OutputIntent
134
+ // sRGB_IEC61966-2-1 (=default if blank and PDFA), or other added .icc profile
135
+ // Must be CMYK for PDFX, or appropriate type for PDFA(RGB or CMYK)
136
+
137
+
138
+
139
+ // DEBUGGING & DEVELOPERS
140
+ if(WP_DEBUG === true)
141
+ {
142
+ $this->showStats = true;
143
+ $this->debug = true;
144
+ $this->debugfonts = true; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
145
+ $this->showImageErrors = false;
146
+ $this->table_error_report = false; /* shows inaccurate error about too small a cell width when enabled */
147
+ $this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
148
+ }
149
+ else
150
+ {
151
+ $this->showStats = false;
152
+ $this->debug = false;
153
+ $this->debugfonts = false; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
154
+ $this->showImageErrors = false;
155
+ $this->table_error_report = false; // Die and report error if table is too wide to contain whole words
156
+ $this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
157
+ }
158
+
159
+
160
+ // ANNOTATIONS
161
+ $this->title2annots = false;
162
+ $this->annotSize = 0.5; // default mm for Adobe annotations - nominal
163
+ $this->annotMargin; // default position for Annotations
164
+ $this->annotOpacity = 0.5; // default opacity for Annotations
165
+
166
+ // BOOKMARKS
167
+ $this->anchor2Bookmark = 0; // makes <a name=""> into a bookmark as well as internal link target; 1 = just name; 2 = name (p.34)
168
+ // Set an optional array to specify appearance of Bookmarks (by level)
169
+ // Default values are Black and normal style
170
+ /*
171
+ Example:
172
+ $this->bookmarkStyles = array(
173
+ 0 => array('color'=> array(0,64,128), 'style'=>'B'),
174
+ 1 => array('color'=> array(128,0,0), 'style'=>''),
175
+ 2 => array('color'=> array(0,128,0), 'style'=>'I'),
176
+ );
177
+ */
178
+ $this->bookmarkStyles = array();
179
+
180
+
181
+ // CSS & STYLES
182
+ $this->CSSselectMedia='print'; // screen, print, or any other CSS @media type (not "all")
183
+
184
+
185
+ // PAGE HEADERS & FOOTERS
186
+ $this->forcePortraitHeaders = false;
187
+ // Values used if simple FOOTER/HEADER given i.e. not array
188
+ $this->defaultheaderfontsize = 8; // pt
189
+ $this->defaultheaderfontstyle = 'BI'; // '', or 'B' or 'I' or 'BI'
190
+ $this->defaultheaderline = 1; // 1 or 0 - line under the header
191
+ $this->defaultfooterfontsize = 8; // pt
192
+ $this->defaultfooterfontstyle = 'BI'; // '', or 'B' or 'I' or 'BI'
193
+ $this->defaultfooterline = 1; // 1 or 0 - line over the footer
194
+ $this->header_line_spacing = 0.25; // spacing between bottom of header and line (if present) - function of fontsize
195
+ $this->footer_line_spacing = 0.25; // spacing between bottom of header and line (if present) - function of fontsize
196
+ // If 'pad' margin-top sets fixed distance in mm (padding) between bottom of header and top of text.
197
+ // If 'stretch' margin-top sets a minimum distance in mm between top of page and top of text, which expands if header is too large to fit.
198
+ $this->setAutoTopMargin = 'stretch';
199
+ $this->setAutoBottomMargin = 'strech';
200
+ $this->autoMarginPadding = 2; // distance in mm used as padding if 'stretch' mode is used
201
+
202
+
203
+ // TABLES
204
+ (defined('PDF_ENABLE_SIMPLE_TABLES') && PDF_ENABLE_SIMPLE_TABLES === true) ? $this->simpleTables = true : $this->simpleTables = false; // Forces all cells to have same border, background etc. Improves performance
205
+ $this->packTableData = false; // Reduce memory usage processing tables (but with increased processing time)
206
+ // Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased
207
+ // executon time and disk access (read and write)
208
+ global $gfpdfe_data;
209
+
210
+ if($gfpdfe_data->can_write_pdf_temp_dir === false)
211
+ {
212
+ $this->cacheTables = false;
213
+ }
214
+ else
215
+ {
216
+ $this->cacheTables = true;
217
+ }
218
+
219
+ $this->ignore_table_percents = false;
220
+ $this->ignore_table_widths = false;
221
+ $this->keep_table_proportions = true; // If table width set > page width, force resizing but keep relative sizes
222
+ // Also forces respect of cell widths set by %
223
+ $this->shrink_tables_to_fit = 1.4; // automatically reduce fontsize in table if words would have to split ( not in CJK)
224
+ // 0 or false to disable; value (if set) gives maximum factor to reduce fontsize
225
+
226
+ $this->tableMinSizePriority = false; // If page-break-inside:avoid but cannot fit on full page without
227
+ // exceeding autosize; setting this value to true will force respsect for
228
+ // autosize, and disable the page-break-inside:avoid
229
+
230
+ $this->use_kwt = true; // "Keep-with-table"
231
+ $this->iterationCounter = false; // Set to TRUE to use table Head iteration counter
232
+ $this->splitTableBorderWidth = 0; // Use table border (using this width in mm) when table breaks across pages
233
+ // Recommended to use small value e.g. 0.01
234
+
235
+
236
+ // IMAGES
237
+ $this->img_dpi = 96; // Default dpi to output images if size not defined
238
+ // See also above "dpi"
239
+
240
+ // TEXT SPACING & JUSTIFICATION
241
+ $this->useKerning = true; // true to use kerning
242
+ $this->justifyB4br = true; // In justified text, <BR> does not cause the preceding text to be justified in browsers
243
+ // Change to true to force justification (as in MS Word)
244
+
245
+ $this->tabSpaces = 8; // Number of spaces to replace for a TAB in <pre> sections
246
+ // Notepad uses 6, HTML specification recommends 8
247
+ $this->jSWord = 0.4; // Proportion (/1) of space (when justifying margins) to allocate to Word vs. Character
248
+ $this->jSmaxChar = 2; // Maximum spacing to allocate to character spacing. (0 = no maximum)
249
+
250
+ $this->jSmaxCharLast = 1; // Maximum character spacing allowed (carried over) when finishing a last line
251
+ $this->jSmaxWordLast = 2; // Maximum word spacing allowed (carried over) when finishing a last line
252
+ $this->normalLineheight = 1.33; // Value used for line-height when CSS specified as 'normal' (default)
253
+
254
+ // Small Caps
255
+ $this->smCapsScale = 0.75; // Factor of 1 to scale capital letters
256
+ $this->smCapsStretch = 110; // % to stretch small caps horizontally (i.e. 100 = no stretch)
257
+
258
+ // CJK Line-breaking
259
+ $this->allowCJKorphans = true; // FALSE=always wrap to next line; TRUE=squeeze or overflow
260
+ $this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only some characters, and disabled in tables)
261
+ $this->CJKforceend = false; // Forces overflowng punctuation to hang outside right margin mPDF 5.6.40
262
+
263
+ // HYPHENATION
264
+ $this->SHYlang = "en"; // Should be one of: 'en','de','es','fi','fr','it','nl','pl','ru','sv'
265
+ $this->SHYleftmin = 2;
266
+ $this->SHYrightmin = 2;
267
+ $this->SHYcharmin = 2;
268
+ $this->SHYcharmax = 10;
269
+
270
+ // COLUMNS
271
+ $this->keepColumns = false; // Set to go to the second column only when the first is full of text etc.
272
+ $this->max_colH_correction = 1.15; // Maximum ratio to adjust column height when justifying - too large a value can give ugly results
273
+ $this->ColGap=5;
274
+
275
+
276
+ // LISTS
277
+ $this->list_align_style = 'R'; // Determines alignment of numbers in numbered lists
278
+ $this->list_indent_first_level = 0; // 1/0 yex/no to indent first level of list
279
+ $this->list_number_suffix = '.'; // Content to follow a numbered list marker e.g. '.' gives 1. or IV.; ')' gives 1) or a)
280
+
281
+ // ACTIVE FORMS
282
+ $this->useActiveForms = false;
283
+
284
+ // WATERMARKS
285
+ $this->watermarkImgBehind = true;
286
+ $this->showWatermarkText = 1;
287
+ $this->showWatermarkImage = 1;
288
+ $this->watermarkText = '';
289
+ $this->watermarkImage = '';
290
+ $this->watermark_font = '';
291
+ $this->watermarkTextAlpha = 0.2;
292
+ $this->watermarkImageAlpha = 0.2;
293
+ $this->watermarkImgAlphaBlend = 'Normal';
294
+ // Accepts any PDF spec. value: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn,
295
+ // HardLight, SoftLight, Difference, Exclusion
296
+ // "Multiply" works well for watermark image on top
297
+
298
+ // BORDERS
299
+ $this->autoPadding = true; // Automatically increases padding in block elements when border-radius set - if required
300
+
301
+
302
+ //////////////////////////////////////////////
303
+
304
+ // Default values if no style sheet offered (cf. http://www.w3.org/TR/CSS21/sample.html)
305
+ $this->defaultCSS = array(
306
+ 'BODY' => array(
307
+ 'FONT-FAMILY' => 'serif',
308
+ 'FONT-SIZE' => '11pt',
309
+ 'TEXT-INDENT' => '0pt',
310
+ 'LINE-HEIGHT' => 'normal',
311
+ 'MARGIN-COLLAPSE' => 'collapse', /* Custom property to collapse top/bottom margins at top/bottom of page - ignored in tables/lists */
312
+ 'HYPHENS' => 'manual', /* mPDF 5.6.08 */
313
+ ),
314
+ 'P' => array(
315
+ 'MARGIN' => '1.12em 0',
316
+ ),
317
+ 'H1' => array(
318
+ 'FONT-SIZE' => '2em',
319
+ 'FONT-WEIGHT' => 'bold',
320
+ 'MARGIN' => '0.67em 0',
321
+ 'PAGE-BREAK-AFTER' => 'avoid',
322
+ ),
323
+ 'H2' => array(
324
+ 'FONT-SIZE' => '1.5em',
325
+ 'FONT-WEIGHT' => 'bold',
326
+ 'MARGIN' => '0.75em 0',
327
+ 'PAGE-BREAK-AFTER' => 'avoid',
328
+ ),
329
+ 'H3' => array(
330
+ 'FONT-SIZE' => '1.17em',
331
+ 'FONT-WEIGHT' => 'bold',
332
+ 'MARGIN' => '0.83em 0',
333
+ 'PAGE-BREAK-AFTER' => 'avoid',
334
+ ),
335
+ 'H4' => array(
336
+ 'FONT-WEIGHT' => 'bold',
337
+ 'MARGIN' => '1.12em 0',
338
+ 'PAGE-BREAK-AFTER' => 'avoid',
339
+ ),
340
+ 'H5' => array(
341
+ 'FONT-SIZE' => '0.83em',
342
+ 'FONT-WEIGHT' => 'bold',
343
+ 'MARGIN' => '1.5em 0',
344
+ 'PAGE-BREAK-AFTER' => 'avoid',
345
+ ),
346
+ 'H6' => array(
347
+ 'FONT-SIZE' => '0.75em',
348
+ 'FONT-WEIGHT' => 'bold',
349
+ 'MARGIN' => '1.67em 0',
350
+ 'PAGE-BREAK-AFTER' => 'avoid',
351
+ ),
352
+ 'HR' => array(
353
+ 'COLOR' => '#888888',
354
+ 'TEXT-ALIGN' => 'center',
355
+ 'WIDTH' => '100%',
356
+ 'HEIGHT' => '0.2mm',
357
+ 'MARGIN-TOP' => '0.83em',
358
+ 'MARGIN-BOTTOM' => '0.83em',
359
+ ),
360
+ 'PRE' => array(
361
+ 'MARGIN' => '0.83em 0',
362
+ 'FONT-FAMILY' => 'monospace',
363
+ ),
364
+ 'S' => array(
365
+ 'TEXT-DECORATION' => 'line-through',
366
+ ),
367
+ 'STRIKE' => array(
368
+ 'TEXT-DECORATION' => 'line-through',
369
+ ),
370
+ 'DEL' => array(
371
+ 'TEXT-DECORATION' => 'line-through',
372
+ ),
373
+ 'SUB' => array(
374
+ 'VERTICAL-ALIGN' => 'sub',
375
+ 'FONT-SIZE' => '55%', /* Recommended 0.83em */
376
+ ),
377
+ 'SUP' => array(
378
+ 'VERTICAL-ALIGN' => 'super',
379
+ 'FONT-SIZE' => '55%', /* Recommended 0.83em */
380
+ ),
381
+ 'U' => array(
382
+ 'TEXT-DECORATION' => 'underline',
383
+ ),
384
+ 'INS' => array(
385
+ 'TEXT-DECORATION' => 'underline',
386
+ ),
387
+ 'B' => array(
388
+ 'FONT-WEIGHT' => 'bold',
389
+ ),
390
+ 'STRONG' => array(
391
+ 'FONT-WEIGHT' => 'bold',
392
+ ),
393
+ 'I' => array(
394
+ 'FONT-STYLE' => 'italic',
395
+ ),
396
+ 'CITE' => array(
397
+ 'FONT-STYLE' => 'italic',
398
+ ),
399
+ 'Q' => array(
400
+ 'FONT-STYLE' => 'italic',
401
+ ),
402
+ 'EM' => array(
403
+ 'FONT-STYLE' => 'italic',
404
+ ),
405
+ 'VAR' => array(
406
+ 'FONT-STYLE' => 'italic',
407
+ ),
408
+ 'SAMP' => array(
409
+ 'FONT-FAMILY' => 'monospace',
410
+ ),
411
+ 'CODE' => array(
412
+ 'FONT-FAMILY' => 'monospace',
413
+ ),
414
+ 'KBD' => array(
415
+ 'FONT-FAMILY' => 'monospace',
416
+ ),
417
+ 'TT' => array(
418
+ 'FONT-FAMILY' => 'monospace',
419
+ ),
420
+ 'SMALL' => array(
421
+ 'FONT-SIZE' => '83%',
422
+ ),
423
+ 'BIG' => array(
424
+ 'FONT-SIZE' => '117%',
425
+ ),
426
+ 'ACRONYM' => array(
427
+ 'FONT-SIZE' => '77%',
428
+ 'FONT-WEIGHT' => 'bold',
429
+ ),
430
+ 'ADDRESS' => array(
431
+ 'FONT-STYLE' => 'italic',
432
+ ),
433
+ 'BLOCKQUOTE' => array(
434
+ 'MARGIN-LEFT' => '40px',
435
+ 'MARGIN-RIGHT' => '40px',
436
+ 'MARGIN-TOP' => '1.12em',
437
+ 'MARGIN-BOTTOM' => '1.12em',
438
+ ),
439
+ 'A' => array(
440
+ 'COLOR' => '#0000FF',
441
+ 'TEXT-DECORATION' => 'underline',
442
+ ),
443
+ 'UL' => array(
444
+ 'MARGIN' => '0.83em 0', /* only applied to top-level of nested lists */
445
+ 'TEXT-INDENT' => '1.3em', /* Custom effect - list indent */
446
+ ),
447
+ 'OL' => array(
448
+ 'MARGIN' => '0.83em 0', /* only applied to top-level of nested lists */
449
+ 'TEXT-INDENT' => '1.3em', /* Custom effect - list indent */
450
+ ),
451
+ 'DL' => array(
452
+ 'MARGIN' => '1.67em 0',
453
+ ),
454
+ 'DT' => array(
455
+ ),
456
+ 'DD' => array(
457
+ 'PADDING-LEFT' => '40px',
458
+ ),
459
+ 'TABLE' => array(
460
+ 'MARGIN' => '0',
461
+ 'BORDER-COLLAPSE' => 'separate',
462
+ 'BORDER-SPACING' => '2px',
463
+ 'EMPTY-CELLS' => 'show',
464
+ 'LINE-HEIGHT' => '1.2',
465
+ 'VERTICAL-ALIGN' => 'middle',
466
+ ),
467
+ 'THEAD' => array(
468
+ ),
469
+ 'TFOOT' => array(
470
+ ),
471
+ 'TH' => array(
472
+ 'FONT-WEIGHT' => 'bold',
473
+ 'TEXT-ALIGN' => 'center',
474
+ 'PADDING-LEFT' => '0.1em',
475
+ 'PADDING-RIGHT' => '0.1em',
476
+ 'PADDING-TOP' => '0.1em',
477
+ 'PADDING-BOTTOM' => '0.1em',
478
+ ),
479
+ 'TD' => array(
480
+ 'PADDING-LEFT' => '0.1em',
481
+ 'PADDING-RIGHT' => '0.1em',
482
+ 'PADDING-TOP' => '0.1em',
483
+ 'PADDING-BOTTOM' => '0.1em',
484
+ ),
485
+ 'CAPTION' => array(
486
+ 'TEXT-ALIGN' => 'center',
487
+ ),
488
+ 'IMG' => array(
489
+ 'MARGIN' => '0',
490
+ 'VERTICAL-ALIGN' => 'baseline',
491
+ ),
492
+ 'INPUT' => array(
493
+ 'FONT-FAMILY' => 'sans-serif',
494
+ 'VERTICAL-ALIGN' => 'middle',
495
+ 'FONT-SIZE' => '0.9em',
496
+ ),
497
+ 'SELECT' => array(
498
+ 'FONT-FAMILY' => 'sans-serif',
499
+ 'FONT-SIZE' => '0.9em',
500
+ 'VERTICAL-ALIGN' => 'middle',
501
+ ),
502
+ 'TEXTAREA' => array(
503
+ 'FONT-FAMILY' => 'monospace',
504
+ 'FONT-SIZE' => '0.9em',
505
+ 'VERTICAL-ALIGN' => 'text-bottom',
506
+ ),
507
+ 'MARK' => array( /* mPDF 5.5.09 */
508
+ 'BACKGROUND-COLOR' => 'yellow',
509
+ ),
510
+ );
511
+
512
+
513
+ //////////////////////////////////////////////////
514
+ // VALUES ONLY LIKELY TO BE CHANGED BY DEVELOPERS
515
+ //////////////////////////////////////////////////
516
+ $this->pdf_version = '1.4';
517
+
518
+ // Hyphenation
519
+ $this->SHYlanguages = array('en','de','es','fi','fr','it','nl','pl','ru','sv'); // existing defined patterns
520
+
521
+ $this->default_lineheight_correction=1.2; // Value 1 sets lineheight=fontsize height;
522
+ // Value used if line-height not set by CSS (usuallly is)
523
+
524
+ $this->fontsizes = array('XX-SMALL'=>0.7, 'X-SMALL'=>0.77, 'SMALL'=>0.86, 'MEDIUM'=>1, 'LARGE'=>1.2, 'X-LARGE'=>1.5, 'XX-LARGE'=>2);
525
+
526
+ // CHARACTER PATTERN MATCHES TO DETECT LANGUAGES
527
+ // pattern used to detect RTL characters -> force RTL
528
+ $this->pregRTLchars = "\x{0590}-\x{06FF}\x{0700}-\x{083E}\x{FB00}-\x{FDFD}\x{FE70}-\x{FEFF}";
529
+
530
+ // CJK Chars which require changing and are distinctive of specific charset
531
+ $this->pregUHCchars = "\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}";
532
+ $this->pregSJISchars = "\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3190}-\x{319F}\x{31F0}-\x{31FF}";
533
+
534
+ // Chars which distinguish CJK but not between different
535
+ $this->pregCJKchars = "\x{1100}-\x{11FF}\x{2E80}-\x{A4CF}\x{A800}-\x{D7AF}\x{F900}-\x{FAFF}\x{FE30}-\x{FE6F}\x{FF00}-\x{FFEF}\x{20000}-\x{2FA1F}";
536
+
537
+ // For CJK Line-breaking
538
+ //Leading characters - Not allowed at end of line
539
+ $this->CJKleading = "\$\(\*\[\{\x{00a3}\x{00a5}\x{00ab}\x{00b7}\x{2018}\x{201c}\x{2035}\x{3005}\x{3007}\x{3008}\x{300a}\x{300c}\x{300e}\x{3010}\x{3014}\x{3016}\x{3018}\x{301d}\x{fe34}\x{fe57}\x{fe59}\x{fe5b}\x{ff04}\x{ff08}\x{ff0e}\x{ff3b}\x{ff5b}\x{ff5f}\x{ffe1}\x{ffe5}\x{ffe6}";
540
+ // Following characters - Not allowed at start
541
+ $this->CJKfollowing = "!%\),\.:;>\?\]\}\x{00a2}\x{00a8}\x{00b0}\x{00b7}\x{00bb}\x{02c7}\x{02c9}\x{2010}\x{2013}-\x{2016}\x{2019}\x{201d}-\x{201f}\x{2020}-\x{2022}\x{2025}\x{2027}\x{203a}\x{203c}\x{2047}-\x{2049}\x{2103}\x{2236}\x{2574}\x{3001}-\x{3003}\x{3005}\x{3006}\x{3009}\x{300b}\x{300d}\x{300f}\x{3011}\x{3015}\x{3017}\x{3019}\x{301c}\x{301e}\x{301f}\x{303b}\x{3041}\x{3043}\x{3045}\x{3047}\x{3049}\x{3063}\x{3083}\x{3085}\x{3087}\x{308e}\x{3095}\x{3096}\x{30a0}\x{30a1}\x{30a3}\x{30a5}\x{30a7}\x{30a9}\x{30c3}\x{30e3}\x{30e5}\x{30e7}\x{30ee}\x{30f5}\x{30f6}\x{30fb}-\x{30fe}\x{31f0}-\x{31ff}\x{fe30}-\x{fe33}\x{fe50}-\x{fe56}\x{fe58}\x{fe5a}\x{fe5c}\x{ff01}\x{ff02}\x{ff05}\x{ff07}\x{ff09}\x{ff0c}\x{ff0e}\x{ff1a}\x{ff1b}\x{ff1f}\x{ff3d}\x{ff40}\x{ff5c}-\x{ff5e}\x{ff60}\x{ff64}";
542
+ // Characters which are allowed to overflow the right margin
543
+ $this->CJKoverflow = "\.,\x{ff61}\x{ff64}\x{3001}\x{3002}\x{ff0c}\x{ff0e}";
544
+
545
+
546
+
547
+ // ASCII Chars which shouldn't break string
548
+ // Use for very specific words
549
+ $this->pregASCIIchars1 = "\x{0021}-\x{002E}\x{0030}-\x{003B}?"; // no [SPACE]
550
+ // Use for words+
551
+ $this->pregASCIIchars2 = "\x{0020}-\x{002E}\x{0030}-\x{003B}?"; // [SPACE] punctuation and 0-9
552
+ // Use for chunks > words
553
+ $this->pregASCIIchars3 = "\x{0000}-\x{002E}\x{0030}-\x{003B}\x{003F}-\x{007E}"; // all except <>
554
+ // Vietnamese - specific
555
+ $this->pregVIETchars = "\x{01A0}\x{01A1}\x{01AF}\x{01B0}\x{1EA0}-\x{1EF1}";
556
+ // Vietnamese - Chars which shouldn't break string
557
+ $this->pregVIETPluschars = "\x{0000}-\x{003B}\x{003F}-\x{00FF}\x{0300}-\x{036F}\x{0102}\x{0103}\x{0110}\x{0111}\x{0128}\x{0129}\x{0168}\x{0169}\x{1EF1}-\x{1EF9}"; // omits < >
558
+
559
+ // Arabic
560
+ $this->pregARABICchars = "\x{0600}-\x{06FF}\x{0750}-\x{077F}\x{FB50}-\x{FDFD}\x{FE70}-\x{FEFF}";
561
+ // Characters of Urdu, Pashto, Sindhi (but NOT arabic or persian/farsi) [not covered by DejavuSans font]
562
+ $this->pregNonARABICchars = "\x{0671}-\x{067D}\x{067F}-\x{0685}\x{0687}-\x{0697}\x{0699}-\x{06A8}\x{06AA}-\x{06AE}\x{06B0}-\x{06CB}\x{06CD}-\x{06D3}";
563
+
564
+ $this->pregHEBchars = "\x{0590}-\x{05FF}\x{FB00}-\x{FB49}"; // Hebrew
565
+
566
+ // INDIC
567
+ $this->pregHIchars = "\x{0900}-\x{0963}\x{0966}-\x{097F}"; // Devanagari (Hindi) minus the common indic punctuation 0964,0965
568
+ $this->pregBNchars = "\x{0980}-\x{09FF}"; // Bengali
569
+ $this->pregPAchars = "\x{0A00}-\x{0A7F}"; // Gurmukhi (Punjabi)
570
+ $this->pregGUchars = "\x{0A80}-\x{0AFF}"; // Gujarati
571
+ $this->pregORchars = "\x{0B00}-\x{0B7F}"; // Oriya
572
+ $this->pregTAchars = "\x{0B80}-\x{0BFF}"; // Tamil
573
+ $this->pregTEchars = "\x{0C00}-\x{0C7F}"; // Telugu
574
+ $this->pregKNchars = "\x{0C80}-\x{0CFF}"; // Kannada
575
+ $this->pregMLchars = "\x{0D00}-\x{0D7F}"; // Malayalam
576
+ $this->pregSHchars = "\x{0D80}-\x{0DFF}"; // Sinhala
577
+
578
+ $this->pregINDextra = "\x{200B}-\x{200D}\x{0964}\x{0965}\x{0020}-\x{0022}\x{0024}-\x{002E}\x{003A}-\x{003F}\x{005B}-\x{0060}\x{007B}-\x{007E}\x{00A0}";
579
+ // 200B-D=Zero-width joiners; 0964,0965=Generic Indic punctuation; NBSP & general punctuation (excludes # and / so can use in autoFont() )
580
+
581
+ $this->allowedCSStags = 'DIV|P|H1|H2|H3|H4|H5|H6|FORM|IMG|A|BODY|TABLE|HR|THEAD|TFOOT|TBODY|TH|TR|TD|UL|OL|LI|PRE|BLOCKQUOTE|ADDRESS|DL|DT|DD';
582
+ $this->allowedCSStags .= '|ARTICLE|ASIDE|FIGURE|FIGCAPTION|FOOTER|HEADER|HGROUP|NAV|SECTION|MARK|DETAILS|SUMMARY|METER|PROGRESS|TIME'; // mPDF 5.5.09
583
+ $this->allowedCSStags .= '|SPAN|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|STRIKE|S|U|DEL|INS|Q|FONT';
584
+ $this->allowedCSStags .= '|SELECT|INPUT|TEXTAREA|CAPTION|FIELDSET|LEGEND'; // mPDF 5.4.18
585
+ $this->allowedCSStags .= '|TEXTCIRCLE|DOTTAB'; // mPDF 5.5.23 // mPDF 5.6.33
586
+
587
+ $this->outerblocktags = array('DIV','FORM','CENTER','DL','FIELDSET','ARTICLE','ASIDE','FIGURE','FIGCAPTION', 'FOOTER','HEADER','HGROUP','NAV','SECTION','DETAILS','SUMMARY'); // mPDF 5.5.09 // mPDF 5.5.22
588
+ $this->innerblocktags = array('P','BLOCKQUOTE','ADDRESS','PRE','H1','H2','H3','H4','H5','H6','DT','DD','CAPTION');
589
+
590
+
591
+
592
+ ?>
mPDF/config_cp.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ function GetLangOpts($llcc, $adobeCJK) {
5
+ if (strlen($llcc) == 5) {
6
+ $lang = substr(strtolower($llcc),0,2);
7
+ $country = substr(strtoupper($llcc),3,2);
8
+ }
9
+ else { $lang = strtolower($llcc); $country = ''; }
10
+ $unifonts = "";
11
+ $coreSuitable = false;
12
+
13
+ switch($lang){
14
+ CASE "en":
15
+ CASE "ca":
16
+ CASE "cy":
17
+ CASE "da":
18
+ CASE "de":
19
+ CASE "es":
20
+ CASE "eu":
21
+ CASE "fr":
22
+ CASE "ga":
23
+ CASE "fi":
24
+ CASE "is":
25
+ CASE "it":
26
+ CASE "nl":
27
+ CASE "no":
28
+ CASE "pt":
29
+ CASE "sv":
30
+ // Edit this value to define how mPDF behaves when using new mPDF('-x')
31
+ // If set to TRUE, mPDF will use Adobe core fonts only when it recognises the languages above
32
+ $coreSuitable = true; break;
33
+
34
+
35
+
36
+ // RTL Languages
37
+ CASE "he":
38
+ CASE "yi":
39
+ $unifonts = "dejavusans,dejavusansB,dejavusansI,dejavusansBI"; break;
40
+
41
+ // Arabic
42
+ CASE "ar":
43
+ $unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
44
+ CASE "fa":
45
+ $unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
46
+ CASE "ps":
47
+ $unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
48
+ CASE "ur":
49
+ $unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
50
+
51
+ // Sindhi (can be Arabic or Devanagari)
52
+ CASE "sd":
53
+ if ($country == "IN") { $unifonts = "ind_hi_1_001"; }
54
+ // else if ($country == "PK") { $unifonts = ""; }
55
+ // else { $unifonts = ""; }
56
+ break;
57
+
58
+
59
+ // INDIC
60
+ // Assamese
61
+ CASE "as": $unifonts = "ind_bn_1_001"; break;
62
+ // Bengali
63
+ CASE "bn": $unifonts = "ind_bn_1_001"; break;
64
+ // Gujarati
65
+ CASE "gu": $unifonts = "ind_gu_1_001"; break;
66
+ // Hindi (Devanagari)
67
+ CASE "hi": $unifonts = "ind_hi_1_001"; break;
68
+ // Kannada
69
+ CASE "kn": $unifonts = "ind_kn_1_001"; break;
70
+ // Kashmiri
71
+ CASE "ks": $unifonts = "ind_hi_1_001"; break;
72
+ // Malayalam
73
+ CASE "ml": $unifonts = "ind_ml_1_001"; break;
74
+ // Nepali (Devanagari)
75
+ CASE "ne": $unifonts = "ind_hi_1_001"; break;
76
+ // Oriya
77
+ CASE "or": $unifonts = "ind_or_1_001"; break;
78
+ // Punjabi (Gurmukhi)
79
+ CASE "pa": $unifonts = "ind_pa_1_001"; break;
80
+ // Tamil
81
+ CASE "ta": $unifonts = "ind_ta_1_001"; break;
82
+ // Telegu
83
+ CASE "te": $unifonts = "ind_te_1_001"; break;
84
+
85
+ // THAI
86
+ CASE "th": $unifonts = "garuda,garudaB,garudaI,garudaBI,norasi,norasiB,norasiI,norasiBI"; break;
87
+
88
+ // VIETNAMESE
89
+ CASE "vi":
90
+ $unifonts = "dejavusanscondensed,dejavusanscondensedB,dejavusanscondensedI,dejavusanscondensedBI,dejavusans,dejavusansB,dejavusansI,dejavusansBI"; break;
91
+
92
+ // CJK Langauges
93
+ CASE "ja":
94
+ if ($adobeCJK) {
95
+ $unifonts = "sjis,sjisB,sjisI,sjisBI";
96
+ }
97
+ /* Uncomment these lines if CJK fonts available */
98
+ else {
99
+ $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
100
+ }
101
+ break;
102
+
103
+ CASE "ko":
104
+ if ($adobeCJK) {
105
+ $unifonts = "uhc,uhcB,uhcI,uhcBI";
106
+ }
107
+ /* Uncomment these lines if CJK fonts available */
108
+ else {
109
+ $unifonts = "unbatang_0613";
110
+ }
111
+ break;
112
+
113
+ CASE "zh":
114
+ if ($country == "HK" || $country == "TW") {
115
+ if ($adobeCJK) {
116
+ $unifonts = "big5,big5B,big5I,big5BI";
117
+ }
118
+ /* Uncomment these lines if CJK fonts available */
119
+ else {
120
+ $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
121
+ }
122
+ }
123
+ else if ($country == "CN") {
124
+ if ($adobeCJK) {
125
+ $unifonts = "gb,gbB,gbI,gbBI";
126
+ }
127
+ /* Uncomment these lines if CJK fonts available */
128
+ else {
129
+ $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
130
+ }
131
+ }
132
+ else {
133
+ if ($adobeCJK) {
134
+ $unifonts = "gb,gbB,gbI,gbBI";
135
+ }
136
+ /* Uncomment these lines if CJK fonts available */
137
+ else {
138
+ $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
139
+ }
140
+ }
141
+ break;
142
+
143
+ }
144
+
145
+
146
+ $unifonts_arr = array();
147
+ if ($unifonts) {
148
+ $unifonts_arr = preg_split('/\s*,\s*/',$unifonts);
149
+ }
150
+ return array($coreSuitable ,$unifonts_arr);
151
+ }
152
+
153
+ ?>
mPDF/config_fonts.php ADDED
@@ -0,0 +1,313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ // Optionally define a folder which contains TTF fonts
5
+ // mPDF will look here before looking in the usual _MPDF_TTFONTPATH
6
+ // Useful if you already have a folder for your fonts
7
+ // e.g. on Windows: define("_MPDF_SYSTEM_TTFONTS", 'C:/Windows/Fonts/');
8
+ // Leave undefined if not required
9
+
10
+ // define("_MPDF_SYSTEM_TTFONTS", '');
11
+
12
+
13
+ // Optionally set font(s) (names as defined below in $this->fontdata) to use for missing characters
14
+ // when using useSubstitutions. Use a font with wide coverage - dejavusanscondensed is a good start
15
+ // only works using subsets (otherwise would add very large file)
16
+ // doesn't do Indic or arabic
17
+ // More than 1 font can be specified but each will add to the processing time of the script
18
+
19
+ $this->backupSubsFont = array('dejavusanscondensed');
20
+
21
+
22
+ // Optionally set a font (name as defined below in $this->fontdata) to use for CJK characters
23
+ // in Plane 2 Unicode (> U+20000) when using useSubstitutions.
24
+ // Use a font like hannomb or sun-extb if available
25
+ // only works using subsets (otherwise would add very large file)
26
+ // Leave undefined or blank if not not required
27
+
28
+ // $this->backupSIPFont = 'sun-extb';
29
+
30
+
31
+ /*
32
+ This array defines translations from font-family in CSS or HTML
33
+ to the internal font-family name used in mPDF.
34
+ Can include as many as want, regardless of which fonts are installed.
35
+ By default mPDF will take a CSS/HTML font-family and remove spaces
36
+ and change to lowercase e.g. "Arial Unicode MS" will be recognised as
37
+ "arialunicodems"
38
+ You only need to define additional translations.
39
+ You can also use it to define specific substitutions e.g.
40
+ 'frutiger55roman' => 'arial'
41
+ Generic substitutions (i.e. to a sans-serif or serif font) are set
42
+ by including the font-family in $this->sans_fonts below
43
+ To aid backwards compatability some are included:
44
+ */
45
+ $this->fonttrans = array(
46
+ 'helvetica' => 'arial',
47
+ 'times' => 'timesnewroman',
48
+ 'courier' => 'couriernew',
49
+ 'trebuchet' => 'trebuchetms',
50
+ 'comic' => 'comicsansms',
51
+ 'franklin' => 'franklingothicbook',
52
+ 'albertus' => 'albertusmedium',
53
+ 'arialuni' => 'arialunicodems',
54
+ 'zn_hannom_a' => 'hannoma',
55
+ 'ocr-b' => 'ocrb',
56
+ 'ocr-b10bt' => 'ocrb',
57
+
58
+
59
+ );
60
+
61
+ /*
62
+ This array lists the file names of the TrueType .ttf or .otf font files
63
+ for each variant of the (internal mPDF) font-family name.
64
+ ['R'] = Regular (Normal), others are Bold, Italic, and Bold-Italic
65
+ Each entry must contain an ['R'] entry, but others are optional.
66
+ Only the font (files) entered here will be available to use in mPDF.
67
+ Put preferred default first in order.
68
+ This will be used if a named font cannot be found in any of
69
+ $this->sans_fonts, $this->serif_fonts or $this->mono_fonts
70
+
71
+ ['indic'] = true; for special mPDF fonts containing Indic characters
72
+ ['sip-ext'] = 'hannomb'; name a related font file containing SIP characters
73
+
74
+ If a .ttc TrueType collection file is referenced, the number of the font
75
+ within the collection is required. Fonts in the collection are numbered
76
+ starting at 1, as they appear in the .ttc file e.g.
77
+ "cambria" => array(
78
+ 'R' => "cambria.ttc",
79
+ 'B' => "cambriab.ttf",
80
+ 'I' => "cambriai.ttf",
81
+ 'BI' => "cambriaz.ttf",
82
+ 'TTCfontID' => array(
83
+ 'R' => 1,
84
+ ),
85
+ ),
86
+ "cambriamath" => array(
87
+ 'R' => "cambria.ttc",
88
+ 'TTCfontID' => array(
89
+ 'R' => 2,
90
+ ),
91
+ ),
92
+ */
93
+
94
+ $this->fontdata = array(
95
+ "dejavusanscondensed" => array(
96
+ 'R' => "DejaVuSansCondensed.ttf",
97
+ 'B' => "DejaVuSansCondensed-Bold.ttf",
98
+ 'I' => "DejaVuSansCondensed-Oblique.ttf",
99
+ 'BI' => "DejaVuSansCondensed-BoldOblique.ttf",
100
+ ),
101
+ "dejavusans" => array(
102
+ 'R' => "DejaVuSans.ttf",
103
+ 'B' => "DejaVuSans-Bold.ttf",
104
+ 'I' => "DejaVuSans-Oblique.ttf",
105
+ 'BI' => "DejaVuSans-BoldOblique.ttf",
106
+ ),
107
+ "dejavuserif" => array(
108
+ 'R' => "DejaVuSerif.ttf",
109
+ 'B' => "DejaVuSerif-Bold.ttf",
110
+ 'I' => "DejaVuSerif-Italic.ttf",
111
+ 'BI' => "DejaVuSerif-BoldItalic.ttf",
112
+ ),
113
+ "dejavuserifcondensed" => array(
114
+ 'R' => "DejaVuSerifCondensed.ttf",
115
+ 'B' => "DejaVuSerifCondensed-Bold.ttf",
116
+ 'I' => "DejaVuSerifCondensed-Italic.ttf",
117
+ 'BI' => "DejaVuSerifCondensed-BoldItalic.ttf",
118
+ ),
119
+ "dejavusansmono" => array(
120
+ 'R' => "DejaVuSansMono.ttf",
121
+ 'B' => "DejaVuSansMono-Bold.ttf",
122
+ 'I' => "DejaVuSansMono-Oblique.ttf",
123
+ 'BI' => "DejaVuSansMono-BoldOblique.ttf",
124
+ ),
125
+
126
+
127
+ /* OCR-B font for Barcodes */
128
+ "ocrb" => array(
129
+ 'R' => "ocrb10.ttf",
130
+ ),
131
+
132
+ /* Thai fonts */
133
+ "garuda" => array(
134
+ 'R' => "Garuda.ttf",
135
+ 'B' => "Garuda-Bold.ttf",
136
+ 'I' => "Garuda-Oblique.ttf",
137
+ 'BI' => "Garuda-BoldOblique.ttf",
138
+ ),
139
+ "norasi" => array(
140
+ 'R' => "Norasi.ttf",
141
+ 'B' => "Norasi-Bold.ttf",
142
+ 'I' => "Norasi-Oblique.ttf",
143
+ 'BI' => "Norasi-BoldOblique.ttf",
144
+ ),
145
+
146
+
147
+ /* Indic fonts */
148
+ "ind_bn_1_001" => array(
149
+ 'R' => "ind_bn_1_001.ttf",
150
+ 'indic' => true,
151
+ ),
152
+ "ind_hi_1_001" => array(
153
+ 'R' => "ind_hi_1_001.ttf",
154
+ 'indic' => true,
155
+ ),
156
+ "ind_ml_1_001" => array(
157
+ 'R' => "ind_ml_1_001.ttf",
158
+ 'indic' => true,
159
+ ),
160
+ "ind_kn_1_001" => array(
161
+ 'R' => "ind_kn_1_001.ttf",
162
+ 'indic' => true,
163
+ ),
164
+ "ind_gu_1_001" => array(
165
+ 'R' => "ind_gu_1_001.ttf",
166
+ 'indic' => true,
167
+ ),
168
+ "ind_or_1_001" => array(
169
+ 'R' => "ind_or_1_001.ttf",
170
+ 'indic' => true,
171
+ ),
172
+ "ind_ta_1_001" => array(
173
+ 'R' => "ind_ta_1_001.ttf",
174
+ 'indic' => true,
175
+ ),
176
+ "ind_te_1_001" => array(
177
+ 'R' => "ind_te_1_001.ttf",
178
+ 'indic' => true,
179
+ ),
180
+ "ind_pa_1_001" => array(
181
+ 'R' => "ind_pa_1_001.ttf",
182
+ 'indic' => true,
183
+ ),
184
+
185
+
186
+ /* XW Zar Arabic fonts */
187
+ "xbriyaz" => array(
188
+ 'R' => "XB Riyaz.ttf",
189
+ 'B' => "XB RiyazBd.ttf",
190
+ 'I' => "XB RiyazIt.ttf",
191
+ 'BI' => "XB RiyazBdIt.ttf",
192
+ 'unAGlyphs' => true,
193
+ ),
194
+ "xbzar" => array(
195
+ 'R' => "XB Zar.ttf",
196
+ 'B' => "XB Zar Bd.ttf",
197
+ 'I' => "XB Zar It.ttf",
198
+ 'BI' => "XB Zar BdIt.ttf",
199
+ 'unAGlyphs' => true,
200
+ ),
201
+
202
+
203
+
204
+
205
+ /* Examples of some CJK fonts */
206
+ /*
207
+ "unbatang_0613" => array(
208
+ 'R' => "UnBatang_0613.ttf",
209
+ ),
210
+ "sun-exta" => array(
211
+ 'R' => "Sun-ExtA.ttf",
212
+ 'sip-ext' => 'sun-extb',
213
+ ),
214
+ "sun-extb" => array(
215
+ 'R' => "Sun-ExtB.ttf",
216
+ ),
217
+ "hannoma" => array(
218
+ 'R' => "HAN NOM A.ttf",
219
+ 'sip-ext' => 'hannomb',
220
+ ),
221
+ "hannomb" => array(
222
+ 'R' => "HAN NOM B.ttf",
223
+ ),
224
+
225
+
226
+ 'mingliu' => array (
227
+ 'R' => 'mingliu.ttc',
228
+ 'TTCfontID' => array (
229
+ 'R' => 1,
230
+ ),
231
+ 'sip-ext' => 'mingliu-extb',
232
+ ),
233
+ 'pmingliu' => array (
234
+ 'R' => 'mingliu.ttc',
235
+ 'TTCfontID' => array (
236
+ 'R' => 2,
237
+ ),
238
+ 'sip-ext' => 'pmingliu-extb',
239
+ ),
240
+ 'mingliu_hkscs' => array (
241
+ 'R' => 'mingliu.ttc',
242
+ 'TTCfontID' => array (
243
+ 'R' => 3,
244
+ ),
245
+ 'sip-ext' => 'mingliu_hkscs-extb',
246
+ ),
247
+ 'mingliu-extb' => array (
248
+ 'R' => 'mingliub.ttc',
249
+ 'TTCfontID' => array (
250
+ 'R' => 1,
251
+ ),
252
+ ),
253
+ 'pmingliu-extb' => array (
254
+ 'R' => 'mingliub.ttc',
255
+ 'TTCfontID' => array (
256
+ 'R' => 2,
257
+ ),
258
+ ),
259
+ 'mingliu_hkscs-extb' => array (
260
+ 'R' => 'mingliub.ttc',
261
+ 'TTCfontID' => array (
262
+ 'R' => 3,
263
+ ),
264
+ ),
265
+ */
266
+
267
+ );
268
+
269
+ /*
270
+ * Blue Liquid Designs Edit
271
+ * Include the font configuration file defined by the plugin
272
+ */
273
+ if(file_exists(PDF_TEMPLATE_LOCATION.'fonts/config.php'))
274
+ {
275
+ include PDF_TEMPLATE_LOCATION.'fonts/config.php';
276
+ }
277
+
278
+
279
+ // Add fonts to this array if they contain characters in the SIP or SMP Unicode planes
280
+ // but you do not require them. This allows a more efficient form of subsetting to be used.
281
+ $this->BMPonly = array(
282
+ "dejavusanscondensed",
283
+ "dejavusans",
284
+ "dejavuserifcondensed",
285
+ "dejavuserif",
286
+ "dejavusansmono",
287
+ );
288
+
289
+ // These next 3 arrays do two things:
290
+ // 1. If a font referred to in HTML/CSS is not available to mPDF, these arrays will determine whether
291
+ // a serif/sans-serif or monospace font is substituted
292
+ // 2. The first font in each array will be the font which is substituted in circumstances as above
293
+ // (Otherwise the order is irrelevant)
294
+ // Use the mPDF font-family names i.e. lowercase and no spaces (after any translations in $fonttrans)
295
+ // Always include "sans-serif", "serif" and "monospace" etc.
296
+ $this->sans_fonts = array('dejavusanscondensed','dejavusans','freesans','liberationsans','sans','sans-serif','cursive','fantasy',
297
+ 'arial','helvetica','verdana','geneva','lucida','arialnarrow','arialblack','arialunicodems',
298
+ 'franklin','franklingothicbook','tahoma','garuda','calibri','trebuchet','lucidagrande','microsoftsansserif',
299
+ 'trebuchetms','lucidasansunicode','franklingothicmedium','albertusmedium','xbriyaz','albasuper','quillscript'
300
+
301
+ );
302
+
303
+ $this->serif_fonts = array('dejavuserifcondensed','dejavuserif','freeserif','liberationserif','serif',
304
+ 'timesnewroman','times','centuryschoolbookl','palatinolinotype','centurygothic',
305
+ 'bookmanoldstyle','bookantiqua','cyberbit','cambria',
306
+ 'norasi','charis','palatino','constantia','georgia','albertus','xbzar','algerian','garamond',
307
+ );
308
+
309
+ $this->mono_fonts = array('dejavusansmono','freemono','liberationmono','courier', 'mono','monospace','ocrb','ocr-b','lucidaconsole',
310
+ 'couriernew','monotypecorsiva'
311
+ );
312
+
313
+ ?>
mPDF/font/ccourier.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ for($i=0;$i<=255;$i++)
3
+ $cw[chr($i)]=600;
4
+
5
+ $desc=array('Ascent'=>629,'Descent'=>-157,'CapHeight'=>562,'FontBBox'=>'[-23 -250 715 805]');
6
+ $up=-100;
7
+ $ut=50;
8
+
9
+ ?>
mPDF/font/ccourierb.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ for($i=0;$i<=255;$i++)
3
+ $cw[chr($i)]=600;
4
+ $desc=array('Ascent'=>629,'Descent'=>-157,'CapHeight'=>562,'FontBBox'=>'[-113 -250 749 801]');
5
+ $up=-100;
6
+ $ut=50;
7
+
8
+
9
+ ?>
mPDF/font/ccourierbi.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ for($i=0;$i<=255;$i++)
3
+ $cw[chr($i)]=600;
4
+ $desc=array('Ascent'=>629,'Descent'=>-157,'CapHeight'=>562,'FontBBox'=>'[-57 -250 869 801]');
5
+ $up=-100;
6
+ $ut=50;
7
+
8
+
9
+ ?>
mPDF/font/ccourieri.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ for($i=0;$i<=255;$i++)
3
+ $cw[chr($i)]=600;
4
+ $desc=array('Ascent'=>629,'Descent'=>-157,'CapHeight'=>562,'FontBBox'=>'[-27 -250 849 805]');
5
+ $up=-100;
6
+ $ut=50;
7
+
8
+
9
+ ?>
mPDF/font/chelvetica.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
6
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
8
+ 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
9
+ chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
14
+ chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
15
+
16
+ $desc=array('Ascent'=>718,'Descent'=>-207,'CapHeight'=>718,'FontBBox'=>'[-166 -225 1000 931]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -74, ), chr(65)=> array ( chr(84)=> -74, chr(86)=> -74, chr(87)=> -37, chr(89)=> -74, chr(118)=> -18, chr(119)=> -18, chr(121)=> -18, chr(146)=> -74, ), chr(70)=> array ( chr(44)=> -110, chr(46)=> -110, chr(65)=> -55, ), chr(76)=> array ( chr(84)=> -74, chr(86)=> -74, chr(87)=> -74, chr(89)=> -74, chr(121)=> -37, chr(146)=> -55, ), chr(80)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -74, ), chr(82)=> array ( chr(84)=> -18, chr(86)=> -18, chr(87)=> -18, chr(89)=> -18, ), chr(84)=> array ( chr(44)=> -110, chr(46)=> -110, chr(58)=> -110, chr(65)=> -74, chr(79)=> -18, chr(97)=> -110, chr(99)=> -110, chr(101)=> -110, chr(105)=> -37, chr(111)=> -110, chr(114)=> -37, chr(115)=> -110, chr(117)=> -37, chr(119)=> -55, chr(121)=> -55, ), chr(86)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -37, chr(65)=> -74, chr(97)=> -74, chr(101)=> -55, chr(105)=> -18, chr(111)=> -55, chr(114)=> -37, chr(117)=> -37, chr(121)=> -37, ), chr(87)=> array ( chr(44)=> -55, chr(46)=> -55, chr(58)=> -18, chr(65)=> -37, chr(97)=> -37, chr(101)=> -18, chr(105)=> 0, chr(111)=> -18, chr(114)=> -18, chr(117)=> -18, chr(121)=> -8, ), chr(89)=> array ( chr(44)=> -128, chr(46)=> -128, chr(58)=> -55, chr(65)=> -74, chr(97)=> -74, chr(101)=> -91, chr(105)=> -37, chr(111)=> -91, chr(112)=> -74, chr(113)=> -91, chr(117)=> -55, chr(118)=> -55, ), chr(102)=> array ( chr(102)=> -18, chr(146)=> 18, ), chr(114)=> array ( chr(44)=> -55, chr(46)=> -55, chr(146)=> 37, ), chr(118)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(119)=> array ( chr(44)=> -55, chr(46)=> -55, ), chr(121)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(145)=> array ( chr(145)=> -18, ), chr(146)=> array ( chr(115)=> -18, chr(146)=> -18, ), );
20
+ ?>
mPDF/font/chelveticab.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
6
+ 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
8
+ 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
14
+ chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
15
+
16
+ $desc=array('Ascent'=>718,'Descent'=>-207,'CapHeight'=>718,'FontBBox'=>'[-170 -228 1003 962]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -55, ), chr(65)=> array ( chr(84)=> -74, chr(86)=> -74, chr(87)=> -55, chr(89)=> -91, chr(118)=> -37, chr(119)=> -18, chr(121)=> -37, chr(146)=> -55, ), chr(70)=> array ( chr(44)=> -110, chr(46)=> -110, chr(65)=> -55, ), chr(76)=> array ( chr(84)=> -74, chr(86)=> -74, chr(87)=> -55, chr(89)=> -91, chr(121)=> -37, chr(146)=> -55, ), chr(80)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -74, ), chr(82)=> array ( chr(86)=> -18, chr(87)=> -18, chr(89)=> -37, ), chr(84)=> array ( chr(44)=> -110, chr(46)=> -110, chr(58)=> -110, chr(65)=> -74, chr(79)=> -18, chr(97)=> -74, chr(99)=> -74, chr(101)=> -74, chr(105)=> -18, chr(111)=> -74, chr(114)=> -55, chr(115)=> -74, chr(117)=> -74, chr(119)=> -74, chr(121)=> -74, ), chr(86)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -55, chr(65)=> -74, chr(97)=> -55, chr(101)=> -55, chr(105)=> -18, chr(111)=> -74, chr(114)=> -55, chr(117)=> -37, chr(121)=> -37, ), chr(87)=> array ( chr(44)=> -55, chr(46)=> -55, chr(58)=> -18, chr(65)=> -55, chr(97)=> -37, chr(101)=> -18, chr(105)=> -8, chr(111)=> -18, chr(114)=> -18, chr(117)=> -18, chr(121)=> -18, ), chr(89)=> array ( chr(44)=> -110, chr(46)=> -110, chr(58)=> -74, chr(65)=> -91, chr(97)=> -55, chr(101)=> -55, chr(105)=> -37, chr(111)=> -74, chr(112)=> -55, chr(113)=> -74, chr(117)=> -55, chr(118)=> -55, ), chr(102)=> array ( chr(146)=> 18, ), chr(114)=> array ( chr(44)=> -55, chr(46)=> -55, chr(146)=> 37, ), chr(118)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(119)=> array ( chr(44)=> -37, chr(46)=> -37, ), chr(121)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(145)=> array ( chr(145)=> -37, ), chr(146)=> array ( chr(115)=> -37, chr(146)=> -37, ), );
20
+
21
+ ?>
mPDF/font/chelveticabi.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
6
+ 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
8
+ 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
14
+ chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
15
+
16
+ $desc=array('Ascent'=>718,'Descent'=>-207,'CapHeight'=>718,'FontBBox'=>'[-174 -228 1114 962]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -74, ), chr(65)=> array ( chr(84)=> -74, chr(86)=> -74, chr(87)=> -55, chr(89)=> -74, chr(146)=> -55, ), chr(70)=> array ( chr(44)=> -110, chr(46)=> -110, chr(65)=> -55, ), chr(76)=> array ( chr(84)=> -74, chr(86)=> -55, chr(87)=> -55, chr(89)=> -74, chr(146)=> -74, ), chr(80)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -74, ), chr(82)=> array ( chr(84)=> -18, chr(87)=> -18, chr(89)=> -18, ), chr(84)=> array ( chr(44)=> -74, chr(46)=> -74, chr(58)=> -74, chr(65)=> -74, chr(79)=> -18, chr(97)=> -37, chr(99)=> -37, chr(101)=> -37, chr(105)=> -18, chr(111)=> -37, chr(114)=> -18, chr(115)=> -37, chr(117)=> -18, chr(119)=> -37, chr(121)=> -37, ), chr(86)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -37, chr(65)=> -74, chr(97)=> -37, chr(101)=> -37, chr(105)=> -37, chr(111)=> -37, chr(114)=> -18, chr(117)=> -18, chr(121)=> -18, ), chr(87)=> array ( chr(44)=> -74, chr(46)=> -74, chr(58)=> -37, chr(65)=> -55, chr(97)=> -18, chr(101)=> -18, chr(105)=> -8, chr(111)=> -18, chr(114)=> -18, chr(117)=> -18, chr(121)=> -18, ), chr(89)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -55, chr(65)=> -74, chr(97)=> -37, chr(101)=> -37, chr(105)=> -37, chr(111)=> -37, chr(112)=> -37, chr(113)=> -37, chr(117)=> -37, chr(118)=> -37, ), chr(102)=> array ( chr(102)=> -18, chr(146)=> 18, ), chr(114)=> array ( chr(44)=> -55, chr(46)=> -55, chr(146)=> 37, ), chr(118)=> array ( chr(44)=> -55, chr(46)=> -55, ), chr(119)=> array ( chr(44)=> -37, chr(46)=> -37, ), chr(121)=> array ( chr(44)=> -37, chr(46)=> -37, ), chr(145)=> array ( chr(145)=> -37, ), chr(146)=> array ( chr(115)=> -18, chr(116)=> 18, chr(146)=> -37, ), );
20
+
21
+ ?>
mPDF/font/chelveticai.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
6
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
8
+ 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
9
+ chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
14
+ chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
15
+
16
+ $desc=array('Ascent'=>718,'Descent'=>-207,'CapHeight'=>718,'FontBBox'=>'[-170 -225 1116 931]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -74, ), chr(65)=> array ( chr(84)=> -74, chr(86)=> -55, chr(87)=> -18, chr(89)=> -74, chr(118)=> -18, chr(119)=> -18, chr(121)=> -8, chr(146)=> -37, ), chr(70)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -74, ), chr(76)=> array ( chr(84)=> -74, chr(86)=> -55, chr(87)=> -37, chr(89)=> -91, chr(121)=> -18, chr(146)=> -55, ), chr(80)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -74, ), chr(82)=> array ( chr(84)=> -18, chr(86)=> -18, chr(87)=> -18, chr(89)=> -37, ), chr(84)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -74, chr(65)=> -74, chr(79)=> -18, chr(97)=> -91, chr(99)=> -91, chr(101)=> -91, chr(105)=> -8, chr(111)=> -91, chr(114)=> -74, chr(115)=> -91, chr(117)=> -74, chr(119)=> -74, chr(121)=> -74, ), chr(86)=> array ( chr(44)=> -74, chr(46)=> -74, chr(58)=> -18, chr(65)=> -55, chr(97)=> -37, chr(101)=> -37, chr(105)=> -18, chr(111)=> -37, chr(114)=> -18, chr(117)=> -18, chr(121)=> -18, ), chr(87)=> array ( chr(44)=> -37, chr(46)=> -37, chr(65)=> -18, chr(97)=> -18, chr(101)=> -18, chr(105)=> -8, ), chr(89)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -37, chr(65)=> -55, chr(97)=> -74, chr(101)=> -55, chr(105)=> -18, chr(111)=> -55, chr(112)=> -55, chr(113)=> -55, chr(117)=> -37, chr(118)=> -37, ), chr(102)=> array ( chr(146)=> 37, ), chr(114)=> array ( chr(44)=> -55, chr(46)=> -37, chr(146)=> 37, ), chr(118)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(119)=> array ( chr(44)=> -55, chr(46)=> -55, ), chr(121)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(145)=> array ( chr(145)=> -37, ), chr(146)=> array ( chr(115)=> -18, chr(146)=> -37, ), );
20
+
21
+ ?>
mPDF/font/csymbol.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
5
+ ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
6
+ 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
7
+ 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
8
+ 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
9
+ chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
10
+ chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
11
+ chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
12
+ chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
13
+ chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
14
+ chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
15
+
16
+ $desc=array('FontBBox'=>'[-180 -293 1090 1010]');
17
+ $up=-100;
18
+ $ut=50;
19
+
20
+
21
+ ?>
mPDF/font/ctimes.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
6
+ 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
7
+ 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
8
+ 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
15
+
16
+ $desc=array('Ascent'=>683,'Descent'=>-217,'CapHeight'=>662,'FontBBox'=>'[-168 -218 1000 898]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -37, ), chr(65)=> array ( chr(84)=> -110, chr(86)=> -128, chr(87)=> -80, chr(89)=> -91, chr(118)=> -74, chr(119)=> -91, chr(121)=> -91, chr(146)=> -110, ), chr(70)=> array ( chr(44)=> -80, chr(46)=> -80, chr(65)=> -74, ), chr(76)=> array ( chr(84)=> -91, chr(86)=> -91, chr(87)=> -74, chr(89)=> -100, chr(121)=> -55, chr(146)=> -91, ), chr(80)=> array ( chr(44)=> -110, chr(46)=> -110, chr(65)=> -91, ), chr(82)=> array ( chr(84)=> -60, chr(86)=> -80, chr(87)=> -55, chr(89)=> -55, chr(121)=> -40, ), chr(84)=> array ( chr(44)=> -74, chr(46)=> -74, chr(58)=> -49, chr(65)=> -80, chr(79)=> -18, chr(97)=> -69, chr(99)=> -69, chr(101)=> -69, chr(105)=> -35, chr(111)=> -69, chr(114)=> -35, chr(115)=> -69, chr(117)=> -35, chr(119)=> -69, chr(121)=> -69, ), chr(86)=> array ( chr(44)=> -128, chr(46)=> -128, chr(58)=> -74, chr(65)=> -128, chr(97)=> -110, chr(101)=> -110, chr(105)=> -60, chr(111)=> -128, chr(114)=> -60, chr(117)=> -60, chr(121)=> -110, ), chr(87)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -37, chr(65)=> -110, chr(97)=> -80, chr(101)=> -80, chr(105)=> -40, chr(111)=> -80, chr(114)=> -40, chr(117)=> -40, chr(121)=> -60, ), chr(89)=> array ( chr(44)=> -128, chr(46)=> -128, chr(58)=> -91, chr(65)=> -110, chr(97)=> -100, chr(101)=> -100, chr(105)=> -55, chr(111)=> -100, chr(112)=> -91, chr(113)=> -110, chr(117)=> -110, chr(118)=> -100, ), chr(102)=> array ( chr(102)=> -18, chr(146)=> 55, ), chr(114)=> array ( chr(44)=> -40, chr(46)=> -55, chr(103)=> -18, chr(146)=> 37, ), chr(118)=> array ( chr(44)=> -64, chr(46)=> -64, ), chr(119)=> array ( chr(44)=> -64, chr(46)=> -64, ), chr(121)=> array ( chr(44)=> -64, chr(46)=> -64, ), chr(145)=> array ( chr(145)=> -74, ), chr(146)=> array ( chr(115)=> -55, chr(116)=> -18, chr(146)=> -74, ), );
20
+
21
+ ?>
mPDF/font/ctimesb.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
6
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
7
+ 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
8
+ 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
15
+
16
+ $desc=array('Ascent'=>683,'Descent'=>-217,'CapHeight'=>676,'FontBBox'=>'[-168 -218 1000 935]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -55, ), chr(65)=> array ( chr(84)=> -74, chr(86)=> -128, chr(87)=> -110, chr(89)=> -91, chr(118)=> -74, chr(119)=> -74, chr(121)=> -74, chr(146)=> -74, ), chr(70)=> array ( chr(44)=> -91, chr(46)=> -91, chr(65)=> -74, ), chr(76)=> array ( chr(84)=> -91, chr(86)=> -91, chr(87)=> -91, chr(89)=> -91, chr(121)=> -55, chr(146)=> -91, ), chr(80)=> array ( chr(44)=> -91, chr(46)=> -91, chr(65)=> -74, ), chr(82)=> array ( chr(84)=> -35, chr(86)=> -35, chr(87)=> -35, chr(89)=> -35, chr(121)=> -35, ), chr(84)=> array ( chr(44)=> -74, chr(46)=> -74, chr(58)=> -74, chr(65)=> -74, chr(79)=> -18, chr(97)=> -91, chr(99)=> -91, chr(101)=> -91, chr(105)=> -18, chr(111)=> -91, chr(114)=> -74, chr(115)=> -91, chr(117)=> -91, chr(119)=> -74, chr(121)=> -74, ), chr(86)=> array ( chr(44)=> -128, chr(46)=> -128, chr(58)=> -91, chr(65)=> -128, chr(79)=> -20, chr(97)=> -91, chr(101)=> -91, chr(105)=> -37, chr(111)=> -91, chr(114)=> -74, chr(117)=> -91, chr(121)=> -91, ), chr(87)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -55, chr(65)=> -110, chr(97)=> -55, chr(101)=> -55, chr(105)=> -18, chr(111)=> -55, chr(114)=> -18, chr(117)=> -18, chr(121)=> -37, ), chr(89)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -91, chr(65)=> -91, chr(97)=> -110, chr(101)=> -110, chr(105)=> -37, chr(111)=> -110, chr(112)=> -91, chr(113)=> -110, chr(117)=> -91, chr(118)=> -110, ), chr(102)=> array ( chr(102)=> 0, chr(146)=> 55, ), chr(114)=> array ( chr(44)=> -91, chr(46)=> -91, chr(99)=> -18, chr(101)=> -18, chr(104)=> 0, chr(111)=> -18, chr(113)=> -18, chr(116)=> 0, chr(119)=> 0, chr(120)=> 0, chr(121)=> 0, chr(122)=> 0, chr(146)=> 18, ), chr(118)=> array ( chr(44)=> -55, chr(46)=> -55, ), chr(119)=> array ( chr(44)=> -55, chr(46)=> -55, ), chr(121)=> array ( chr(44)=> -55, chr(46)=> -55, ), chr(145)=> array ( chr(145)=> -74, ), chr(146)=> array ( chr(115)=> -37, chr(146)=> -74, ), );
20
+
21
+ ?>
mPDF/font/ctimesbi.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
6
+ 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
7
+ 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
8
+ 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
12
+ chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
15
+
16
+ $desc=array('Ascent'=>683,'Descent'=>-217,'CapHeight'=>669,'FontBBox'=>'[-200 -218 996 921]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -55, ), chr(65)=> array ( chr(84)=> -55, chr(86)=> -74, chr(87)=> -91, chr(89)=> -55, chr(118)=> -74, chr(119)=> -74, chr(121)=> -74, chr(146)=> -74, ), chr(70)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -91, ), chr(76)=> array ( chr(84)=> -18, chr(86)=> -37, chr(87)=> -37, chr(89)=> -37, chr(121)=> -37, chr(146)=> -55, ), chr(80)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -74, ), chr(82)=> array ( chr(86)=> -18, chr(87)=> -18, chr(89)=> -18, chr(121)=> -18, ), chr(84)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -74, chr(65)=> -55, chr(79)=> -18, chr(97)=> -91, chr(99)=> -91, chr(101)=> -91, chr(105)=> -37, chr(111)=> -91, chr(114)=> -37, chr(115)=> -91, chr(117)=> -37, chr(119)=> -37, chr(121)=> -37, ), chr(86)=> array ( chr(44)=> -128, chr(46)=> -128, chr(58)=> -74, chr(65)=> -74, chr(97)=> -110, chr(101)=> -110, chr(105)=> -55, chr(111)=> -110, chr(114)=> -55, chr(117)=> -55, chr(121)=> -74, ), chr(87)=> array ( chr(44)=> -74, chr(46)=> -74, chr(58)=> -55, chr(65)=> -74, chr(97)=> -74, chr(101)=> -74, chr(105)=> -37, chr(111)=> -74, chr(114)=> -74, chr(117)=> -55, chr(121)=> -55, ), chr(89)=> array ( chr(44)=> -91, chr(46)=> -74, chr(58)=> -91, chr(65)=> -74, chr(97)=> -91, chr(101)=> -110, chr(105)=> -55, chr(111)=> -110, chr(112)=> -74, chr(113)=> -110, chr(117)=> -91, chr(118)=> -91, ), chr(102)=> array ( chr(102)=> -18, chr(146)=> 55, ), chr(114)=> array ( chr(44)=> -55, chr(46)=> -55, chr(146)=> 37, ), chr(118)=> array ( chr(44)=> -37, chr(46)=> -37, ), chr(119)=> array ( chr(44)=> -37, chr(46)=> -37, ), chr(121)=> array ( chr(44)=> -37, chr(46)=> -37, ), chr(145)=> array ( chr(145)=> -74, ), chr(146)=> array ( chr(115)=> -74, chr(116)=> -37, chr(146)=> -74, ), );
20
+
21
+ ?>
mPDF/font/ctimesi.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
6
+ 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
7
+ 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
8
+ 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
12
+ chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
15
+
16
+ $desc=array('Ascent'=>683,'Descent'=>-217,'CapHeight'=>653,'FontBBox'=>'[-169 -217 1010 883]');
17
+ $up=-100;
18
+ $ut=50;
19
+ $kerninfo=array ( chr(49)=> array ( chr(49)=> -74, ), chr(65)=> array ( chr(84)=> -37, chr(86)=> -49, chr(87)=> -37, chr(89)=> -55, chr(118)=> -55, chr(119)=> -55, chr(121)=> -55, chr(146)=> -37, ), chr(70)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -128, ), chr(76)=> array ( chr(84)=> -20, chr(86)=> -37, chr(87)=> -37, chr(89)=> -20, chr(121)=> -29, chr(146)=> -37, ), chr(80)=> array ( chr(44)=> -128, chr(46)=> -128, chr(65)=> -128, ), chr(82)=> array ( chr(84)=> 0, chr(86)=> -18, chr(87)=> -18, chr(89)=> -18, chr(121)=> -18, ), chr(84)=> array ( chr(44)=> -74, chr(46)=> -74, chr(58)=> -55, chr(65)=> -74, chr(79)=> -18, chr(97)=> -91, chr(99)=> -91, chr(101)=> -91, chr(105)=> -55, chr(111)=> -91, chr(114)=> -55, chr(115)=> -91, chr(117)=> -55, chr(119)=> -74, chr(121)=> -74, ), chr(86)=> array ( chr(44)=> -128, chr(46)=> -128, chr(58)=> -64, chr(65)=> -74, chr(79)=> -29, chr(97)=> -110, chr(101)=> -110, chr(105)=> -74, chr(111)=> -110, chr(114)=> -74, chr(117)=> -74, chr(121)=> -91, ), chr(87)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -64, chr(65)=> -69, chr(97)=> -91, chr(101)=> -91, chr(105)=> -55, chr(111)=> -91, chr(114)=> -55, chr(117)=> -55, chr(121)=> -91, ), chr(89)=> array ( chr(44)=> -91, chr(46)=> -91, chr(58)=> -64, chr(65)=> -69, chr(97)=> -91, chr(101)=> -91, chr(105)=> -74, chr(111)=> -91, chr(112)=> -91, chr(113)=> -110, chr(117)=> -91, chr(118)=> -91, ), chr(102)=> array ( chr(146)=> 91, ), chr(114)=> array ( chr(44)=> -110, chr(46)=> -110, chr(99)=> -37, chr(100)=> -37, chr(101)=> -37, chr(103)=> -37, chr(104)=> -18, chr(111)=> -37, chr(113)=> -37, chr(114)=> 0, chr(116)=> 0, chr(117)=> 0, chr(118)=> 0, chr(119)=> 0, chr(120)=> 0, chr(121)=> 0, chr(146)=> 37, ), chr(118)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(119)=> array ( chr(44)=> -74, chr(46)=> -74, ), chr(121)=> array ( chr(44)=> -55, chr(46)=> -55, ), chr(145)=> array ( chr(145)=> -110, ), chr(146)=> array ( chr(115)=> -128, chr(116)=> -110, chr(146)=> -110, ), );
20
+
21
+ ?>
mPDF/font/czapfdingbats.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $cw=array(
3
+ chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
4
+ chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
5
+ ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
6
+ 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
7
+ 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
8
+ 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
9
+ chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
10
+ chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
11
+ chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
12
+ chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
13
+ chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
14
+ chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
15
+
16
+ $desc=array('FontBBox'=>'[-1 -143 981 820]');
17
+ $up=-100;
18
+ $ut=50;
19
+
20
+
21
+ ?>
mPDF/graph.php ADDED
@@ -0,0 +1,721 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ // mPDF 4.5.009
5
+ define("FF_USERFONT", 15); // See jpgraph_ttf.inc.php for font IDs
6
+ global $JpgUseSVGFormat;
7
+ $JpgUseSVGFormat = true;
8
+
9
+ //======================================================================================================
10
+ // DELETE OLD GRAPH FILES FIRST - Housekeeping
11
+ // First clear any files in directory that are >1 hrs old
12
+ $interval = 3600;
13
+ if ($handle = opendir(_MPDF_PATH.'graph_cache')) {
14
+ while (false !== ($file = readdir($handle))) {
15
+ if (((filemtime(_MPDF_PATH.'graph_cache/'.$file)+$interval) < time()) && ($file != "..") && ($file != ".")) {
16
+ @unlink(_MPDF_PATH.'graph_cache/'.$file); // mPDF 4.0
17
+ }
18
+ }
19
+ closedir($handle);
20
+ }
21
+ //==============================================================================================================
22
+ // LOAD GRAPHS
23
+
24
+ include_once(_JPGRAPH_PATH.'jpgraph.php');
25
+ include_once(_JPGRAPH_PATH.'jpgraph_line.php' );
26
+ include_once(_JPGRAPH_PATH.'jpgraph_log.php' );
27
+ include_once(_JPGRAPH_PATH.'jpgraph_scatter.php' );
28
+ include_once(_JPGRAPH_PATH.'jpgraph_regstat.php' );
29
+ include_once(_JPGRAPH_PATH.'jpgraph_pie.php');
30
+ include_once(_JPGRAPH_PATH.'jpgraph_pie3d.php');
31
+ include_once(_JPGRAPH_PATH.'jpgraph_bar.php');
32
+ include_once(_JPGRAPH_PATH.'jpgraph_radar.php');
33
+
34
+
35
+ //======================================================================================================
36
+ //*****************************************************************************************************
37
+ //*****************************************************************************************************
38
+ //*****************************************************************************************************
39
+ //*****************************************************************************************************
40
+ //*****************************************************************************************************
41
+ //*****************************************************************************************************
42
+ //======================================================================================================
43
+ //======================================================================================================
44
+
45
+ //======================================================================================================
46
+ //======================================================================================================
47
+
48
+ //======================================================================================================
49
+ function print_graph($g,$pgwidth) {
50
+ $splines = false;
51
+ $bandw = false;
52
+ $percent = false;
53
+ $show_percent = false;
54
+ $stacked = false;
55
+ $h = false;
56
+ $show_values = false;
57
+ $hide_grid = false;
58
+ $hide_y_axis = false;
59
+
60
+ if (isset($g['attr']['TYPE']) && $g['attr']['TYPE']) { $type = strtolower($g['attr']['TYPE']); }
61
+ if (!in_array($type,array('bar','horiz_bar','line','radar','pie','pie3d','xy','scatter'))) { $type = 'bar'; } // Default=bar
62
+
63
+ if (isset($g['attr']['STACKED']) && $g['attr']['STACKED']) { $stacked = true; } // stacked for bar or horiz_bar
64
+ if (isset($g['attr']['SPLINES']) && $g['attr']['SPLINES'] && $type=='xy') { $splines = true; } // splines for XY line graphs
65
+ if (isset($g['attr']['BANDW']) && $g['attr']['BANDW']) { $bandw = true; } // black and white
66
+ if (isset($g['attr']['LEGEND-OVERLAP']) && $g['attr']['LEGEND-OVERLAP']) { $overlap = true; } // avoid overlap of Legends over graph (line, bar, horiz_bar only)
67
+ if (isset($g['attr']['PERCENT']) && $g['attr']['PERCENT'] && $type != 'xy' && $type != 'scatter') { $percent = true; } // Show data series as percent of total in series
68
+ if (isset($g['attr']['SHOW-VALUES']) && $g['attr']['SHOW-VALUES']) { $show_values = true; } // Show the individual data values
69
+ if (isset($g['attr']['HIDE-GRID']) && $g['attr']['HIDE-GRID']) { $hide_grid = true; } // Hide the y-axis gridlines
70
+ if (isset($g['attr']['HIDE-Y-AXIS']) && $g['attr']['HIDE-Y-AXIS']) { $hide_y_axis = true; } // Hide the y-axis
71
+
72
+
73
+ // Antialias: If true - better quality curves, but graph line will only be 1px even in PDF 300dpi
74
+ // default=true for most except line and radar
75
+ if (isset($g['attr']['ANTIALIAS']) && ($g['attr']['ANTIALIAS']=='' || $g['attr']['ANTIALIAS']==0)) { $antialias = false; }
76
+ else if (isset($g['attr']['ANTIALIAS']) && $g['attr']['ANTIALIAS'] > 0) { $antialias = true; }
77
+ else if ($type=='line' || $type=='radar') { $antialias = false; }
78
+ else { $antialias = true; }
79
+
80
+ if ($g['attr']['DPI']) { $dpi = intval($g['attr']['DPI']); }
81
+ if (!$dpi || $dpi < 50 || $dpi > 2400) { $dpi = 150; } // Default dpi 150
82
+ $k = (0.2645/25.4 * $dpi);
83
+
84
+ // mPDF 4.5.009
85
+ global $JpgUseSVGFormat;
86
+ if (isset($JpgUseSVGFormat) && $JpgUseSVGFormat) {
87
+ $img_type = 'svg';
88
+ $k = 1; // Overrides as Vector scale does not need DPI
89
+ }
90
+ else {
91
+ $img_type = 'png';
92
+ }
93
+
94
+ if (isset($g['attr']['TITLE']) && $g['attr']['TITLE']) { $title = $g['attr']['TITLE']; }
95
+
96
+ if (isset($g['attr']['LABEL-X']) && $g['attr']['LABEL-X']) { $xlabel = $g['attr']['LABEL-X']; } // NOT IMPLEMENTED??????
97
+ if (isset($g['attr']['LABEL-Y']) && $g['attr']['LABEL-Y']) { $ylabel = $g['attr']['LABEL-Y']; }
98
+
99
+ if (isset($g['attr']['AXIS-X']) && $g['attr']['AXIS-X']) { $xaxis = strtolower($g['attr']['AXIS-X']); }
100
+ if (!in_array($xaxis,array('text','lin','linear','log'))) { $xaxis = 'text'; } // Default=text
101
+ if ($xaxis == 'linear') { $xaxis = 'lin'; }
102
+
103
+ if (isset($g['attr']['AXIS-Y']) && $g['attr']['AXIS-Y']) { $yaxis = strtolower($g['attr']['AXIS-Y']); }
104
+ if (!in_array($yaxis,array('lin','linear','log','percent'))) { $yaxis = 'lin'; } // Default=lin
105
+ if ($yaxis == 'percent') { $show_percent = true; $yaxis = 'lin'; } // Show percent sign on scales
106
+ if ($yaxis == 'linear') { $yaxis = 'lin'; }
107
+
108
+ if ($splines) { $xaxis = 'lin'; }
109
+ $axes = $xaxis.$yaxis; // e.g.textlin, textlog, loglog, loglin, linlog (XY)
110
+
111
+ // mPDF 4.0
112
+ if (isset($g['attr']['cWIDTH']) && $g['attr']['cWIDTH']) { $w=($g['attr']['cWIDTH'] / 0.2645); } // pixels
113
+ if (isset($g['attr']['cHEIGHT']) && $g['attr']['cHEIGHT']) { $h=($g['attr']['cHEIGHT'] / 0.2645); }
114
+
115
+
116
+ if (isset($g['attr']['SERIES']) && strtolower($g['attr']['SERIES']) == 'rows') { $dataseries = 'rows'; }
117
+ else { $dataseries = 'cols'; }
118
+
119
+ // Defaults - define data
120
+ $rowbegin = 2;
121
+ $colbegin = 2;
122
+ if($type=='scatter' || $type=='xy') {
123
+ if ($dataseries == 'rows') { $rowbegin = 1; }
124
+ else { $colbegin = 1; }
125
+ }
126
+ $rowend = 0;
127
+ $colend = 0;
128
+
129
+ if (isset($g['attr']['DATA-ROW-BEGIN']) && ($g['attr']['DATA-ROW-BEGIN'] === '0' || $g['attr']['DATA-ROW-BEGIN'] > 0)) { $rowbegin = $g['attr']['DATA-ROW-BEGIN']; }
130
+
131
+ if (isset($g['attr']['DATA-COL-BEGIN']) && ($g['attr']['DATA-COL-BEGIN'] === '0' || $g['attr']['DATA-COL-BEGIN'] > 0)) { $colbegin = $g['attr']['DATA-COL-BEGIN']; }
132
+
133
+ if (isset($g['attr']['DATA-ROW-END']) && ($g['attr']['DATA-ROW-END'] === '0' || $g['attr']['DATA-ROW-END'] <> 0)) { $rowend = $g['attr']['DATA-ROW-END']; }
134
+ if (isset($g['attr']['DATA-COL-END']) && ($g['attr']['DATA-COL-END'] === '0' || $g['attr']['DATA-COL-END'] <> 0)) { $colend = $g['attr']['DATA-COL-END']; }
135
+
136
+ $nr = count($g['data']);
137
+ $nc = 0;
138
+ foreach($g['data'] AS $r) {
139
+ $cc=0;
140
+ foreach($r AS $c) { $cc++; }
141
+ $nc = max($nc,$cc);
142
+ }
143
+ if ($colend == 0) { $colend = $nc; }
144
+ else if ($colend < 0) { $colend = $nc+$colend; }
145
+
146
+ if ($rowend == 0) { $rowend = $nr; }
147
+ else if ($rowend < 0) { $rowend = $nr+$rowend; }
148
+
149
+ if ($colend < $colbegin) { $colend = $colbegin; }
150
+ if ($rowend < $rowbegin) { $rowend = $rowbegin; }
151
+
152
+ // if ($type == 'xy' || $type=='scatter') { $colstart=0; }
153
+
154
+ // Get Data + Totals
155
+ $data = array();
156
+ $totals = array();
157
+ for ($r=($rowbegin-1);$r<$rowend;$r++) {
158
+ for ($c=($colbegin-1);$c<$colend;$c++) {
159
+ if (isset($g['data'][$r][$c])) { $g['data'][$r][$c] = floatval($g['data'][$r][$c] ); }
160
+ else { $g['data'][$r][$c] = 0; }
161
+ if ($dataseries=='rows') {
162
+ $data[($r+1-$rowbegin)][($c+1-$colbegin)] = $g['data'][$r][$c] ;
163
+ $totals[($r+1-$rowbegin)] += $g['data'][$r][$c] ;
164
+ }
165
+ else {
166
+ $data[($c+1-$colbegin)][($r+1-$rowbegin)] = $g['data'][$r][$c] ;
167
+ if (isset($totals[($c+1-$colbegin)])) { $totals[($c+1-$colbegin)] += $g['data'][$r][$c] ; }
168
+ else { $totals[($c+1-$colbegin)] = $g['data'][$r][$c] ; }
169
+ }
170
+ }
171
+ }
172
+ // PERCENT
173
+ if ($percent && $type != 'pie' && $type != 'pie3d') {
174
+ for ($r=0;$r<count($data);$r++) {
175
+ for ($c=0;$c<count($data[$r]);$c++) {
176
+ $data[$r][$c] = $data[$r][$c]/$totals[$r] * 100;
177
+ }
178
+ }
179
+ }
180
+ // Get Legends and labels
181
+ $legends = array();
182
+ $labels = array();
183
+ $longestlegend = 0;
184
+ $longestlabel = 0;
185
+ if ($dataseries=='cols') {
186
+ if ($colbegin>1) {
187
+ for ($r=($rowbegin-1);$r<$rowend;$r++) {
188
+ $legends[($r+1-$rowbegin)] = $g['data'][$r][0] ;
189
+ $longestlegend = max($longestlegend, strlen( $g['data'][$r][0] ));
190
+ }
191
+ }
192
+ if ($rowbegin>1) {
193
+ for ($c=($colbegin-1);$c<$colend;$c++) {
194
+ $labels[($c+1-$colbegin)] = $g['data'][0][$c] ;
195
+ $longestlabel = max($longestlabel , strlen( $g['data'][0][$c] ));
196
+ }
197
+ }
198
+ }
199
+ else if ($dataseries=='rows') {
200
+ if ($colbegin>1) {
201
+ for ($r=($rowbegin-1);$r<$rowend;$r++) {
202
+ $labels[($r+1-$rowbegin)] = $g['data'][$r][0] ;
203
+ $longestlabel = max($longestlabel , strlen( $g['data'][$r][0] ));
204
+ }
205
+ }
206
+ if ($rowbegin>1) {
207
+ for ($c=($colbegin-1);$c<$colend;$c++) {
208
+ $legends[($c+1-$colbegin)] = $g['data'][0][$c] ;
209
+ $longestlegend = max($longestlegend, strlen( $g['data'][0][$c] ));
210
+ }
211
+ }
212
+ }
213
+ // Default sizes
214
+ $defsize = array();
215
+ $defsize['pie'] = array('w' => 600, 'h' => 300);
216
+ $defsize['pie3d'] = array('w' => 600, 'h' => 300);
217
+ $defsize['radar'] = array('w' => 600, 'h' => 300);
218
+ $defsize['line'] = array('w' => 600, 'h' => 400);
219
+ $defsize['xy'] = array('w' => 600, 'h' => 400);
220
+ $defsize['scatter'] = array('w' => 600, 'h' => 400);
221
+ $defsize['bar'] = array('w' => 600, 'h' => 400);
222
+ $defsize['horiz_bar'] = array('w' => 600, 'h' => 500);
223
+
224
+
225
+ // Use default ratios
226
+ if ($w && !$h) { $h = $w*$defsize[$type]['h']/$defsize[$type]['w']; }
227
+ if ($h && !$w) { $w = $h*$defsize[$type]['w']/$defsize[$type]['h']; }
228
+ if (!$h && !$w) { $w = $defsize[$type]['w']; $h = $defsize[$type]['h']; }
229
+
230
+
231
+ if (count($data)>0 && $type) {
232
+ $figure_file = "graph_cache/".rand(11111,999999999).".".$img_type;
233
+ if ($bandw) { $colours = array('snow1','black','snow4','snow3','snow2','cadetblue4','cadetblue3','cadetblue1','bisque4','bisque2','beige'); }
234
+ else { $colours = array('cyan','darkorchid4','cadetblue3','khaki1','darkolivegreen2','cadetblue4','coral','cyan4','rosybrown3','wheat1'); }
235
+ $fills = array('navy','orange','red','yellow','purple','navy','orange','red','yellow','purple');
236
+ $patterns = array(PATTERN_DIAG1,PATTERN_CROSS1,PATTERN_STRIPE1,PATTERN_DIAG3,PATTERN_CROSS2,PATTERN_DIAG2,PATTERN_DIAG4,PATTERN_CROSS3, PATTERN_CROSS4,PATTERN_STRIPE1);
237
+ $markers = array(MARK_DIAMOND, MARK_SQUARE, MARK_CIRCLE, MARK_UTRIANGLE, MARK_DTRIANGLE, MARK_FILLEDCIRCLE, MARK_CROSS, MARK_STAR, MARK_X);
238
+
239
+ // LEGENDS
240
+ if ($type == 'pie' || $type == 'pie3d') {
241
+ $graph = new PieGraph (($w*$k),($h*$k));
242
+ }
243
+ else if ($type == 'radar') {
244
+ $graph = new RadarGraph(($w*$k),($h*$k));
245
+ }
246
+ else {
247
+ $graph = new Graph(($w*$k),($h*$k));
248
+ }
249
+
250
+ // mPDF 4.5.009
251
+ // $graph->img->SetImgFormat($img_type) ;
252
+ // if (strtoupper($img_type)=='JPEG') { $graph->img->SetQuality(90); }
253
+ if ($antialias) { $graph->img->SetAntiAliasing(); }
254
+ $graph->SetShadow(true, 2*$k);
255
+ $graph->SetMarginColor("white");
256
+ // TITLE
257
+ $graph->title->Set($title);
258
+ $graph->title->SetMargin(10*$k);
259
+ $graph->title->SetFont(FF_USERFONT,FS_BOLD,11*$k);
260
+ $graph->title->SetColor("black");
261
+ $graph->legend->SetLineSpacing(3*$k);
262
+ $graph->legend->SetMarkAbsSize(6*$k);
263
+ $graph->legend->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
264
+
265
+ // Set GRAPH IMAGE MARGINS
266
+ if ($type == 'pie' || $type == 'pie3d') {
267
+ $psize = 0.3;
268
+ $pposxabs = ($w/2);
269
+ $pposy = 0.55;
270
+ if ($longestlegend) { // if legend showing
271
+ $pposxabs -= ((($longestlegend * 5) + 20) / 2);
272
+ }
273
+ $pposx = ($pposxabs / $w);
274
+ $graph->legend->Pos(0.02,0.5,'right','center');
275
+ }
276
+ else if ($type == 'radar') {
277
+ $psize = 0.5;
278
+ $pposxabs = ($w/2);
279
+ $pposy = 0.55;
280
+ if ($longestlabel) { // if legend showing
281
+ $pposxabs -= ((($longestlabel * 5) + 20) / 2);
282
+ }
283
+ $pposx = ($pposxabs / $w);
284
+ $graph->legend->Pos(0.02,0.5,'right','center');
285
+ }
286
+ else if ($type == 'xy' || $type == 'scatter') {
287
+ $pml = 50;
288
+ $pmr = 20;
289
+ $pmt = 60;
290
+ $pmb = 50;
291
+ $xaxislblmargin = $pmb - 30;
292
+ $yaxislblmargin = $pml - 15;
293
+ $graph->legend->Pos(0.02,0.1,'right','top');
294
+ }
295
+ else if ($type == 'line' || $type == 'bar') {
296
+ $pml = 50;
297
+ $pmr = 20;
298
+ $pmt = 60;
299
+ $pmb = 50;
300
+ $xlangle = 0;
301
+ $ll = ($longestlegend * 5); // 45 degrees 8pt fontsize
302
+ if ($ll > 5 || ($ll>3 && count($data)>10)) {
303
+ $pmb = max($pmb, $ll + 30);
304
+ $xlangle = 50;
305
+ }
306
+ $xaxislblmargin = $pmb - 30;
307
+ $yaxislblmargin = $pml - 15;
308
+ if ($longestlabel && !$overlap) { // if legend showing
309
+ $pmr = ((($longestlabel * 5) + 40));
310
+ }
311
+ $graph->legend->Pos(0.02,0.1,'right','top');
312
+ }
313
+ else if ($type == 'horiz_bar') {
314
+ $pml = 50;
315
+ $pmr = 20;
316
+ $pmt = 50;
317
+ $pmb = 45;
318
+ $ll = ($longestlegend * 6.5); // 8pt fontsize
319
+ $pml = max($pml, $ll + 20);
320
+ $xaxislblmargin = $pml - 20;
321
+ $yaxislblmargin = $pmb - 15;
322
+ if ($longestlabel && !$overlap) { // if legend showing
323
+ $pmr = ((($longestlabel * 5) + 40));
324
+ }
325
+ $graph->legend->Pos(0.02,0.1,'right','top');
326
+ }
327
+
328
+
329
+ // DRAW THE GRAPHS
330
+ if ($type == 'pie') {
331
+ $p1 = new PiePlot($data[0]);
332
+ $p1->SetSliceColors($colours);
333
+
334
+ if ($show_values) {
335
+ $p1->value->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
336
+ if ($percent) { $p1->SetLabelType(PIE_VALUE_PERADJ); } //PIE_VAL_PER = default
337
+ else { $p1->SetLabelType(PIE_VALUE_ABS); }
338
+ if ($percent || $show_percent) { $p1->value->SetFormat("%d%%"); }
339
+ else { $p1->value->SetFormat("%s"); }
340
+ // Enable and set policy for guide-lines. Make labels line up vertically
341
+ $p1->SetGuideLines(true);
342
+ $p1->SetGuideLinesAdjust(1.5);
343
+ }
344
+ else { $p1->value->Show(false); }
345
+ $p1->SetLegends($legends);
346
+ $p1->SetSize($psize);
347
+ $p1->SetCenter($pposx, $pposy);
348
+ if ($labels[0]) {
349
+ $graph->subtitle->Set($labels[0]);
350
+ $graph->subtitle->SetMargin(10*$k);
351
+ $graph->subtitle->SetFont(FF_USERFONT,FS_BOLD,11*$k);
352
+ $graph->subtitle->SetColor("black");
353
+ }
354
+ $graph->Add($p1);
355
+ }
356
+ else if ($type == 'pie3d') {
357
+ $p1 = new PiePlot3d($data[0]);
358
+ $p1->SetSliceColors($colours);
359
+ if ($show_values) {
360
+ $p1->value->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
361
+ if ($percent) { $p1->SetLabelType(PIE_VALUE_PERADJ); } //PIE_VAL_PER = default
362
+ else { $p1->SetLabelType(PIE_VALUE_ABS); }
363
+ if ($percent || $show_percent) { $p1->value->SetFormat("%d%%"); }
364
+ else { $p1->value->SetFormat("%s"); }
365
+ }
366
+ else { $p1->value->Show(false); }
367
+ $p1->SetLegends($legends);
368
+ $p1->SetEdge();
369
+ $p1->SetSize($psize);
370
+ $p1->SetCenter($pposx, $pposy);
371
+
372
+ if ($labels[0]) {
373
+ $graph->subtitle->Set($labels[0]);
374
+ $graph->subtitle->SetMargin(10*$k);
375
+ $graph->subtitle->SetFont(FF_USERFONT,FS_BOLD,11*$k);
376
+ $graph->subtitle->SetColor("black");
377
+ }
378
+
379
+ $graph->Add( $p1);
380
+ }
381
+ // RADAR
382
+ else if ($type == 'radar') {
383
+ $graph->SetSize($psize);
384
+ $graph->SetPos($pposx, $pposy);
385
+
386
+ $graph->SetTitles( $legends); // labels each axis
387
+
388
+ $graph->axis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
389
+ $graph->axis->title->SetMargin(5*$k);
390
+ $graph->axis->SetWeight(1*$k);
391
+ $graph->axis->HideLabels();
392
+ $graph->axis->SetFont(FF_USERFONT,FS_NORMAL,6*$k);
393
+ $graph->HideTickMarks();
394
+
395
+ $group = array();
396
+ foreach($data AS $series => $dat) {
397
+ $rdata = array();
398
+ foreach($data[$series] AS $row) { $rdata[] = $row; }
399
+ if (count($rdata)<3) { die("ERROR::Graph::Cannot create a Radar Plot with less than 3 data points."); }
400
+ // Create the radar plot
401
+ $bplot = new RadarPlot($rdata);
402
+ $bplot->mark->SetType($markers[$series]);
403
+ $bplot->mark->SetFillColor($colours[$series]);
404
+ $bplot->mark->SetWidth(3*$k);
405
+ $bplot->SetColor($colours[$series]);
406
+ if ($series == 0) { $bplot->SetFillColor('lightred'); }
407
+ else { $bplot->SetFill(false); }
408
+ $bplot->SetLineWeight(1*$k);
409
+ $bplot->SetLegend($labels[$series]);
410
+ if ($bandw) { $bplot->SetShadow("gray5"); }
411
+ $graph->Add($bplot);
412
+ }
413
+ }
414
+ // LINE
415
+ else if ($type == 'line') {
416
+ // Setup the graph.
417
+ $graph->img->SetMargin($pml*$k,$pmr*$k,$pmt*$k,$pmb*$k); // LRTB
418
+ $graph->SetScale($axes);
419
+ $graph->yaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
420
+
421
+ if ($ylabel) {
422
+ $graph->yaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
423
+ $graph->yaxis->SetTitle($ylabel,'middle');
424
+ $graph->yaxis->SetTitleMargin($yaxislblmargin*$k);
425
+ }
426
+
427
+ $graph->yaxis->SetLabelMargin(4*$k);
428
+ if ($percent || $show_percent) { $graph->yaxis->SetLabelFormat('%d%%'); } // Percent
429
+
430
+ // Show 0 label on Y-axis (default is not to show)
431
+ $graph->yscale->ticks->SupressZeroLabel(true);
432
+ if ($hide_y_axis) { $graph->yaxis->Hide(); }
433
+ if ($hide_grid) { $graph->ygrid->Show(false); }
434
+
435
+ // Setup X-axis labels
436
+ $graph->xaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
437
+ $graph->xaxis->SetTickLabels($legends);
438
+ $graph->xaxis->SetLabelAngle($xlangle);
439
+ $graph->xaxis->SetLabelMargin(4*$k);
440
+ // X-axis title
441
+ if ($xlabel) {
442
+ $graph->xaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
443
+ $graph->xaxis->SetTitle($xlabel,'middle');
444
+ $graph->xaxis->SetTitleMargin($xaxislblmargin*$k);
445
+ }
446
+ foreach($data AS $series => $rdata) {
447
+ $bplot = new LinePlot($rdata);
448
+ $bplot->mark->SetType($markers[$series]);
449
+ $bplot->mark->SetFillColor($colours[$series]);
450
+ $bplot->mark->SetWidth(4*$k);
451
+ if ($show_values) {
452
+ $bplot->value-> Show(); // Not if scatter
453
+ $bplot->value->SetMargin(6*$k);
454
+ $bplot->value->SetColor("darkred");
455
+ $bplot->value->SetFont( FF_USERFONT, FS_NORMAL, 8*$k);
456
+ if ($percent || $show_percent) { $bplot->value->SetFormat( '%d%%'); }
457
+ else { $bplot->value->SetFormat("%s"); }
458
+ }
459
+ // Set color for each line
460
+ $bplot->SetColor($colours[$series]);
461
+ $bplot->SetWeight(2*$k);
462
+ $bplot->SetLegend($labels[$series]);
463
+ if ($bandw) { $bplot->SetShadow("gray5"); }
464
+ // Indent the X-scale so the first and last point doesn't fall on the edges
465
+ $bplot->SetCenter();
466
+ $graph->Add($bplot);
467
+ }
468
+
469
+ }
470
+ // XY or SCATTER
471
+ else if ($type == 'xy' || $type == 'scatter') {
472
+ // Setup the graph.
473
+ $graph->img->SetMargin($pml*$k,$pmr*$k,$pmt*$k,$pmb*$k); // LRTB
474
+ $graph->SetScale($axes);
475
+ // Setup font for axis
476
+ $graph->yaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
477
+ // Y-axis title
478
+ if ($labels[1]) {
479
+ $graph->yaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
480
+ $graph->yaxis->SetTitleMargin($yaxislblmargin*$k);
481
+ $graph->yaxis->SetTitle($labels[1],'middle');
482
+ }
483
+
484
+
485
+ $graph->yaxis->SetLabelMargin(4*$k);
486
+ if ($percent || $show_percent) { $graph->yaxis->SetLabelFormat('%d%%'); } // Percent
487
+
488
+ // Show 0 label on Y-axis (default is not to show)
489
+ $graph->yscale->ticks->SupressZeroLabel(true);
490
+ // Just let the maximum be autoscaled
491
+ $graph->yaxis->scale->SetAutoMin(0);
492
+ if ($hide_y_axis) { $graph->yaxis->Hide(); }
493
+ if ($hide_grid) { $graph->ygrid->Show(false); }
494
+
495
+ // Setup X-axis labels
496
+ $graph->xaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
497
+ // mPDF 2.5 Corrects labelling of x-axis
498
+ // $graph->xaxis->SetTickLabels($legends);
499
+ $graph->xaxis->SetLabelAngle(50);
500
+ $graph->xaxis->SetLabelMargin(4*$k);
501
+ // X-axis title
502
+ if ($labels[0]) {
503
+ $graph->xaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
504
+ $graph->xaxis->SetTitleMargin($xaxislblmargin*$k);
505
+ $graph->xaxis->SetTitle($labels[0],'middle');
506
+ }
507
+
508
+ // Create the bar plot
509
+ // SPLINES
510
+ if ($splines && $type=='xy') {
511
+ $spline = new Spline($data[0],$data[1]);
512
+ list($newx,$newy) = $spline->Get(100);
513
+ }
514
+ else {
515
+ $newx = $data[0];
516
+ $newy = $data[1];
517
+ }
518
+
519
+ if ($type=='xy') {
520
+ // LINE PLOT
521
+ $bplot = new LinePlot($newy, $newx);
522
+ // Set color for each line
523
+ $bplot->SetColor($fills[0]);
524
+ $bplot->SetWeight(4*$k);
525
+ if ($bandw) { $bplot->SetShadow("gray5"); }
526
+ $graph->Add($bplot);
527
+ }
528
+
529
+ // SCATTER PLOT
530
+ $cplot = new ScatterPlot($data[1], $data[0]);
531
+
532
+ $cplot->mark->SetType($markers[0]);
533
+ $cplot->mark->SetFillColor($fills[0]);
534
+ $cplot->mark->SetWidth(8*$k);
535
+ if ($show_values) {
536
+ // mPDF 2.5
537
+ if ($type=='xy') { $cplot->value->Show(); } // Not if scatter
538
+ $cplot->value->SetMargin(8*$k);
539
+ $cplot->value->SetColor("darkred");
540
+ $cplot->value->SetFont( FF_USERFONT, FS_NORMAL, 6*$k);
541
+
542
+ if ($percent || $show_percent) { $cplot->value->SetFormat( '%d%%'); }
543
+ else { $cplot->value->SetFormat("%s"); }
544
+ }
545
+
546
+ // Set color for each line
547
+ $cplot->SetColor($fills[0]);
548
+ $cplot->SetWeight(4*$k);
549
+ if ($bandw) { $cplot->SetShadow("gray5"); }
550
+ $graph->Add($cplot);
551
+
552
+ }
553
+ // BAR
554
+ else if ($type == 'bar') {
555
+ // Setup the graph.
556
+ $graph->img->SetMargin($pml*$k,$pmr*$k,$pmt*$k,$pmb*$k); // LRTB
557
+ $graph->SetScale($axes);
558
+ // Setup y-axis
559
+ $graph->yaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
560
+ if ($hide_y_axis) { $graph->yaxis->Hide(); }
561
+ if ($hide_grid) { $graph->ygrid->Show(false); }
562
+ $graph->yaxis->SetLabelMargin(4*$k);
563
+ if ($ylabel) {
564
+ $graph->yaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
565
+ $graph->yaxis->SetTitle($ylabel,'middle');
566
+ $graph->yaxis->SetTitleMargin($yaxislblmargin*$k);
567
+ }
568
+ // Show 0 label on Y-axis (default is not to show)
569
+ $graph->yscale->ticks->SupressZeroLabel(false);
570
+ // Setup X-axis labels
571
+ $graph->xaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
572
+ $graph->xaxis->SetTickLabels($legends);
573
+ $graph->xaxis->SetLabelAngle($xlangle);
574
+ $graph->xaxis->SetLabelMargin(4*$k);
575
+ // X-axis title
576
+ if ($xlabel) {
577
+ $graph->xaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
578
+ $graph->xaxis->SetTitle($xlabel,'middle');
579
+ $graph->xaxis->SetTitleMargin($xaxislblmargin*$k);
580
+ }
581
+
582
+ $group = array();
583
+ foreach($data AS $series => $dat) {
584
+ $rdata = array();
585
+ foreach($data[$series] AS $row) { $rdata[] = $row; }
586
+
587
+ // Create the bar plot
588
+ $bplot = new BarPlot($rdata);
589
+ $bplot->SetWidth(0.6); // for SINGLE??
590
+ // Setup color for gradient fill style
591
+ if ($bandw) { $bplot->SetPattern( $patterns[$series]); }
592
+ else { $bplot->SetFillGradient($fills[$series],"#EEEEEE",GRAD_LEFT_REFLECTION); }
593
+
594
+ // Set color for the frame of each bar
595
+ $bplot->SetColor("darkgray");
596
+ $bplot->SetLegend($labels[$series]);
597
+ if ($bandw) { $bplot->SetShadow("gray5"); }
598
+ if ($show_values) {
599
+ $bplot->value->Show();
600
+ $bplot->value->SetMargin(6*$k);
601
+ $bplot->value->SetColor("darkred");
602
+ $bplot->value->SetFont( FF_USERFONT, FS_NORMAL, 8*$k);
603
+ if ($percent || $show_percent) { $bplot->value->SetFormat( '%d%%'); }
604
+ else { $bplot->value->SetFormat("%s"); }
605
+ }
606
+
607
+ $group[] = $bplot;
608
+ }
609
+ if (count($data)==1) {
610
+ $graph->Add($group[0]);
611
+ }
612
+ else {
613
+ // Create the grouped bar plot
614
+ if ($stacked) {
615
+ $gbplot = new AccBarPlot ($group);
616
+ }
617
+ else {
618
+ $gbplot = new GroupBarPlot ($group);
619
+ }
620
+ $graph->Add($gbplot);
621
+ }
622
+ }
623
+ else if ($type == 'horiz_bar') {
624
+ $graph->SetScale($axes);
625
+ $graph->Set90AndMargin($pml*$k,$pmr*$k,$pmt*$k,$pmb*$k); // LRTB
626
+
627
+ // Setup y-axis
628
+ $graph->yaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
629
+ $graph->yaxis->SetLabelMargin(4*$k);
630
+
631
+ $graph->yaxis->SetPos('max'); // Intersect at top of x-axis i.e. y axis is at bottom
632
+ // First make the labels look right
633
+ $graph->yaxis->SetLabelAlign('center','top');
634
+ if ($percent || $show_percent) { $graph->yaxis->SetLabelFormat('%d%%'); }
635
+ $graph->yaxis->SetLabelSide(SIDE_RIGHT);
636
+ $graph->yaxis->scale->SetGrace(10); // sets 10% headroom
637
+ if ($hide_y_axis) { $graph->yaxis->Hide(); }
638
+ if ($hide_grid) { $graph->ygrid->Show(false); }
639
+
640
+ // The fix the tick marks
641
+ $graph->yaxis->SetTickSide(SIDE_LEFT);
642
+ if ($ylabel) {
643
+ $graph->yaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
644
+ $graph->yaxis->SetTitle($ylabel,'middle');
645
+ $graph->yaxis->SetTitleMargin($yaxislblmargin*$k);
646
+ // Finally setup the title
647
+ $graph->yaxis->SetTitleSide(SIDE_RIGHT);
648
+ // To align the title to the right use :
649
+ $graph->yaxis->title->Align('right');
650
+ $graph->yaxis->title->SetAngle(0);
651
+
652
+ }
653
+
654
+ // Show 0 label on Y-axis (default is not to show)
655
+ $graph->yscale->ticks->SupressZeroLabel(false);
656
+ // Setup X-axis labels
657
+ $graph->xaxis->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
658
+ $graph->xaxis->title->SetAngle(90);
659
+ $graph->xaxis->SetTickLabels($legends);
660
+ $graph->xaxis->SetLabelMargin(4*$k);
661
+ // X-axis title
662
+ if ($xlabel) {
663
+ $graph->xaxis->title->SetFont(FF_USERFONT,FS_NORMAL,8*$k);
664
+ $graph->xaxis->SetTitleMargin($xaxislblmargin*$k);
665
+ $graph->xaxis->SetTitle($xlabel,'middle');
666
+ }
667
+ $group = array();
668
+ foreach($data AS $series => $dat) {
669
+ $rdata = array();
670
+ foreach($data[$series] AS $row) { $rdata[] = $row; }
671
+ // Create the bar pot
672
+ $bplot = new BarPlot($rdata);
673
+ $bplot->SetWidth(0.6); // for SINGLE??
674
+ // Setup color for gradient fill style
675
+ if ($bandw) { $bplot->SetPattern( $patterns[$series]); }
676
+ else { $bplot->SetFillGradient($fills[$series],"#EEEEEE",GRAD_LEFT_REFLECTION); }
677
+
678
+ // Set color for the frame of each bar
679
+ $bplot->SetColor("darkgray");
680
+ $bplot->SetLegend($labels[$series]);
681
+ if ($bandw) { $bplot->SetShadow("gray5"); }
682
+ if ($show_values) {
683
+ $bplot->value-> Show();
684
+ $bplot->value->SetMargin(6*$k);
685
+ $bplot->value->SetColor("darkred");
686
+ $bplot->value->SetFont( FF_USERFONT, FS_NORMAL, 8*$k);
687
+ if ($percent || $show_percent) { $bplot->value->SetFormat( '%d%%'); }
688
+ else { $bplot->value->SetFormat("%s"); }
689
+ }
690
+
691
+ $group[] = $bplot;
692
+ }
693
+ if (count($data)==1) {
694
+ $graph->Add($group[0]);
695
+ }
696
+ else {
697
+ // Create the grouped bar plot
698
+ if ($stacked) {
699
+ $gbplot = new AccBarPlot ($group);
700
+ }
701
+ else {
702
+ $gbplot = new GroupBarPlot ($group);
703
+ }
704
+ $graph->Add($gbplot);
705
+ }
706
+ }
707
+ if ($graph) {
708
+ $graph->Stroke( _MPDF_PATH.$figure_file);
709
+ $srcpath = str_replace("\\","/",dirname(__FILE__)) . "/";
710
+ $srcpath .= $figure_file;
711
+ return array('file'=>$srcpath, 'w'=>$w, 'h'=>$h);
712
+ }
713
+ }
714
+ return false;
715
+ }
716
+ //======================================================================================================
717
+ //======================================================================================================
718
+ //======================================================================================================
719
+ //======================================================================================================
720
+
721
+ ?>
mPDF/iccprofiles/SWOP2006_Coated5v2.icc ADDED
Binary file
mPDF/iccprofiles/sRGB_IEC61966-2-1.icc ADDED
Binary file
mPDF/includes/CJKdata.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // mPDF 2.5
3
+
4
+ // BIG 5
5
+ $cw = array(
6
+ 32 => 250, 33 => 250, 34 => 408, 35 => 668, 36 => 490, 37 => 875, 38 => 698, 39 => 250, 40 => 240, 41 => 240,
7
+ 42 => 417, 43 => 667, 44 => 250, 45 => 313, 46 => 250, 47 => 520, 48 => 500, 49 => 500, 50 => 500, 51 => 500,
8
+ 52 => 500, 53 => 500, 54 => 500, 55 => 500, 56 => 500, 57 => 500, 58 => 250, 59 => 250, 60 => 667, 61 => 667,
9
+ 62 => 667, 63 => 396, 64 => 921, 65 => 677, 66 => 615, 67 => 719, 68 => 760, 69 => 625, 70 => 552, 71 => 771,
10
+ 72 => 802, 73 => 354, 74 => 354, 75 => 781, 76 => 604, 77 => 927, 78 => 750, 79 => 823, 80 => 563, 81 => 823,
11
+ 82 => 729, 83 => 542, 84 => 698, 85 => 771, 86 => 729, 87 => 948, 88 => 771, 89 => 677, 90 => 635, 91 => 344,
12
+ 92 => 520, 93 => 344, 94 => 469, 95 => 500, 96 => 250, 97 => 469, 98 => 521, 99 => 427, 100 => 521, 101 => 438,
13
+ 102 => 271, 103 => 469, 104 => 531, 105 => 250, 106 => 250, 107 => 458, 108 => 240, 109 => 802, 110 => 531, 111 => 500,
14
+ 112 => 521, 113 => 521, 114 => 365, 115 => 333, 116 => 292, 117 => 521, 118 => 458, 119 => 677, 120 => 479, 121 => 458,
15
+ 122 => 427, 123 => 480, 124 => 496, 125 => 480, 126 => 667,
16
+ 17601 => 500,
17
+ );
18
+ $this->Big5_widths=$cw;
19
+
20
+
21
+ // GB
22
+ $cw = array(
23
+ 32 => 207, 33 => 270, 34 => 342, 35 => 467, 36 => 462, 37 => 797, 38 => 710, 39 => 239, 40 => 374, 41 => 374,
24
+ 42 => 423, 43 => 605, 44 => 238, 45 => 375, 46 => 238, 47 => 334, 48 => 462, 49 => 462, 50 => 462, 51 => 462,
25
+ 52 => 462, 53 => 462, 54 => 462, 55 => 462, 56 => 462, 57 => 462, 58 => 238, 59 => 238, 60 => 605, 61 => 605,
26
+ 62 => 605, 63 => 344, 64 => 748, 65 => 684, 66 => 560, 67 => 695, 68 => 739, 69 => 563, 70 => 511, 71 => 729,
27
+ 72 => 793, 73 => 318, 74 => 312, 75 => 666, 76 => 526, 77 => 896, 78 => 758, 79 => 772, 80 => 544, 81 => 772,
28
+ 82 => 628, 83 => 465, 84 => 607, 85 => 753, 86 => 711, 87 => 972, 88 => 647, 89 => 620, 90 => 607, 91 => 374,
29
+ 92 => 333, 93 => 374, 94 => 606, 95 => 500, 96 => 239, 97 => 417, 98 => 503, 99 => 427, 100 => 529, 101 => 415,
30
+ 102 => 264, 103 => 444, 104 => 518, 105 => 241, 106 => 230, 107 => 495, 108 => 228, 109 => 793, 110 => 527, 111 => 524,
31
+ 112 => 524, 113 => 504, 114 => 338, 115 => 336, 116 => 277, 117 => 517, 118 => 450, 119 => 652, 120 => 466, 121 => 452,
32
+ 122 => 407, 123 => 370, 124 => 258, 125 => 370, 126 => 605,
33
+ );
34
+ $this->GB_widths=$cw;
35
+
36
+ // Japanese
37
+ $cw = array(
38
+ 32 => 278, 33 => 299, 34 => 353, 35 => 614, 36 => 614, 37 => 721, 38 => 735, 39 => 216, 40 => 323, 41 => 323,
39
+ 42 => 449, 43 => 529, 44 => 219, 45 => 306, 46 => 219, 47 => 453, 48 => 614, 49 => 614, 50 => 614, 51 => 614,
40
+ 52 => 614, 53 => 614, 54 => 614, 55 => 614, 56 => 614, 57 => 614, 58 => 219, 59 => 219, 60 => 529, 61 => 529,
41
+ 62 => 529, 63 => 486, 64 => 744, 65 => 646, 66 => 604, 67 => 617, 68 => 681, 69 => 567, 70 => 537, 71 => 647,
42
+ 72 => 738, 73 => 320, 74 => 433, 75 => 637, 76 => 566, 77 => 904, 78 => 710, 79 => 716, 80 => 605, 81 => 716,
43
+ 82 => 623, 83 => 517, 84 => 601, 85 => 690, 86 => 668, 87 => 990, 88 => 681, 89 => 634, 90 => 578, 91 => 316,
44
+ 92 => 614, 93 => 316, 94 => 529, 95 => 500, 96 => 387, 97 => 509, 98 => 566, 99 => 478, 100 => 565, 101 => 503,
45
+ 102 => 337, 103 => 549, 104 => 580, 105 => 275, 106 => 266, 107 => 544, 108 => 276, 109 => 854, 110 => 579, 111 => 550,
46
+ 112 => 578, 113 => 566, 114 => 410, 115 => 444, 116 => 340, 117 => 575, 118 => 512, 119 => 760, 120 => 503, 121 => 529,
47
+ 122 => 453, 123 => 326, 124 => 380, 125 => 326, 126 => 387, 127 => 216, 128 => 453, 129 => 216, 130 => 380, 131 => 529,
48
+ 132 => 299, 133 => 614, 134 => 614, 135 => 265, 136 => 614, 137 => 475, 138 => 614, 139 => 353, 140 => 451, 141 => 291,
49
+ 142 => 291, 143 => 588, 144 => 589, 145 => 500, 146 => 476, 147 => 476, 148 => 219, 149 => 494, 150 => 452, 151 => 216,
50
+ 152 => 353, 153 => 353, 154 => 451, 156 => 1075, 157 => 486, 158 => 387, 159 => 387, 160 => 387, 161 => 387,
51
+ 162 => 387, 163 => 387, 164 => 387, 165 => 387, 166 => 387, 167 => 387, 168 => 387, 170 => 880, 171 => 448,
52
+ 172 => 566, 173 => 716, 174 => 903, 175 => 460, 176 => 805, 177 => 275, 178 => 276, 179 => 550, 180 => 886, 181 => 582,
53
+ 182 => 529, 183 => 738, 184 => 529, 185 => 738, 186 => 357, 187 => 529, 188 => 406, 189 => 406, 190 => 575, 191 => 406,
54
+ 192 => 934, 193 => 934, 194 => 934, 195 => 646, 196 => 646, 197 => 646, 198 => 646, 199 => 646, 200 => 646, 201 => 617,
55
+ 202 => 567, 203 => 567, 204 => 567, 205 => 567, 206 => 320, 207 => 320, 208 => 320, 209 => 320, 210 => 681, 211 => 710,
56
+ 212 => 716, 213 => 716, 214 => 716, 215 => 716, 216 => 716, 217 => 529, 218 => 690, 219 => 690, 220 => 690, 221 => 690,
57
+ 222 => 634, 223 => 605, 224 => 509, 225 => 509, 226 => 509, 227 => 509, 228 => 509, 229 => 509, 230 => 478, 231 => 503,
58
+ 232 => 503, 233 => 503, 234 => 503, 235 => 275, 236 => 275, 237 => 275, 238 => 275, 239 => 550, 240 => 579, 241 => 550,
59
+ 242 => 550, 243 => 550, 244 => 550, 245 => 550, 246 => 529, 247 => 575, 248 => 575, 249 => 575, 250 => 575, 251 => 529,
60
+ 252 => 578, 253 => 529, 254 => 517, 255 => 634, 256 => 578, 257 => 445, 258 => 444, 259 => 842, 260 => 453, 261 => 614,
61
+ );
62
+
63
+
64
+ $_cr = array(
65
+ array(231, 632, 500), // half-width
66
+ array(8718, 8718, 500),
67
+ array(9738, 9757, 250), // quarter-width
68
+ array(9758, 9778, 333), // third-width
69
+ array(12063, 12087, 500),
70
+ );
71
+ foreach($_cr as $_r) {
72
+ for($i = $_r[0]; $i <= $_r[1]; $i++) {
73
+ $cw[$i+31] = $_r[2];
74
+ }
75
+ }
76
+ $this->SJIS_widths=$cw;
77
+
78
+ // Korean
79
+ $cw = array(
80
+ 32 => 333, 33 => 416, 34 => 416, 35 => 833, 36 => 625, 37 => 916, 38 => 833, 39 => 250, 40 => 500, 41 => 500,
81
+ 42 => 500, 43 => 833, 44 => 291, 45 => 450, 46 => 291, 47 => 375, 48 => 625, 49 => 625, 50 => 625, 51 => 625,
82
+ 52 => 625, 53 => 625, 54 => 625, 55 => 625, 56 => 625, 57 => 625, 58 => 333, 59 => 333, 60 => 833, 61 => 833,
83
+ 62 => 916, 63 => 500, 64 => 1000, 65 => 791, 66 => 708, 67 => 708, 68 => 750, 69 => 708, 70 => 666, 71 => 750,
84
+ 72 => 791, 73 => 375, 74 => 500, 75 => 791, 76 => 666, 77 => 916, 78 => 791, 79 => 750, 80 => 666, 81 => 750,
85
+ 82 => 708, 83 => 666, 84 => 791, 85 => 791, 86 => 750, 87 => 1000, 88 => 708, 89 => 708, 90 => 666, 91 => 500,
86
+ 92 => 375, 93 => 500, 94 => 500, 95 => 500, 96 => 333, 97 => 541, 98 => 583, 99 => 541, 100 => 583, 101 => 583,
87
+ 102 => 375, 103 => 583, 104 => 583, 105 => 291, 106 => 333, 107 => 583, 108 => 291, 109 => 875, 110 => 583, 111 => 583,
88
+ 112 => 583, 113 => 583, 114 => 458, 115 => 541, 116 => 375, 117 => 583, 118 => 583, 119 => 833, 120 => 625, 121 => 625,
89
+ 122 => 500, 123 => 583, 124 => 583, 125 => 583, 126 => 750,
90
+ );
91
+ $_cr = array(
92
+ array(8094, 8190, 500)
93
+ );
94
+ foreach($_cr as $_r) {
95
+ for($i = $_r[0]; $i <= $_r[1]; $i++) {
96
+ $cw[$i+31] = $_r[2];
97
+ }
98
+ }
99
+ $this->UHC_widths=$cw;
100
+
101
+ ?>
mPDF/includes/functions.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // mPDF 5.7
4
+ // Replace a section of an array with the elements in reverse
5
+ if(!function_exists('array_splice_reverse'))
6
+ {
7
+ function array_splice_reverse(&$arr, $offset, $length) {
8
+ $tmp = (array_reverse(array_slice($arr, $offset, $length)));
9
+ array_splice($arr, $offset, $length, $tmp);
10
+ }
11
+ }
12
+
13
+
14
+ // mPDF 5.6.23
15
+ if(!function_exists('array_insert')) {
16
+ function array_insert(&$array, $value, $offset) {
17
+ if (is_array($array)) {
18
+ $array = array_values($array);
19
+ $offset = intval($offset);
20
+ if ($offset < 0 || $offset >= count($array)) { array_push($array, $value); }
21
+ else if ($offset == 0) { array_unshift($array, $value); }
22
+ else {
23
+ $temp = array_slice($array, 0, $offset);
24
+ array_push($temp, $value);
25
+ $array = array_slice($array, $offset);
26
+ $array = array_merge($temp, $array);
27
+ }
28
+ }
29
+ else { $array = array($value); }
30
+ return count($array);
31
+ }
32
+ }
33
+
34
+ function urlencode_part($url) { // mPDF 5.6.02
35
+ if (!preg_match('/^[a-z]+:\/\//i',$url)) { return $url; }
36
+ $file=$url;
37
+ $query='';
38
+ if (preg_match('/[?]/',$url)) {
39
+ $bits = preg_split('/[?]/',$url,2);
40
+ $file=$bits[0];
41
+ $query='?'.$bits[1];
42
+ }
43
+ $file = str_replace(array(" ","!","$","&","'","(",")","*","+",",",";","="),array("%20","%21","%24","%26","%27","%28","%29","%2A","%2B","%2C","%3B","%3D"),$file);
44
+ return $file.$query;
45
+ }
46
+
47
+
48
+ function _strspn($str1, $str2, $start=null, $length=null) {
49
+ $numargs = func_num_args();
50
+ if ($numargs == 2) {
51
+ return strspn($str1, $str2);
52
+ }
53
+ else if ($numargs == 3) {
54
+ return strspn($str1, $str2, $start);
55
+ }
56
+ else {
57
+ return strspn($str1, $str2, $start, $length);
58
+ }
59
+ }
60
+
61
+
62
+ function _strcspn($str1, $str2, $start=null, $length=null) {
63
+ $numargs = func_num_args();
64
+ if ($numargs == 2) {
65
+ return strcspn($str1, $str2);
66
+ }
67
+ else if ($numargs == 3) {
68
+ return strcspn($str1, $str2, $start);
69
+ }
70
+ else {
71
+ return strcspn($str1, $str2, $start, $length);
72
+ }
73
+ }
74
+
75
+ function _fgets (&$h, $force=false) {
76
+ $startpos = ftell($h);
77
+ $s = fgets($h, 1024);
78
+ if ($force && preg_match("/^([^\r\n]*[\r\n]{1,2})(.)/",trim($s), $ns)) {
79
+ $s = $ns[1];
80
+ fseek($h,$startpos+strlen($s));
81
+ }
82
+ return $s;
83
+ }
84
+
85
+
86
+ // For PHP4 compatability
87
+ if(!function_exists('str_ireplace')) {
88
+ function str_ireplace($search,$replace,$subject) {
89
+ $search = preg_quote($search, "/");
90
+ return preg_replace("/".$search."/i", $replace, $subject);
91
+ }
92
+ }
93
+ if(!function_exists('htmlspecialchars_decode')) {
94
+ function htmlspecialchars_decode ($str) {
95
+ return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
96
+ }
97
+ }
98
+
99
+ function PreparePreText($text,$ff='//FF//') {
100
+ $text = htmlspecialchars($text);
101
+ if ($ff) { $text = str_replace($ff,'</pre><formfeed /><pre>',$text); }
102
+ return ('<pre>'.$text.'</pre>');
103
+ }
104
+
105
+ if(!function_exists('strcode2utf')){
106
+ function strcode2utf($str,$lo=true) {
107
+ //converts all the &#nnn; and &#xhhh; in a string to Unicode
108
+ // mPDF 5.7
109
+ if ($lo) {
110
+ $str = preg_replace_callback('/\&\#([0-9]+)\;/m', 'code2utf_lo_callback', $str);
111
+ $str = preg_replace_callback('/\&\#x([0-9a-fA-F]+)\;/m', 'codeHex2utf_lo_callback', $str);
112
+ }
113
+ else {
114
+ $str = preg_replace_callback('/\&\#([0-9]+)\;/m', 'code2utf_callback', $str);
115
+ $str = preg_replace_callback('/\&\#x([0-9a-fA-F]+)\;/m', 'codeHex2utf_callback', $str);
116
+ }
117
+ return $str;
118
+ }
119
+ }
120
+ function code2utf_callback($matches) {
121
+ return code2utf($matches[1], 0);
122
+ }
123
+ function code2utf_lo_callback($matches) {
124
+ return code2utf($matches[1], 1);
125
+ }
126
+ function codeHex2utf_callback($matches) {
127
+ return codeHex2utf($matches[1], 0);
128
+ }
129
+ function codeHex2utf_lo_callback($matches) {
130
+ return codeHex2utf($matches[1], 1);
131
+ }
132
+
133
+ if(!function_exists('code2utf')){
134
+ function code2utf($num,$lo=true){
135
+ //Returns the utf string corresponding to the unicode value
136
+ if ($num<128) {
137
+ if ($lo) return chr($num);
138
+ else return '&#'.$num.';';
139
+ }
140
+ if ($num<2048) return chr(($num>>6)+192).chr(($num&63)+128);
141
+ if ($num<65536) return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);
142
+ if ($num<2097152) return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128);
143
+ return '?';
144
+ }
145
+ }
146
+
147
+
148
+ if(!function_exists('codeHex2utf')){
149
+ function codeHex2utf($hex,$lo=true){
150
+ $num = hexdec($hex);
151
+ if (($num<128) && !$lo) return '&#x'.$hex.';';
152
+ return code2utf($num,$lo);
153
+ }
154
+ }
155
+
156
+
157
+ ?>
mPDF/includes/ind_bn_1_001.volt.php ADDED
@@ -0,0 +1,3164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $volt = array (
3
+ 0 =>
4
+ array (
5
+ 'match' => '0995 09CD 09B7',
6
+ 'replace' => 'E002',
7
+ ),
8
+ 1 =>
9
+ array (
10
+ 'match' => '099C 09CD 099E',
11
+ 'replace' => 'E003',
12
+ ),
13
+ 2 =>
14
+ array (
15
+ 'match' => '09CD 200D',
16
+ 'replace' => '007E',
17
+ ),
18
+ 3 =>
19
+ array (
20
+ 'match' => '09CD 200C',
21
+ 'replace' => '200C',
22
+ ),
23
+ 4 =>
24
+ array (
25
+ 'match' => '200D 09CD',
26
+ 'replace' => '00D0',
27
+ ),
28
+ 5 =>
29
+ array (
30
+ 'match' => '((0995|0996|0997|0998|0999|099A|099B|099C|099D|099E|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9)) 09CD 09B0',
31
+ 'replace' => '\\1 E1CD',
32
+ ),
33
+ 6 =>
34
+ array (
35
+ 'match' => '((0995|0996|0997|0998|0999|099A|099B|099C|099D|099E|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9)) 09B0 09CD',
36
+ 'replace' => '\\1 E068',
37
+ ),
38
+ 7 =>
39
+ array (
40
+ 'match' => '((09BE|09C0|09C1|09C2|09C3|09C4|09CB|09CC|09D7|09BC)) 09CD 09B0',
41
+ 'replace' => '\\1 E1CD',
42
+ ),
43
+ 8 =>
44
+ array (
45
+ 'match' => '((09BE|09C0|09C1|09C2|09C3|09C4|09CB|09CC|09D7|09BC)) 09B0 09CD',
46
+ 'replace' => '\\1 E068',
47
+ ),
48
+ 9 =>
49
+ array (
50
+ 'match' => '(0020) 09CD 09B0',
51
+ 'replace' => '\\1 E1CD',
52
+ ),
53
+ 10 =>
54
+ array (
55
+ 'match' => '(0020) 09B0 09CD',
56
+ 'replace' => '\\1 E068',
57
+ ),
58
+ 11 =>
59
+ array (
60
+ 'match' => '(25CC) 09CD 09B0',
61
+ 'replace' => '\\1 E1CD',
62
+ ),
63
+ 12 =>
64
+ array (
65
+ 'match' => '(25CC) 09B0 09CD',
66
+ 'replace' => '\\1 E068',
67
+ ),
68
+ 13 =>
69
+ array (
70
+ 'match' => '((09B0|E042|E043|E044|E048|E049|E04E|E04F|E050|E051|E052|E053|E054|E056|E057|E058|E059|E05B|E05C|E05D|E05E|E062|E063|E064|E065|E0A8|E0BC|E0EF|E0FD|E101|E11C|E11E|E14F|E151|E152|E164|E17D|E18E|E190)) 09C1',
71
+ 'replace' => '\\1 E03C',
72
+ ),
73
+ 14 =>
74
+ array (
75
+ 'match' => '((09B0|E042|E043|E044|E048|E049|E04E|E04F|E050|E051|E052|E053|E054|E056|E057|E058|E059|E05B|E05C|E05D|E05E|E062|E063|E064|E065|E0A8|E0BC|E0EF|E0FD|E101|E11C|E11E|E14F|E151|E152|E164|E17D|E18E|E190)) 09C2',
76
+ 'replace' => '\\1 E03E',
77
+ ),
78
+ 15 =>
79
+ array (
80
+ 'match' => '((E045|E046|E047|E04A|E04B|E04C|E04D|E05F|E060|E061|E07C|E07D|E0B1|E0E8|E0E9|E11A|E11B|E163|E17B|E18D)) 09C1',
81
+ 'replace' => '\\1 E03D',
82
+ ),
83
+ 16 =>
84
+ array (
85
+ 'match' => 'E068 0981',
86
+ 'replace' => 'E069',
87
+ ),
88
+ 17 =>
89
+ array (
90
+ 'match' => '0995 09CD 0995',
91
+ 'replace' => 'E06A',
92
+ ),
93
+ 18 =>
94
+ array (
95
+ 'match' => '0995 09CD 0996',
96
+ 'replace' => 'E06B',
97
+ ),
98
+ 19 =>
99
+ array (
100
+ 'match' => '0995 09CD 099A',
101
+ 'replace' => 'E06C',
102
+ ),
103
+ 20 =>
104
+ array (
105
+ 'match' => '0995 09CD 099B',
106
+ 'replace' => 'E06D',
107
+ ),
108
+ 21 =>
109
+ array (
110
+ 'match' => '0995 09CD 099F',
111
+ 'replace' => 'E06E',
112
+ ),
113
+ 22 =>
114
+ array (
115
+ 'match' => '0995 09CD 09A0',
116
+ 'replace' => 'E06F',
117
+ ),
118
+ 23 =>
119
+ array (
120
+ 'match' => '0995 09CD 09A3',
121
+ 'replace' => 'E070',
122
+ ),
123
+ 24 =>
124
+ array (
125
+ 'match' => '0995 09CD 09A4',
126
+ 'replace' => 'E071',
127
+ ),
128
+ 25 =>
129
+ array (
130
+ 'match' => '0995 09CD 09A5',
131
+ 'replace' => 'E072',
132
+ ),
133
+ 26 =>
134
+ array (
135
+ 'match' => '0995 09CD 09A8',
136
+ 'replace' => 'E073',
137
+ ),
138
+ 27 =>
139
+ array (
140
+ 'match' => '0995 09CD 09AA',
141
+ 'replace' => 'E074',
142
+ ),
143
+ 28 =>
144
+ array (
145
+ 'match' => '0995 09CD 09AB',
146
+ 'replace' => 'E075',
147
+ ),
148
+ 29 =>
149
+ array (
150
+ 'match' => '0995 09CD 09AE',
151
+ 'replace' => 'E076',
152
+ ),
153
+ 30 =>
154
+ array (
155
+ 'match' => '0995 09CD 09B2',
156
+ 'replace' => 'E077',
157
+ ),
158
+ 31 =>
159
+ array (
160
+ 'match' => '0995 09CD 09AC',
161
+ 'replace' => 'E078',
162
+ ),
163
+ 32 =>
164
+ array (
165
+ 'match' => '0995 09CD 09B6',
166
+ 'replace' => 'E079',
167
+ ),
168
+ 33 =>
169
+ array (
170
+ 'match' => '0995 09CD 09B8',
171
+ 'replace' => 'E07A',
172
+ ),
173
+ 34 =>
174
+ array (
175
+ 'match' => '0996 09CD 0996',
176
+ 'replace' => 'E083',
177
+ ),
178
+ 35 =>
179
+ array (
180
+ 'match' => '0996 09CD 09A4',
181
+ 'replace' => 'E084',
182
+ ),
183
+ 36 =>
184
+ array (
185
+ 'match' => '0996 09CD 09A8',
186
+ 'replace' => 'E085',
187
+ ),
188
+ 37 =>
189
+ array (
190
+ 'match' => '0996 09CD 09AE',
191
+ 'replace' => 'E086',
192
+ ),
193
+ 38 =>
194
+ array (
195
+ 'match' => '0996 09CD 09AC',
196
+ 'replace' => 'E087',
197
+ ),
198
+ 39 =>
199
+ array (
200
+ 'match' => '0997 09CD 0997',
201
+ 'replace' => 'E088',
202
+ ),
203
+ 40 =>
204
+ array (
205
+ 'match' => '0997 09CD 0998',
206
+ 'replace' => 'E089',
207
+ ),
208
+ 41 =>
209
+ array (
210
+ 'match' => '0997 09CD 099C',
211
+ 'replace' => 'E08A',
212
+ ),
213
+ 42 =>
214
+ array (
215
+ 'match' => '0997 09CD 099D',
216
+ 'replace' => 'E08B',
217
+ ),
218
+ 43 =>
219
+ array (
220
+ 'match' => '0997 09CD 09A1',
221
+ 'replace' => 'E08C',
222
+ ),
223
+ 44 =>
224
+ array (
225
+ 'match' => '0997 09CD 09A2',
226
+ 'replace' => 'E08D',
227
+ ),
228
+ 45 =>
229
+ array (
230
+ 'match' => '0997 09CD 09A3',
231
+ 'replace' => 'E08E',
232
+ ),
233
+ 46 =>
234
+ array (
235
+ 'match' => '0997 09CD 09A6',
236
+ 'replace' => 'E08F',
237
+ ),
238
+ 47 =>
239
+ array (
240
+ 'match' => '0997 09CD 09A7',
241
+ 'replace' => 'E090',
242
+ ),
243
+ 48 =>
244
+ array (
245
+ 'match' => '0997 09CD 09A8',
246
+ 'replace' => 'E091',
247
+ ),
248
+ 49 =>
249
+ array (
250
+ 'match' => '0997 09CD 09AB',
251
+ 'replace' => 'E092',
252
+ ),
253
+ 50 =>
254
+ array (
255
+ 'match' => '0997 09CD 09AC',
256
+ 'replace' => 'E093',
257
+ ),
258
+ 51 =>
259
+ array (
260
+ 'match' => '0997 09CD 09AD',
261
+ 'replace' => 'E094',
262
+ ),
263
+ 52 =>
264
+ array (
265
+ 'match' => '0997 09CD 09AE',
266
+ 'replace' => 'E095',
267
+ ),
268
+ 53 =>
269
+ array (
270
+ 'match' => '0997 09CD 09B2',
271
+ 'replace' => 'E096',
272
+ ),
273
+ 54 =>
274
+ array (
275
+ 'match' => '0998 09CD 09A8',
276
+ 'replace' => 'E099',
277
+ ),
278
+ 55 =>
279
+ array (
280
+ 'match' => '0998 09CD 09AE',
281
+ 'replace' => 'E09A',
282
+ ),
283
+ 56 =>
284
+ array (
285
+ 'match' => '0998 09CD 09AC',
286
+ 'replace' => 'E09B',
287
+ ),
288
+ 57 =>
289
+ array (
290
+ 'match' => '0999 09CD 0995',
291
+ 'replace' => 'E09C',
292
+ ),
293
+ 58 =>
294
+ array (
295
+ 'match' => '0999 09CD 0996',
296
+ 'replace' => 'E09D',
297
+ ),
298
+ 59 =>
299
+ array (
300
+ 'match' => '0999 09CD 0997',
301
+ 'replace' => 'E09E',
302
+ ),
303
+ 60 =>
304
+ array (
305
+ 'match' => '0999 09CD 0998',
306
+ 'replace' => 'E09F',
307
+ ),
308
+ 61 =>
309
+ array (
310
+ 'match' => '0999 09CD 09A8',
311
+ 'replace' => 'E0A0',
312
+ ),
313
+ 62 =>
314
+ array (
315
+ 'match' => '0999 09CD 09AD',
316
+ 'replace' => 'E0A1',
317
+ ),
318
+ 63 =>
319
+ array (
320
+ 'match' => '0999 09CD 09AE',
321
+ 'replace' => 'E0A2',
322
+ ),
323
+ 64 =>
324
+ array (
325
+ 'match' => '0999 09CD 09AC',
326
+ 'replace' => 'E0A3',
327
+ ),
328
+ 65 =>
329
+ array (
330
+ 'match' => '0999 09CD 09B6',
331
+ 'replace' => 'E0A4',
332
+ ),
333
+ 66 =>
334
+ array (
335
+ 'match' => '0999 09CD 09B7',
336
+ 'replace' => 'E0A5',
337
+ ),
338
+ 67 =>
339
+ array (
340
+ 'match' => '0999 09CD 09B9',
341
+ 'replace' => 'E0A6',
342
+ ),
343
+ 68 =>
344
+ array (
345
+ 'match' => '099A 09CD 099A',
346
+ 'replace' => 'E0AC',
347
+ ),
348
+ 69 =>
349
+ array (
350
+ 'match' => '099A 09CD 099B',
351
+ 'replace' => 'E0AD',
352
+ ),
353
+ 70 =>
354
+ array (
355
+ 'match' => '099A 09CD 099E',
356
+ 'replace' => 'E0AE',
357
+ ),
358
+ 71 =>
359
+ array (
360
+ 'match' => '099A 09CD 09AE',
361
+ 'replace' => 'E0AF',
362
+ ),
363
+ 72 =>
364
+ array (
365
+ 'match' => '099A 09CD 09AC',
366
+ 'replace' => 'E0B0',
367
+ ),
368
+ 73 =>
369
+ array (
370
+ 'match' => '099B 09CD 099B',
371
+ 'replace' => 'E0B4',
372
+ ),
373
+ 74 =>
374
+ array (
375
+ 'match' => '099B 09CD 09B2',
376
+ 'replace' => 'E0B5',
377
+ ),
378
+ 75 =>
379
+ array (
380
+ 'match' => '099B 09CD 09AC',
381
+ 'replace' => 'E0B6',
382
+ ),
383
+ 76 =>
384
+ array (
385
+ 'match' => '099C 09CD 099C',
386
+ 'replace' => 'E0B7',
387
+ ),
388
+ 77 =>
389
+ array (
390
+ 'match' => '099C 09CD 099D',
391
+ 'replace' => 'E0B8',
392
+ ),
393
+ 78 =>
394
+ array (
395
+ 'match' => '099C 09CD 09A6',
396
+ 'replace' => 'E0B9',
397
+ ),
398
+ 79 =>
399
+ array (
400
+ 'match' => '099C 09CD 09AC',
401
+ 'replace' => 'E0BA',
402
+ ),
403
+ 80 =>
404
+ array (
405
+ 'match' => '099C 09CD 09AE',
406
+ 'replace' => 'E0BB',
407
+ ),
408
+ 81 =>
409
+ array (
410
+ 'match' => '099D 09CD 099D',
411
+ 'replace' => 'E0BE',
412
+ ),
413
+ 82 =>
414
+ array (
415
+ 'match' => '099D 09CD 09AE',
416
+ 'replace' => 'E0BF',
417
+ ),
418
+ 83 =>
419
+ array (
420
+ 'match' => '099D 09CD 09AC',
421
+ 'replace' => 'E0C0',
422
+ ),
423
+ 84 =>
424
+ array (
425
+ 'match' => '099E 09CD 099A',
426
+ 'replace' => 'E0C1',
427
+ ),
428
+ 85 =>
429
+ array (
430
+ 'match' => '099E 09CD 099B',
431
+ 'replace' => 'E0C2',
432
+ ),
433
+ 86 =>
434
+ array (
435
+ 'match' => '099E 09CD 099C',
436
+ 'replace' => 'E0C3',
437
+ ),
438
+ 87 =>
439
+ array (
440
+ 'match' => '099E 09CD 099D',
441
+ 'replace' => 'E0C4',
442
+ ),
443
+ 88 =>
444
+ array (
445
+ 'match' => '099E 09CD 09B6',
446
+ 'replace' => 'E0C5',
447
+ ),
448
+ 89 =>
449
+ array (
450
+ 'match' => '099F 09CD 0995',
451
+ 'replace' => 'E0C6',
452
+ ),
453
+ 90 =>
454
+ array (
455
+ 'match' => '099F 09CD 0996',
456
+ 'replace' => 'E0C7',
457
+ ),
458
+ 91 =>
459
+ array (
460
+ 'match' => '099F 09CD 099A',
461
+ 'replace' => 'E0C8',
462
+ ),
463
+ 92 =>
464
+ array (
465
+ 'match' => '099F 09CD 099B',
466
+ 'replace' => 'E0C9',
467
+ ),
468
+ 93 =>
469
+ array (
470
+ 'match' => '099F 09CD 099F',
471
+ 'replace' => 'E0CA',
472
+ ),
473
+ 94 =>
474
+ array (
475
+ 'match' => '099F 09CD 09A0',
476
+ 'replace' => 'E0CB',
477
+ ),
478
+ 95 =>
479
+ array (
480
+ 'match' => '099F 09CD 09A4',
481
+ 'replace' => 'E0CC',
482
+ ),
483
+ 96 =>
484
+ array (
485
+ 'match' => '099F 09CD 09A5',
486
+ 'replace' => 'E0CD',
487
+ ),
488
+ 97 =>
489
+ array (
490
+ 'match' => '099F 09CD 09AA',
491
+ 'replace' => 'E0CE',
492
+ ),
493
+ 98 =>
494
+ array (
495
+ 'match' => '099F 09CD 09AB',
496
+ 'replace' => 'E0CF',
497
+ ),
498
+ 99 =>
499
+ array (
500
+ 'match' => '099F 09CD 09AC',
501
+ 'replace' => 'E0D0',
502
+ ),
503
+ 100 =>
504
+ array (
505
+ 'match' => '099F 09CD 09AE',
506
+ 'replace' => 'E0D1',
507
+ ),
508
+ 101 =>
509
+ array (
510
+ 'match' => '099F 09CD 09B6',
511
+ 'replace' => 'E0D2',
512
+ ),
513
+ 102 =>
514
+ array (
515
+ 'match' => '099F 09CD 09B7',
516
+ 'replace' => 'E0D3',
517
+ ),
518
+ 103 =>
519
+ array (
520
+ 'match' => '099F 09CD 09B8',
521
+ 'replace' => 'E0D4',
522
+ ),
523
+ 104 =>
524
+ array (
525
+ 'match' => '09A0 09CD 09A0',
526
+ 'replace' => 'E0D5',
527
+ ),
528
+ 105 =>
529
+ array (
530
+ 'match' => '09A0 09CD 09A3',
531
+ 'replace' => 'E0D6',
532
+ ),
533
+ 106 =>
534
+ array (
535
+ 'match' => '09A0 09CD 09AC',
536
+ 'replace' => 'E0D7',
537
+ ),
538
+ 107 =>
539
+ array (
540
+ 'match' => '09A1 09CD 0997',
541
+ 'replace' => 'E0D8',
542
+ ),
543
+ 108 =>
544
+ array (
545
+ 'match' => '09A1 09CD 09A1',
546
+ 'replace' => 'E0D9',
547
+ ),
548
+ 109 =>
549
+ array (
550
+ 'match' => '09A1 09CD 09A2',
551
+ 'replace' => 'E0DA',
552
+ ),
553
+ 110 =>
554
+ array (
555
+ 'match' => '09A1 09CD 09AE',
556
+ 'replace' => 'E0DB',
557
+ ),
558
+ 111 =>
559
+ array (
560
+ 'match' => '09A1 09CD 09AC',
561
+ 'replace' => 'E0DC',
562
+ ),
563
+ 112 =>
564
+ array (
565
+ 'match' => '09A2 09CD 09A2',
566
+ 'replace' => 'E0DD',
567
+ ),
568
+ 113 =>
569
+ array (
570
+ 'match' => '09A2 09CD 09A3',
571
+ 'replace' => 'E0DE',
572
+ ),
573
+ 114 =>
574
+ array (
575
+ 'match' => '09A2 09CD 09AC',
576
+ 'replace' => 'E0DF',
577
+ ),
578
+ 115 =>
579
+ array (
580
+ 'match' => '09A3 09CD 099F',
581
+ 'replace' => 'E0E0',
582
+ ),
583
+ 116 =>
584
+ array (
585
+ 'match' => '09A3 09CD 09A0',
586
+ 'replace' => 'E0E1',
587
+ ),
588
+ 117 =>
589
+ array (
590
+ 'match' => '09A3 09CD 09A1',
591
+ 'replace' => 'E0E2',
592
+ ),
593
+ 118 =>
594
+ array (
595
+ 'match' => '09A3 09CD 09A2',
596
+ 'replace' => 'E0E3',
597
+ ),
598
+ 119 =>
599
+ array (
600
+ 'match' => '09A3 09CD 09A3',
601
+ 'replace' => 'E0E4',
602
+ ),
603
+ 120 =>
604
+ array (
605
+ 'match' => '09A3 09CD 09AE',
606
+ 'replace' => 'E0E5',
607
+ ),
608
+ 121 =>
609
+ array (
610
+ 'match' => '09A3 09CD 09AC',
611
+ 'replace' => 'E0E6',
612
+ ),
613
+ 122 =>
614
+ array (
615
+ 'match' => '09A3 09CD 09B8',
616
+ 'replace' => 'E0E7',
617
+ ),
618
+ 123 =>
619
+ array (
620
+ 'match' => '09A4 09CD 09A4',
621
+ 'replace' => 'E0EA',
622
+ ),
623
+ 124 =>
624
+ array (
625
+ 'match' => '09A4 09CD 09A5',
626
+ 'replace' => 'E0EB',
627
+ ),
628
+ 125 =>
629
+ array (
630
+ 'match' => '09A4 09CD 09A8',
631
+ 'replace' => 'E0EC',
632
+ ),
633
+ 126 =>
634
+ array (
635
+ 'match' => '09A4 09CD 09AE',
636
+ 'replace' => 'E0ED',
637
+ ),
638
+ 127 =>
639
+ array (
640
+ 'match' => '09A4 09CD 09AC',
641
+ 'replace' => 'E0EE',
642
+ ),
643
+ 128 =>
644
+ array (
645
+ 'match' => '09A5 09CD 09A5',
646
+ 'replace' => 'E0F1',
647
+ ),
648
+ 129 =>
649
+ array (
650
+ 'match' => '09A5 09CD 09A8',
651
+ 'replace' => 'E0F2',
652
+ ),
653
+ 130 =>
654
+ array (
655
+ 'match' => '09A5 09CD 09AC',
656
+ 'replace' => 'E0F3',
657
+ ),
658
+ 131 =>
659
+ array (
660
+ 'match' => '09A6 09CD 0997',
661
+ 'replace' => 'E0F4',
662
+ ),
663
+ 132 =>
664
+ array (
665
+ 'match' => '09A6 09CD 0998',
666
+ 'replace' => 'E0F5',
667
+ ),
668
+ 133 =>
669
+ array (
670
+ 'match' => '09A6 09CD 09A6',
671
+ 'replace' => 'E0F6',
672
+ ),
673
+ 134 =>
674
+ array (
675
+ 'match' => '09A6 09CD 09A7',
676
+ 'replace' => 'E0F7',
677
+ ),
678
+ 135 =>
679
+ array (
680
+ 'match' => '09A6 09CD 09A8',
681
+ 'replace' => 'E0F8',
682
+ ),
683
+ 136 =>
684
+ array (
685
+ 'match' => '09A6 09CD 09AC',
686
+ 'replace' => 'E0F9',
687
+ ),
688
+ 137 =>
689
+ array (
690
+ 'match' => '09A6 09CD 09AE',
691
+ 'replace' => 'E0FB',
692
+ ),
693
+ 138 =>
694
+ array (
695
+ 'match' => '09A6 09CD 09AF',
696
+ 'replace' => 'E0FC',
697
+ ),
698
+ 139 =>
699
+ array (
700
+ 'match' => '09A7 09CD 09A7',
701
+ 'replace' => 'E102',
702
+ ),
703
+ 140 =>
704
+ array (
705
+ 'match' => '09A7 09CD 09A8',
706
+ 'replace' => 'E103',
707
+ ),
708
+ 141 =>
709
+ array (
710
+ 'match' => '09A7 09CD 09AE',
711
+ 'replace' => 'E104',
712
+ ),
713
+ 142 =>
714
+ array (
715
+ 'match' => '09A7 09CD 09AC',
716
+ 'replace' => 'E105',
717
+ ),
718
+ 143 =>
719
+ array (
720
+ 'match' => '09A8 09CD 0995',
721
+ 'replace' => 'E106',
722
+ ),
723
+ 144 =>
724
+ array (
725
+ 'match' => '09A8 09CD 0997',
726
+ 'replace' => 'E107',
727
+ ),
728
+ 145 =>
729
+ array (
730
+ 'match' => '09A8 09CD 099A',
731
+ 'replace' => 'E108',
732
+ ),
733
+ 146 =>
734
+ array (
735
+ 'match' => '09A8 09CD 099C',
736
+ 'replace' => 'E109',
737
+ ),
738
+ 147 =>
739
+ array (
740
+ 'match' => '09A8 09CD 099F',
741
+ 'replace' => 'E10A',
742
+ ),
743
+ 148 =>
744
+ array (
745
+ 'match' => '09A8 09CD 09A0',
746
+ 'replace' => 'E10B',
747
+ ),
748
+ 149 =>
749
+ array (
750
+ 'match' => '09A8 09CD 09A1',
751
+ 'replace' => 'E10C',
752
+ ),
753
+ 150 =>
754
+ array (
755
+ 'match' => '09A8 09CD 09A4',
756
+ 'replace' => 'E10D',
757
+ ),
758
+ 151 =>
759
+ array (
760
+ 'match' => '09A8 09CD 09A5',
761
+ 'replace' => 'E10E',
762
+ ),
763
+ 152 =>
764
+ array (
765
+ 'match' => '09A8 09CD 09A6',
766
+ 'replace' => 'E10F',
767
+ ),
768
+ 153 =>
769
+ array (
770
+ 'match' => '09A8 09CD 09A7',
771
+ 'replace' => 'E110',
772
+ ),
773
+ 154 =>
774
+ array (
775
+ 'match' => '09A8 09CD 09A8',
776
+ 'replace' => 'E111',
777
+ ),
778
+ 155 =>
779
+ array (
780
+ 'match' => '09A8 09CD 09AB',
781
+ 'replace' => 'E112',
782
+ ),
783
+ 156 =>
784
+ array (
785
+ 'match' => '09A8 09CD 09AD',
786
+ 'replace' => 'E113',
787
+ ),
788
+ 157 =>
789
+ array (
790
+ 'match' => '09A8 09CD 09AE',
791
+ 'replace' => 'E114',
792
+ ),
793
+ 158 =>
794
+ array (
795
+ 'match' => '09A8 09CD 09AF',
796
+ 'replace' => 'E115',
797
+ ),
798
+ 159 =>
799
+ array (
800
+ 'match' => '09A8 09CD 09AC',
801
+ 'replace' => 'E116',
802
+ ),
803
+ 160 =>
804
+ array (
805
+ 'match' => '09A8 09CD 09B6',
806
+ 'replace' => 'E117',
807
+ ),
808
+ 161 =>
809
+ array (
810
+ 'match' => '09A8 09CD 09B7',
811
+ 'replace' => 'E118',
812
+ ),
813
+ 162 =>
814
+ array (
815
+ 'match' => '09A8 09CD 09B8',
816
+ 'replace' => 'E119',
817
+ ),
818
+ 163 =>
819
+ array (
820
+ 'match' => '09AA 09CD 0995',
821
+ 'replace' => 'E122',
822
+ ),
823
+ 164 =>
824
+ array (
825
+ 'match' => '09AA 09CD 0996',
826
+ 'replace' => 'E123',
827
+ ),
828
+ 165 =>
829
+ array (
830
+ 'match' => '09AA 09CD 099A',
831
+ 'replace' => 'E124',
832
+ ),
833
+ 166 =>
834
+ array (
835
+ 'match' => '09AA 09CD 099B',
836
+ 'replace' => 'E125',
837
+ ),
838
+ 167 =>
839
+ array (
840
+ 'match' => '09AA 09CD 099F',
841
+ 'replace' => 'E126',
842
+ ),
843
+ 168 =>
844
+ array (
845
+ 'match' => '09AA 09CD 09A0',
846
+ 'replace' => 'E127',
847
+ ),
848
+ 169 =>
849
+ array (
850
+ 'match' => '09AA 09CD 09A4',
851
+ 'replace' => 'E128',
852
+ ),
853
+ 170 =>
854
+ array (
855
+ 'match' => '09AA 09CD 09A8',
856
+ 'replace' => 'E129',
857
+ ),
858
+ 171 =>
859
+ array (
860
+ 'match' => '09AA 09CD 09AA',
861
+ 'replace' => 'E12A',
862
+ ),
863
+ 172 =>
864
+ array (
865
+ 'match' => '09AA 09CD 09AB',
866
+ 'replace' => 'E12B',
867
+ ),
868
+ 173 =>
869
+ array (
870
+ 'match' => '09AA 09CD 09AE',
871
+ 'replace' => 'E12C',
872
+ ),
873
+ 174 =>
874
+ array (
875
+ 'match' => '09AA 09CD 09B2',
876
+ 'replace' => 'E12D',
877
+ ),
878
+ 175 =>
879
+ array (
880
+ 'match' => '09AA 09CD 09AC',
881
+ 'replace' => 'E12E',
882
+ ),
883
+ 176 =>
884
+ array (
885
+ 'match' => '09AA 09CD 09B6',
886
+ 'replace' => 'E12F',
887
+ ),
888
+ 177 =>
889
+ array (
890
+ 'match' => '09AA 09CD 09B7',
891
+ 'replace' => 'E130',
892
+ ),
893
+ 178 =>
894
+ array (
895
+ 'match' => '09AA 09CD 09B8',
896
+ 'replace' => 'E131',
897
+ ),
898
+ 179 =>
899
+ array (
900
+ 'match' => '09AB 09CD 099F',
901
+ 'replace' => 'E132',
902
+ ),
903
+ 180 =>
904
+ array (
905
+ 'match' => '09AB 09CD 09A4',
906
+ 'replace' => 'E133',
907
+ ),
908
+ 181 =>
909
+ array (
910
+ 'match' => '09AB 09CD 09AA',
911
+ 'replace' => 'E134',
912
+ ),
913
+ 182 =>
914
+ array (
915
+ 'match' => '09AB 09CD 09AB',
916
+ 'replace' => 'E135',
917
+ ),
918
+ 183 =>
919
+ array (
920
+ 'match' => '09AB 09CD 09B2',
921
+ 'replace' => 'E136',
922
+ ),
923
+ 184 =>
924
+ array (
925
+ 'match' => '09AC 09CD 099C',
926
+ 'replace' => 'E137',
927
+ ),
928
+ 185 =>
929
+ array (
930
+ 'match' => '09AC 09CD 099D',
931
+ 'replace' => 'E138',
932
+ ),
933
+ 186 =>
934
+ array (
935
+ 'match' => '09AC 09CD 09A1',
936
+ 'replace' => 'E139',
937
+ ),
938
+ 187 =>
939
+ array (
940
+ 'match' => '09AC 09CD 09A2',
941
+ 'replace' => 'E13A',
942
+ ),
943
+ 188 =>
944
+ array (
945
+ 'match' => '09AC 09CD 09A6',
946
+ 'replace' => 'E13B',
947
+ ),
948
+ 189 =>
949
+ array (
950
+ 'match' => '09AC 09CD 09A7',
951
+ 'replace' => 'E13C',
952
+ ),
953
+ 190 =>
954
+ array (
955
+ 'match' => '09AC 09CD 09A8',
956
+ 'replace' => 'E13D',
957
+ ),
958
+ 191 =>
959
+ array (
960
+ 'match' => '09AC 09CD 09B2',
961
+ 'replace' => 'E13E',
962
+ ),
963
+ 192 =>
964
+ array (
965
+ 'match' => '09AC 09CD 09AC',
966
+ 'replace' => 'E13F',
967
+ ),
968
+ 193 =>
969
+ array (
970
+ 'match' => '09AD 09CD 09A3',
971
+ 'replace' => 'E141',
972
+ ),
973
+ 194 =>
974
+ array (
975
+ 'match' => '09AD 09CD 09A8',
976
+ 'replace' => 'E142',
977
+ ),
978
+ 195 =>
979
+ array (
980
+ 'match' => '09AD 09CD 09AD',
981
+ 'replace' => 'E143',
982
+ ),
983
+ 196 =>
984
+ array (
985
+ 'match' => '09AD 09CD 09AE',
986
+ 'replace' => 'E144',
987
+ ),
988
+ 197 =>
989
+ array (
990
+ 'match' => '09AD 09CD 09B2',
991
+ 'replace' => 'E145',
992
+ ),
993
+ 198 =>
994
+ array (
995
+ 'match' => '09AD 09CD 09AC',
996
+ 'replace' => 'E146',
997
+ ),
998
+ 199 =>
999
+ array (
1000
+ 'match' => '09AE 09CD 09A3',
1001
+ 'replace' => 'E147',
1002
+ ),
1003
+ 200 =>
1004
+ array (
1005
+ 'match' => '09AE 09CD 09A8',
1006
+ 'replace' => 'E148',
1007
+ ),
1008
+ 201 =>
1009
+ array (
1010
+ 'match' => '09AE 09CD 09AA',
1011
+ 'replace' => 'E149',
1012
+ ),
1013
+ 202 =>
1014
+ array (
1015
+ 'match' => '09AE 09CD 09AB',
1016
+ 'replace' => 'E14A',
1017
+ ),
1018
+ 203 =>
1019
+ array (
1020
+ 'match' => '09AE 09CD 09AC',
1021
+ 'replace' => 'E14B',
1022
+ ),
1023
+ 204 =>
1024
+ array (
1025
+ 'match' => '09AE 09CD 09AD',
1026
+ 'replace' => 'E14C',
1027
+ ),
1028
+ 205 =>
1029
+ array (
1030
+ 'match' => '09AE 09CD 09AE',
1031
+ 'replace' => 'E14D',
1032
+ ),
1033
+ 206 =>
1034
+ array (
1035
+ 'match' => '09AE 09CD 09B2',
1036
+ 'replace' => 'E14E',
1037
+ ),
1038
+ 207 =>
1039
+ array (
1040
+ 'match' => '09B2 09CD 0995',
1041
+ 'replace' => 'E153',
1042
+ ),
1043
+ 208 =>
1044
+ array (
1045
+ 'match' => '09B2 09CD 0996',
1046
+ 'replace' => 'E154',
1047
+ ),
1048
+ 209 =>
1049
+ array (
1050
+ 'match' => '09B2 09CD 0997',
1051
+ 'replace' => 'E155',
1052
+ ),
1053
+ 210 =>
1054
+ array (
1055
+ 'match' => '09B2 09CD 099A',
1056
+ 'replace' => 'E156',
1057
+ ),
1058
+ 211 =>
1059
+ array (
1060
+ 'match' => '09B2 09CD 099C',
1061
+ 'replace' => 'E157',
1062
+ ),
1063
+ 212 =>
1064
+ array (
1065
+ 'match' => '09B2 09CD 099F',
1066
+ 'replace' => 'E158',
1067
+ ),
1068
+ 213 =>
1069
+ array (
1070
+ 'match' => '09B2 09CD 09A1',
1071
+ 'replace' => 'E159',
1072
+ ),
1073
+ 214 =>
1074
+ array (
1075
+ 'match' => '09B2 09CD 09A6',
1076
+ 'replace' => 'E15A',
1077
+ ),
1078
+ 215 =>
1079
+ array (
1080
+ 'match' => '09B2 09CD 09AA',
1081
+ 'replace' => 'E15B',
1082
+ ),
1083
+ 216 =>
1084
+ array (
1085
+ 'match' => '09B2 09CD 09AB',
1086
+ 'replace' => 'E15C',
1087
+ ),
1088
+ 217 =>
1089
+ array (
1090
+ 'match' => '09B2 09CD 09AC',
1091
+ 'replace' => 'E15D',
1092
+ ),
1093
+ 218 =>
1094
+ array (
1095
+ 'match' => '09B2 09CD 09AE',
1096
+ 'replace' => 'E15E',
1097
+ ),
1098
+ 219 =>
1099
+ array (
1100
+ 'match' => '09B2 09CD 09B2',
1101
+ 'replace' => 'E15F',
1102
+ ),
1103
+ 220 =>
1104
+ array (
1105
+ 'match' => '09B2 09CD 09B6',
1106
+ 'replace' => 'E160',
1107
+ ),
1108
+ 221 =>
1109
+ array (
1110
+ 'match' => '09B2 09CD 09B8',
1111
+ 'replace' => 'E161',
1112
+ ),
1113
+ 222 =>
1114
+ array (
1115
+ 'match' => '09B2 09CD 09B9',
1116
+ 'replace' => 'E162',
1117
+ ),
1118
+ 223 =>
1119
+ array (
1120
+ 'match' => '09B6 09CD 0995',
1121
+ 'replace' => 'E166',
1122
+ ),
1123
+ 224 =>
1124
+ array (
1125
+ 'match' => '09B6 09CD 099A',
1126
+ 'replace' => 'E167',
1127
+ ),
1128
+ 225 =>
1129
+ array (
1130
+ 'match' => '09B6 09CD 099B',
1131
+ 'replace' => 'E168',
1132
+ ),
1133
+ 226 =>
1134
+ array (
1135
+ 'match' => '09B6 09CD 09A4',
1136
+ 'replace' => 'E169',
1137
+ ),
1138
+ 227 =>
1139
+ array (
1140
+ 'match' => '09B6 09CD 09A8',
1141
+ 'replace' => 'E16A',
1142
+ ),
1143
+ 228 =>
1144
+ array (
1145
+ 'match' => '09B6 09CD 09AA',
1146
+ 'replace' => 'E16B',
1147
+ ),
1148
+ 229 =>
1149
+ array (
1150
+ 'match' => '09B6 09CD 09AE',
1151
+ 'replace' => 'E16C',
1152
+ ),
1153
+ 230 =>
1154
+ array (
1155
+ 'match' => '09B6 09CD 09AF',
1156
+ 'replace' => 'E16D',
1157
+ ),
1158
+ 231 =>
1159
+ array (
1160
+ 'match' => '09B6 09CD 09B2',
1161
+ 'replace' => 'E16E',
1162
+ ),
1163
+ 232 =>
1164
+ array (
1165
+ 'match' => '09B6 09CD 09AC',
1166
+ 'replace' => 'E16F',
1167
+ ),
1168
+ 233 =>
1169
+ array (
1170
+ 'match' => '09B6 09CD 09B6',
1171
+ 'replace' => 'E170',
1172
+ ),
1173
+ 234 =>
1174
+ array (
1175
+ 'match' => '09B7 09CD 0995',
1176
+ 'replace' => 'E171',
1177
+ ),
1178
+ 235 =>
1179
+ array (
1180
+ 'match' => '09B7 09CD 099F',
1181
+ 'replace' => 'E172',
1182
+ ),
1183
+ 236 =>
1184
+ array (
1185
+ 'match' => '09B7 09CD 09A0',
1186
+ 'replace' => 'E173',
1187
+ ),
1188
+ 237 =>
1189
+ array (
1190
+ 'match' => '09B7 09CD 09A3',
1191
+ 'replace' => 'E174',
1192
+ ),
1193
+ 238 =>
1194
+ array (
1195
+ 'match' => '09B7 09CD 09AA',
1196
+ 'replace' => 'E175',
1197
+ ),
1198
+ 239 =>
1199
+ array (
1200
+ 'match' => '09B7 09CD 09AB',
1201
+ 'replace' => 'E176',
1202
+ ),
1203
+ 240 =>
1204
+ array (
1205
+ 'match' => '09B7 09CD 09AE',
1206
+ 'replace' => 'E177',
1207
+ ),
1208
+ 241 =>
1209
+ array (
1210
+ 'match' => '09B7 09CD 09AF',
1211
+ 'replace' => 'E178',
1212
+ ),
1213
+ 242 =>
1214
+ array (
1215
+ 'match' => '09B7 09CD 09AC',
1216
+ 'replace' => 'E179',
1217
+ ),
1218
+ 243 =>
1219
+ array (
1220
+ 'match' => '09B8 09CD 0995',
1221
+ 'replace' => 'E17E',
1222
+ ),
1223
+ 244 =>
1224
+ array (
1225
+ 'match' => '09B8 09CD 0996',
1226
+ 'replace' => 'E17F',
1227
+ ),
1228
+ 245 =>
1229
+ array (
1230
+ 'match' => '09B8 09CD 099C',
1231
+ 'replace' => 'E180',
1232
+ ),
1233
+ 246 =>
1234
+ array (
1235
+ 'match' => '09B8 09CD 099F',
1236
+ 'replace' => 'E181',
1237
+ ),
1238
+ 247 =>
1239
+ array (
1240
+ 'match' => '09B8 09CD 09A4',
1241
+ 'replace' => 'E182',
1242
+ ),
1243
+ 248 =>
1244
+ array (
1245
+ 'match' => '09B8 09CD 09A5',
1246
+ 'replace' => 'E183',
1247
+ ),
1248
+ 249 =>
1249
+ array (
1250
+ 'match' => '09B8 09CD 09A8',
1251
+ 'replace' => 'E184',
1252
+ ),
1253
+ 250 =>
1254
+ array (
1255
+ 'match' => '09B8 09CD 09AA',
1256
+ 'replace' => 'E185',
1257
+ ),
1258
+ 251 =>
1259
+ array (
1260
+ 'match' => '09B8 09CD 09AB',
1261
+ 'replace' => 'E186',
1262
+ ),
1263
+ 252 =>
1264
+ array (
1265
+ 'match' => '09B8 09CD 09AE',
1266
+ 'replace' => 'E187',
1267
+ ),
1268
+ 253 =>
1269
+ array (
1270
+ 'match' => '09B8 09CD 09AF',
1271
+ 'replace' => 'E188',
1272
+ ),
1273
+ 254 =>
1274
+ array (
1275
+ 'match' => '09B8 09CD 09B2',
1276
+ 'replace' => 'E189',
1277
+ ),
1278
+ 255 =>
1279
+ array (
1280
+ 'match' => '09B8 09CD 09AC',
1281
+ 'replace' => 'E18A',
1282
+ ),
1283
+ 256 =>
1284
+ array (
1285
+ 'match' => '09B8 09CD 09B8',
1286
+ 'replace' => 'E18B',
1287
+ ),
1288
+ 257 =>
1289
+ array (
1290
+ 'match' => '09B9 09CD 09A3',
1291
+ 'replace' => 'E192',
1292
+ ),
1293
+ 258 =>
1294
+ array (
1295
+ 'match' => '09B9 09CD 09A8',
1296
+ 'replace' => 'E193',
1297
+ ),
1298
+ 259 =>
1299
+ array (
1300
+ 'match' => '09B9 09CD 09AE',
1301
+ 'replace' => 'E194',
1302
+ ),
1303
+ 260 =>
1304
+ array (
1305
+ 'match' => '09B9 09CD 09AF',
1306
+ 'replace' => 'E195',
1307
+ ),
1308
+ 261 =>
1309
+ array (
1310
+ 'match' => '09B9 09CD 09B2',
1311
+ 'replace' => 'E196',
1312
+ ),
1313
+ 262 =>
1314
+ array (
1315
+ 'match' => '09B9 09CD 09AC',
1316
+ 'replace' => 'E197',
1317
+ ),
1318
+ 263 =>
1319
+ array (
1320
+ 'match' => '09DC 09CD 0997',
1321
+ 'replace' => 'E198',
1322
+ ),
1323
+ 264 =>
1324
+ array (
1325
+ 'match' => '09DC 09CD 099C',
1326
+ 'replace' => 'E199',
1327
+ ),
1328
+ 265 =>
1329
+ array (
1330
+ 'match' => '09DC 09CD 09A7',
1331
+ 'replace' => 'E19A',
1332
+ ),
1333
+ 266 =>
1334
+ array (
1335
+ 'match' => '0995 E1CD',
1336
+ 'replace' => 'E041',
1337
+ ),
1338
+ 267 =>
1339
+ array (
1340
+ 'match' => '0996 E1CD',
1341
+ 'replace' => 'E042',
1342
+ ),
1343
+ 268 =>
1344
+ array (
1345
+ 'match' => '0997 E1CD',
1346
+ 'replace' => 'E043',
1347
+ ),
1348
+ 269 =>
1349
+ array (
1350
+ 'match' => '0998 E1CD',
1351
+ 'replace' => 'E044',
1352
+ ),
1353
+ 270 =>
1354
+ array (
1355
+ 'match' => '0999 E1CD',
1356
+ 'replace' => 'E045',
1357
+ ),
1358
+ 271 =>
1359
+ array (
1360
+ 'match' => '099A E1CD',
1361
+ 'replace' => 'E046',
1362
+ ),
1363
+ 272 =>
1364
+ array (
1365
+ 'match' => '099B E1CD',
1366
+ 'replace' => 'E047',
1367
+ ),
1368
+ 273 =>
1369
+ array (
1370
+ 'match' => '099C E1CD',
1371
+ 'replace' => 'E048',
1372
+ ),
1373
+ 274 =>
1374
+ array (
1375
+ 'match' => '099D E1CD',
1376
+ 'replace' => 'E049',
1377
+ ),
1378
+ 275 =>
1379
+ array (
1380
+ 'match' => '099F E1CD',
1381
+ 'replace' => 'E04A',
1382
+ ),
1383
+ 276 =>
1384
+ array (
1385
+ 'match' => '09A0 E1CD',
1386
+ 'replace' => 'E04B',
1387
+ ),
1388
+ 277 =>
1389
+ array (
1390
+ 'match' => '09A1 E1CD',
1391
+ 'replace' => 'E04C',
1392
+ ),
1393
+ 278 =>
1394
+ array (
1395
+ 'match' => '09A2 E1CD',
1396
+ 'replace' => 'E04D',
1397
+ ),
1398
+ 279 =>
1399
+ array (
1400
+ 'match' => '09A3 E1CD',
1401
+ 'replace' => 'E04E',
1402
+ ),
1403
+ 280 =>
1404
+ array (
1405
+ 'match' => '09A4 E1CD',
1406
+ 'replace' => 'E04F',
1407
+ ),
1408
+ 281 =>
1409
+ array (
1410
+ 'match' => '09A5 E1CD',
1411
+ 'replace' => 'E050',
1412
+ ),
1413
+ 282 =>
1414
+ array (
1415
+ 'match' => '09A6 E1CD',
1416
+ 'replace' => 'E051',
1417
+ ),
1418
+ 283 =>
1419
+ array (
1420
+ 'match' => '09A7 E1CD',
1421
+ 'replace' => 'E052',
1422
+ ),
1423
+ 284 =>
1424
+ array (
1425
+ 'match' => '09A8 E1CD',
1426
+ 'replace' => 'E053',
1427
+ ),
1428
+ 285 =>
1429
+ array (
1430
+ 'match' => '09AA E1CD',
1431
+ 'replace' => 'E054',
1432
+ ),
1433
+ 286 =>
1434
+ array (
1435
+ 'match' => '09AB E1CD',
1436
+ 'replace' => 'E055',
1437
+ ),
1438
+ 287 =>
1439
+ array (
1440
+ 'match' => '09AC E1CD',
1441
+ 'replace' => 'E056',
1442
+ ),
1443
+ 288 =>
1444
+ array (
1445
+ 'match' => '09AD E1CD',
1446
+ 'replace' => 'E057',
1447
+ ),
1448
+ 289 =>
1449
+ array (
1450
+ 'match' => '09AE E1CD',
1451
+ 'replace' => 'E058',
1452
+ ),
1453
+ 290 =>
1454
+ array (
1455
+ 'match' => '09AF E1CD',
1456
+ 'replace' => 'E059',
1457
+ ),
1458
+ 291 =>
1459
+ array (
1460
+ 'match' => '09B0 E1CD',
1461
+ 'replace' => 'E05A',
1462
+ ),
1463
+ 292 =>
1464
+ array (
1465
+ 'match' => '09B2 E1CD',
1466
+ 'replace' => 'E05B',
1467
+ ),
1468
+ 293 =>
1469
+ array (
1470
+ 'match' => '09B6 E1CD',
1471
+ 'replace' => 'E05C',
1472
+ ),
1473
+ 294 =>
1474
+ array (
1475
+ 'match' => '09B7 E1CD',
1476
+ 'replace' => 'E05D',
1477
+ ),
1478
+ 295 =>
1479
+ array (
1480
+ 'match' => '09B8 E1CD',
1481
+ 'replace' => 'E05E',
1482
+ ),
1483
+ 296 =>
1484
+ array (
1485
+ 'match' => '09B9 E1CD',
1486
+ 'replace' => 'E05F',
1487
+ ),
1488
+ 297 =>
1489
+ array (
1490
+ 'match' => '09DC E1CD',
1491
+ 'replace' => 'E060',
1492
+ ),
1493
+ 298 =>
1494
+ array (
1495
+ 'match' => '09DD E1CD',
1496
+ 'replace' => 'E061',
1497
+ ),
1498
+ 299 =>
1499
+ array (
1500
+ 'match' => '09DF E1CD',
1501
+ 'replace' => 'E062',
1502
+ ),
1503
+ 300 =>
1504
+ array (
1505
+ 'match' => '00D0 09B0',
1506
+ 'replace' => 'E1CD',
1507
+ ),
1508
+ 301 =>
1509
+ array (
1510
+ 'match' => 'E06A E1CD',
1511
+ 'replace' => 'E07B',
1512
+ ),
1513
+ 302 =>
1514
+ array (
1515
+ 'match' => 'E06E E1CD',
1516
+ 'replace' => 'E07C',
1517
+ ),
1518
+ 303 =>
1519
+ array (
1520
+ 'match' => 'E071 E1CD',
1521
+ 'replace' => 'E07D',
1522
+ ),
1523
+ 304 =>
1524
+ array (
1525
+ 'match' => 'E071 09CD 09AC',
1526
+ 'replace' => 'E07E',
1527
+ ),
1528
+ 305 =>
1529
+ array (
1530
+ 'match' => 'E002 09CD 09A3',
1531
+ 'replace' => 'E07F',
1532
+ ),
1533
+ 306 =>
1534
+ array (
1535
+ 'match' => 'E002 09CD 09AE',
1536
+ 'replace' => 'E080',
1537
+ ),
1538
+ 307 =>
1539
+ array (
1540
+ 'match' => 'E002 E1CD',
1541
+ 'replace' => 'E081',
1542
+ ),
1543
+ 308 =>
1544
+ array (
1545
+ 'match' => 'E002 09CD 09AC',
1546
+ 'replace' => 'E082',
1547
+ ),
1548
+ 309 =>
1549
+ array (
1550
+ 'match' => 'E090 E1CD',
1551
+ 'replace' => 'E097',
1552
+ ),
1553
+ 310 =>
1554
+ array (
1555
+ 'match' => 'E090 09CD 09AC',
1556
+ 'replace' => 'E098',
1557
+ ),
1558
+ 311 =>
1559
+ array (
1560
+ 'match' => 'E09C E1CD',
1561
+ 'replace' => 'E0A7',
1562
+ ),
1563
+ 312 =>
1564
+ array (
1565
+ 'match' => 'E09F E1CD',
1566
+ 'replace' => 'E0A8',
1567
+ ),
1568
+ 313 =>
1569
+ array (
1570
+ 'match' => '0999 09CD E002',
1571
+ 'replace' => 'E0A9',
1572
+ ),
1573
+ 314 =>
1574
+ array (
1575
+ 'match' => 'E0AD E1CD',
1576
+ 'replace' => 'E0B1',
1577
+ ),
1578
+ 315 =>
1579
+ array (
1580
+ 'match' => 'E0AD 09CD 09B2',
1581
+ 'replace' => 'E0B2',
1582
+ ),
1583
+ 316 =>
1584
+ array (
1585
+ 'match' => 'E0AD 09CD 09AC',
1586
+ 'replace' => 'E0B3',
1587
+ ),
1588
+ 317 =>
1589
+ array (
1590
+ 'match' => 'E0B7 E1CD',
1591
+ 'replace' => 'E0BC',
1592
+ ),
1593
+ 318 =>
1594
+ array (
1595
+ 'match' => 'E0B7 09CD 09AC',
1596
+ 'replace' => 'E0BD',
1597
+ ),
1598
+ 319 =>
1599
+ array (
1600
+ 'match' => 'E0E0 E1CD',
1601
+ 'replace' => 'E0E8',
1602
+ ),
1603
+ 320 =>
1604
+ array (
1605
+ 'match' => 'E0E2 E1CD',
1606
+ 'replace' => 'E0E9',
1607
+ ),
1608
+ 321 =>
1609
+ array (
1610
+ 'match' => 'E0EA E1CD',
1611
+ 'replace' => 'E0EF',
1612
+ ),
1613
+ 322 =>
1614
+ array (
1615
+ 'match' => 'E0EA 09CD 09AC',
1616
+ 'replace' => 'E0F0',
1617
+ ),
1618
+ 323 =>
1619
+ array (
1620
+ 'match' => 'E0F6 E1CD',
1621
+ 'replace' => 'E0FD',
1622
+ ),
1623
+ 324 =>
1624
+ array (
1625
+ 'match' => 'E0F6 09CD 09AC',
1626
+ 'replace' => 'E0FE',
1627
+ ),
1628
+ 325 =>
1629
+ array (
1630
+ 'match' => 'E0F7 E1CD',
1631
+ 'replace' => 'E0FF',
1632
+ ),
1633
+ 326 =>
1634
+ array (
1635
+ 'match' => 'E0F7 09CD 09AC',
1636
+ 'replace' => 'E100',
1637
+ ),
1638
+ 327 =>
1639
+ array (
1640
+ 'match' => 'E0FA E1CD',
1641
+ 'replace' => 'E101',
1642
+ ),
1643
+ 328 =>
1644
+ array (
1645
+ 'match' => 'E10A E1CD',
1646
+ 'replace' => 'E11A',
1647
+ ),
1648
+ 329 =>
1649
+ array (
1650
+ 'match' => 'E10C E1CD',
1651
+ 'replace' => 'E11B',
1652
+ ),
1653
+ 330 =>
1654
+ array (
1655
+ 'match' => 'E10D E1CD',
1656
+ 'replace' => 'E11C',
1657
+ ),
1658
+ 331 =>
1659
+ array (
1660
+ 'match' => 'E10D 09CD 09AC',
1661
+ 'replace' => 'E11D',
1662
+ ),
1663
+ 332 =>
1664
+ array (
1665
+ 'match' => 'E10F E1CD',
1666
+ 'replace' => 'E11E',
1667
+ ),
1668
+ 333 =>
1669
+ array (
1670
+ 'match' => 'E10F 09CD 09AC',
1671
+ 'replace' => 'E11F',
1672
+ ),
1673
+ 334 =>
1674
+ array (
1675
+ 'match' => 'E110 E1CD',
1676
+ 'replace' => 'E120',
1677
+ ),
1678
+ 335 =>
1679
+ array (
1680
+ 'match' => 'E110 09CD 09AC',
1681
+ 'replace' => 'E121',
1682
+ ),
1683
+ 336 =>
1684
+ array (
1685
+ 'match' => 'E13C 09CD 09AC',
1686
+ 'replace' => 'E140',
1687
+ ),
1688
+ 337 =>
1689
+ array (
1690
+ 'match' => 'E149 E1CD',
1691
+ 'replace' => 'E14F',
1692
+ ),
1693
+ 338 =>
1694
+ array (
1695
+ 'match' => 'E14A E1CD',
1696
+ 'replace' => 'E150',
1697
+ ),
1698
+ 339 =>
1699
+ array (
1700
+ 'match' => 'E14B E1CD',
1701
+ 'replace' => 'E151',
1702
+ ),
1703
+ 340 =>
1704
+ array (
1705
+ 'match' => 'E14C E1CD',
1706
+ 'replace' => 'E152',
1707
+ ),
1708
+ 341 =>
1709
+ array (
1710
+ 'match' => 'E158 E1CD',
1711
+ 'replace' => 'E163',
1712
+ ),
1713
+ 342 =>
1714
+ array (
1715
+ 'match' => 'E15B E1CD',
1716
+ 'replace' => 'E164',
1717
+ ),
1718
+ 343 =>
1719
+ array (
1720
+ 'match' => 'E161 09CD 099F',
1721
+ 'replace' => 'E165',
1722
+ ),
1723
+ 344 =>
1724
+ array (
1725
+ 'match' => 'E171 E1CD',
1726
+ 'replace' => 'E17A',
1727
+ ),
1728
+ 345 =>
1729
+ array (
1730
+ 'match' => 'E172 E1CD',
1731
+ 'replace' => 'E17B',
1732
+ ),
1733
+ 346 =>
1734
+ array (
1735
+ 'match' => 'E172 09CD 09AC',
1736
+ 'replace' => 'E17C',
1737
+ ),
1738
+ 347 =>
1739
+ array (
1740
+ 'match' => 'E175 E1CD',
1741
+ 'replace' => 'E17D',
1742
+ ),
1743
+ 348 =>
1744
+ array (
1745
+ 'match' => 'E17E E1CD',
1746
+ 'replace' => 'E18C',
1747
+ ),
1748
+ 349 =>
1749
+ array (
1750
+ 'match' => 'E181 E1CD',
1751
+ 'replace' => 'E18D',
1752
+ ),
1753
+ 350 =>
1754
+ array (
1755
+ 'match' => 'E182 E1CD',
1756
+ 'replace' => 'E18E',
1757
+ ),
1758
+ 351 =>
1759
+ array (
1760
+ 'match' => 'E182 09CD 09AC',
1761
+ 'replace' => 'E18F',
1762
+ ),
1763
+ 352 =>
1764
+ array (
1765
+ 'match' => 'E185 E1CD',
1766
+ 'replace' => 'E190',
1767
+ ),
1768
+ 353 =>
1769
+ array (
1770
+ 'match' => 'E185 09CD 09B2',
1771
+ 'replace' => 'E191',
1772
+ ),
1773
+ 354 =>
1774
+ array (
1775
+ 'match' => '((0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF)) 09CD 09AF',
1776
+ 'replace' => '\\1 E067',
1777
+ ),
1778
+ 355 =>
1779
+ array (
1780
+ 'match' => '((E041|E042|E043|E044|E045|E046|E047|E048|E049|E04A|E04B|E04C|E04D|E04E|E04F|E050|E051|E052|E053|E054|E055|E056|E057|E058|E059|E05A|E05B|E05C|E05D|E05E|E05F|E060|E061|E062)) 09CD 09AF',
1781
+ 'replace' => '\\1 E067',
1782
+ ),
1783
+ 356 =>
1784
+ array (
1785
+ 'match' => '((E002|E003|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E079|E07A|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E086|E089|E08A|E08B|E08C|E08D|E08F|E090|E092|E095|E097|E098|E09A|E09B|E09D|E09F|E0A2|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF|E0B1|E0B2|E0B3|E0B4|E0B7|E0B8|E0B9|E0BB|E0BC|E0BD|E0BE|E0BF|E0C5|E0C6|E0C7|E0C8|E0C9|E0CB|E0CC|E0CD|E0CE|E0CF|E0D2|E0D3|E0D5|E0D6|E0D8|E0D9|E0DA|E0DB|E0E0|E0E1|E0E3|E0E5|E0E7|E0E8|E0ED|E0F1|E0F5|E0F6|E0FB|E0FC|E0FD|E0FE|E102|E104|E105|E106|E108|E109|E10A|E10B|E10C|E10F|E110|E112|E114|E115|E117|E118|E119|E11A|E11B|E11E|E11F|E120|E121|E122|E123|E124|E125|E126|E127|E12B|E12C|E130|E131|E132|E133|E134|E135|E136|E137|E139|E13A|E13B|E13F|E144|E149|E14A|E14D|E14F|E150|E153|E154|E156|E157|E158|E159|E15A|E15C|E161|E162|E163|E165|E166|E167|E168|E16C|E16D|E174|E175|E176|E177|E178|E17A|E17B|E17C|E17D|E17E|E17F|E180|E181|E185|E186|E187|E188|E18B|E18C|E18D|E190|E191|E193|E194|E195|E198|E199|E19A|0995|0999|099A|099B|099E|09A1|09A2|09A4|09AB|09AD|09B9|E002|E003|E06A|E073|E074|E077|E078|E07B|E07D|E07E|E07F|E081|E082|E084|E08A|E08C|E08D|E090|E092|E094|E097|E098|E09C|E0A0|E0A1|E0A6|E0A7|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0B1|E0B2|E0B3|E0B4|E0B5|E0B6|E0C1|E0C2|E0C3|E0C4|E0C6|E0C8|E0C9|E0CC|E0CF|E0D9|E0DA|E0DC|E0DD|E0DF|E0E2|E0E3|E0E9|E0EA|E0F0|E108|E109|E10C|E10D|E10E|E110|E112|E113|E11B|E120|E121|E122|E124|E125|E128|E12B|E133|E134|E135|E136|E137|E139|E13A|E13C|E140|E143|E14A|E14C|E153|E156|E157|E159|E15C|E162|E166|E167|E168|E169|E171|E174|E176|E17A|E17E|E180|E182|E183|E18C|E192|E193|E194|E195|E196|E197|09A6|E08F|E0B9|E0F4|E0F6|E0F7|E0F8|E0F9|E0FA|E0FD|E0DC|E0FF|E100|E101|E10F|E11E|E11F|E13B|E15A|099F|09A0|E06E|E06F|E07C|E0CA|E0CB|E0D0|E0D1|E0D4|E0D5|E0D7|E0E0|E0E1|E0E8|E10A|E10B|E11A|E126|E127|E132|E158|E163|E165|E172|E173|E17B|E17C|E181|E18D)) 09CD 09AF',
1786
+ 'replace' => '\\1 E067',
1787
+ ),
1788
+ 357 =>
1789
+ array (
1790
+ 'match' => '(200C) 09CD 09AF',
1791
+ 'replace' => '\\1 E067',
1792
+ ),
1793
+ 358 =>
1794
+ array (
1795
+ 'match' => 'E0A9 E1CD',
1796
+ 'replace' => 'E0AA',
1797
+ ),
1798
+ 359 =>
1799
+ array (
1800
+ 'match' => 'E0A9 E1CD',
1801
+ 'replace' => 'E0AB',
1802
+ ),
1803
+ 360 =>
1804
+ array (
1805
+ 'match' => '(09BF (0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF)) 09CD',
1806
+ 'replace' => '\\1 09CD 09BF',
1807
+ ),
1808
+ 361 =>
1809
+ array (
1810
+ 'match' => '(09BF (0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF)) 007E',
1811
+ 'replace' => '\\1 007E 09BF',
1812
+ ),
1813
+ 362 =>
1814
+ array (
1815
+ 'match' => '(09C7 (0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF)) 09CD',
1816
+ 'replace' => '\\1 09CD 09C7',
1817
+ ),
1818
+ 363 =>
1819
+ array (
1820
+ 'match' => '(09C7 (0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF)) 007E',
1821
+ 'replace' => '\\1 007E 09C7',
1822
+ ),
1823
+ 364 =>
1824
+ array (
1825
+ 'match' => '(09C8 (0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF)) 09CD',
1826
+ 'replace' => '\\1 09CD 09C8',
1827
+ ),
1828
+ 365 =>
1829
+ array (
1830
+ 'match' => '(09C8 (0995|0996|0997|0998|0999|099A|099B|099C|099D|099F|09A0|09A1|09A2|09A3|09A4|09A5|09A6|09A7|09A8|09AA|09AB|09AC|09AD|09AE|09AF|09B0|09B2|09B6|09B7|09B8|09B9|09DC|09DD|09DF)) 007E',
1831
+ 'replace' => '\\1 007E 09C8',
1832
+ ),
1833
+ 366 =>
1834
+ array (
1835
+ 'match' => '09BF 0995 (09CD (09BF|09C7|09C8))',
1836
+ 'replace' => '0995 \\1',
1837
+ ),
1838
+ 367 =>
1839
+ array (
1840
+ 'match' => '09BF 0996 (09CD (09BF|09C7|09C8))',
1841
+ 'replace' => '0996 \\1',
1842
+ ),
1843
+ 368 =>
1844
+ array (
1845
+ 'match' => '09BF 0997 (09CD (09BF|09C7|09C8))',
1846
+ 'replace' => '0997 \\1',
1847
+ ),
1848
+ 369 =>
1849
+ array (
1850
+ 'match' => '09BF 0998 (09CD (09BF|09C7|09C8))',
1851
+ 'replace' => '0998 \\1',
1852
+ ),
1853
+ 370 =>
1854
+ array (
1855
+ 'match' => '09BF 0999 (09CD (09BF|09C7|09C8))',
1856
+ 'replace' => '0999 \\1',
1857
+ ),
1858
+ 371 =>
1859
+ array (
1860
+ 'match' => '09BF 099A (09CD (09BF|09C7|09C8))',
1861
+ 'replace' => '099A \\1',
1862
+ ),
1863
+ 372 =>
1864
+ array (
1865
+ 'match' => '09BF 099B (09CD (09BF|09C7|09C8))',
1866
+ 'replace' => '099B \\1',
1867
+ ),
1868
+ 373 =>
1869
+ array (
1870
+ 'match' => '09BF 099C (09CD (09BF|09C7|09C8))',
1871
+ 'replace' => '099C \\1',
1872
+ ),
1873
+ 374 =>
1874
+ array (
1875
+ 'match' => '09BF 099D (09CD (09BF|09C7|09C8))',
1876
+ 'replace' => '099D \\1',
1877
+ ),
1878
+ 375 =>
1879
+ array (
1880
+ 'match' => '09BF 099F (09CD (09BF|09C7|09C8))',
1881
+ 'replace' => '099F \\1',
1882
+ ),
1883
+ 376 =>
1884
+ array (
1885
+ 'match' => '09BF 09A0 (09CD (09BF|09C7|09C8))',
1886
+ 'replace' => '09A0 \\1',
1887
+ ),
1888
+ 377 =>
1889
+ array (
1890
+ 'match' => '09BF 09A1 (09CD (09BF|09C7|09C8))',
1891
+ 'replace' => '09A1 \\1',
1892
+ ),
1893
+ 378 =>
1894
+ array (
1895
+ 'match' => '09BF 09A2 (09CD (09BF|09C7|09C8))',
1896
+ 'replace' => '09A2 \\1',
1897
+ ),
1898
+ 379 =>
1899
+ array (
1900
+ 'match' => '09BF 09A3 (09CD (09BF|09C7|09C8))',
1901
+ 'replace' => '09A3 \\1',
1902
+ ),
1903
+ 380 =>
1904
+ array (
1905
+ 'match' => '09BF 09A4 (09CD (09BF|09C7|09C8))',
1906
+ 'replace' => '09A4 \\1',
1907
+ ),
1908
+ 381 =>
1909
+ array (
1910
+ 'match' => '09BF 09A5 (09CD (09BF|09C7|09C8))',
1911
+ 'replace' => '09A5 \\1',
1912
+ ),
1913
+ 382 =>
1914
+ array (
1915
+ 'match' => '09BF 09A6 (09CD (09BF|09C7|09C8))',
1916
+ 'replace' => '09A6 \\1',
1917
+ ),
1918
+ 383 =>
1919
+ array (
1920
+ 'match' => '09BF 09A7 (09CD (09BF|09C7|09C8))',
1921
+ 'replace' => '09A7 \\1',
1922
+ ),
1923
+ 384 =>
1924
+ array (
1925
+ 'match' => '09BF 09A8 (09CD (09BF|09C7|09C8))',
1926
+ 'replace' => '09A8 \\1',
1927
+ ),
1928
+ 385 =>
1929
+ array (
1930
+ 'match' => '09BF 09AA (09CD (09BF|09C7|09C8))',
1931
+ 'replace' => '09AA \\1',
1932
+ ),
1933
+ 386 =>
1934
+ array (
1935
+ 'match' => '09BF 09AB (09CD (09BF|09C7|09C8))',
1936
+ 'replace' => '09AB \\1',
1937
+ ),
1938
+ 387 =>
1939
+ array (
1940
+ 'match' => '09BF 09AC (09CD (09BF|09C7|09C8))',
1941
+ 'replace' => '09AC \\1',
1942
+ ),
1943
+ 388 =>
1944
+ array (
1945
+ 'match' => '09BF 09AD (09CD (09BF|09C7|09C8))',
1946
+ 'replace' => '09AD \\1',
1947
+ ),
1948
+ 389 =>
1949
+ array (
1950
+ 'match' => '09BF 09AE (09CD (09BF|09C7|09C8))',
1951
+ 'replace' => '09AE \\1',
1952
+ ),
1953
+ 390 =>
1954
+ array (
1955
+ 'match' => '09BF 09AF (09CD (09BF|09C7|09C8))',
1956
+ 'replace' => '09AF \\1',
1957
+ ),
1958
+ 391 =>
1959
+ array (
1960
+ 'match' => '09BF 09B0 (09CD (09BF|09C7|09C8))',
1961
+ 'replace' => '09B0 \\1',
1962
+ ),
1963
+ 392 =>
1964
+ array (
1965
+ 'match' => '09BF 09B2 (09CD (09BF|09C7|09C8))',
1966
+ 'replace' => '09B2 \\1',
1967
+ ),
1968
+ 393 =>
1969
+ array (
1970
+ 'match' => '09BF 09B6 (09CD (09BF|09C7|09C8))',
1971
+ 'replace' => '09B6 \\1',
1972
+ ),
1973
+ 394 =>
1974
+ array (
1975
+ 'match' => '09BF 09B7 (09CD (09BF|09C7|09C8))',
1976
+ 'replace' => '09B7 \\1',
1977
+ ),
1978
+ 395 =>
1979
+ array (
1980
+ 'match' => '09BF 09B8 (09CD (09BF|09C7|09C8))',
1981
+ 'replace' => '09B8 \\1',
1982
+ ),
1983
+ 396 =>
1984
+ array (
1985
+ 'match' => '09BF 09B9 (09CD (09BF|09C7|09C8))',
1986
+ 'replace' => '09B9 \\1',
1987
+ ),
1988
+ 397 =>
1989
+ array (
1990
+ 'match' => '09BF 09DC (09CD (09BF|09C7|09C8))',
1991
+ 'replace' => '09DC \\1',
1992
+ ),
1993
+ 398 =>
1994
+ array (
1995
+ 'match' => '09BF 09DD (09CD (09BF|09C7|09C8))',
1996
+ 'replace' => '09DD \\1',
1997
+ ),
1998
+ 399 =>
1999
+ array (
2000
+ 'match' => '09BF 09DF (09CD (09BF|09C7|09C8))',
2001
+ 'replace' => '09DF \\1',
2002
+ ),
2003
+ 400 =>
2004
+ array (
2005
+ 'match' => '09C7 0995 (09CD (09BF|09C7|09C8))',
2006
+ 'replace' => '0995 \\1',
2007
+ ),
2008
+ 401 =>
2009
+ array (
2010
+ 'match' => '09C7 0996 (09CD (09BF|09C7|09C8))',
2011
+ 'replace' => '0996 \\1',
2012
+ ),
2013
+ 402 =>
2014
+ array (
2015
+ 'match' => '09C7 0997 (09CD (09BF|09C7|09C8))',
2016
+ 'replace' => '0997 \\1',
2017
+ ),
2018
+ 403 =>
2019
+ array (
2020
+ 'match' => '09C7 0998 (09CD (09BF|09C7|09C8))',
2021
+ 'replace' => '0998 \\1',
2022
+ ),
2023
+ 404 =>
2024
+ array (
2025
+ 'match' => '09C7 0999 (09CD (09BF|09C7|09C8))',
2026
+ 'replace' => '0999 \\1',
2027
+ ),
2028
+ 405 =>
2029
+ array (
2030
+ 'match' => '09C7 099A (09CD (09BF|09C7|09C8))',
2031
+ 'replace' => '099A \\1',
2032
+ ),
2033
+ 406 =>
2034
+ array (
2035
+ 'match' => '09C7 099B (09CD (09BF|09C7|09C8))',
2036
+ 'replace' => '099B \\1',
2037
+ ),
2038
+ 407 =>
2039
+ array (
2040
+ 'match' => '09C7 099C (09CD (09BF|09C7|09C8))',
2041
+ 'replace' => '099C \\1',
2042
+ ),
2043
+ 408 =>
2044
+ array (
2045
+ 'match' => '09C7 099D (09CD (09BF|09C7|09C8))',
2046
+ 'replace' => '099D \\1',
2047
+ ),
2048
+ 409 =>
2049
+ array (
2050
+ 'match' => '09C7 099F (09CD (09BF|09C7|09C8))',
2051
+ 'replace' => '099F \\1',
2052
+ ),
2053
+ 410 =>
2054
+ array (
2055
+ 'match' => '09C7 09A0 (09CD (09BF|09C7|09C8))',
2056
+ 'replace' => '09A0 \\1',
2057
+ ),
2058
+ 411 =>
2059
+ array (
2060
+ 'match' => '09C7 09A1 (09CD (09BF|09C7|09C8))',
2061
+ 'replace' => '09A1 \\1',
2062
+ ),
2063
+ 412 =>
2064
+ array (
2065
+ 'match' => '09C7 09A2 (09CD (09BF|09C7|09C8))',
2066
+ 'replace' => '09A2 \\1',
2067
+ ),
2068
+ 413 =>
2069
+ array (
2070
+ 'match' => '09C7 09A3 (09CD (09BF|09C7|09C8))',
2071
+ 'replace' => '09A3 \\1',
2072
+ ),
2073
+ 414 =>
2074
+ array (
2075
+ 'match' => '09C7 09A4 (09CD (09BF|09C7|09C8))',
2076
+ 'replace' => '09A4 \\1',
2077
+ ),
2078
+ 415 =>
2079
+ array (
2080
+ 'match' => '09C7 09A5 (09CD (09BF|09C7|09C8))',
2081
+ 'replace' => '09A5 \\1',
2082
+ ),
2083
+ 416 =>
2084
+ array (
2085
+ 'match' => '09C7 09A6 (09CD (09BF|09C7|09C8))',
2086
+ 'replace' => '09A6 \\1',
2087
+ ),
2088
+ 417 =>
2089
+ array (
2090
+ 'match' => '09C7 09A7 (09CD (09BF|09C7|09C8))',
2091
+ 'replace' => '09A7 \\1',
2092
+ ),
2093
+ 418 =>
2094
+ array (
2095
+ 'match' => '09C7 09A8 (09CD (09BF|09C7|09C8))',
2096
+ 'replace' => '09A8 \\1',
2097
+ ),
2098
+ 419 =>
2099
+ array (
2100
+ 'match' => '09C7 09AA (09CD (09BF|09C7|09C8))',
2101
+ 'replace' => '09AA \\1',
2102
+ ),
2103
+ 420 =>
2104
+ array (
2105
+ 'match' => '09C7 09AB (09CD (09BF|09C7|09C8))',
2106
+ 'replace' => '09AB \\1',
2107
+ ),
2108
+ 421 =>
2109
+ array (
2110
+ 'match' => '09C7 09AC (09CD (09BF|09C7|09C8))',
2111
+ 'replace' => '09AC \\1',
2112
+ ),
2113
+ 422 =>
2114
+ array (
2115
+ 'match' => '09C7 09AD (09CD (09BF|09C7|09C8))',
2116
+ 'replace' => '09AD \\1',
2117
+ ),
2118
+ 423 =>
2119
+ array (
2120
+ 'match' => '09C7 09AE (09CD (09BF|09C7|09C8))',
2121
+ 'replace' => '09AE \\1',
2122
+ ),
2123
+ 424 =>
2124
+ array (
2125
+ 'match' => '09C7 09AF (09CD (09BF|09C7|09C8))',
2126
+ 'replace' => '09AF \\1',
2127
+ ),
2128
+ 425 =>
2129
+ array (
2130
+ 'match' => '09C7 09B0 (09CD (09BF|09C7|09C8))',
2131
+ 'replace' => '09B0 \\1',
2132
+ ),
2133
+ 426 =>
2134
+ array (
2135
+ 'match' => '09C7 09B2 (09CD (09BF|09C7|09C8))',
2136
+ 'replace' => '09B2 \\1',
2137
+ ),
2138
+ 427 =>
2139
+ array (
2140
+ 'match' => '09C7 09B6 (09CD (09BF|09C7|09C8))',
2141
+ 'replace' => '09B6 \\1',
2142
+ ),
2143
+ 428 =>
2144
+ array (
2145
+ 'match' => '09C7 09B7 (09CD (09BF|09C7|09C8))',
2146
+ 'replace' => '09B7 \\1',
2147
+ ),
2148
+ 429 =>
2149
+ array (
2150
+ 'match' => '09C7 09B8 (09CD (09BF|09C7|09C8))',
2151
+ 'replace' => '09B8 \\1',
2152
+ ),
2153
+ 430 =>
2154
+ array (
2155
+ 'match' => '09C7 09B9 (09CD (09BF|09C7|09C8))',
2156
+ 'replace' => '09B9 \\1',
2157
+ ),
2158
+ 431 =>
2159
+ array (
2160
+ 'match' => '09C7 09DC (09CD (09BF|09C7|09C8))',
2161
+ 'replace' => '09DC \\1',
2162
+ ),
2163
+ 432 =>
2164
+ array (
2165
+ 'match' => '09C7 09DD (09CD (09BF|09C7|09C8))',
2166
+ 'replace' => '09DD \\1',
2167
+ ),
2168
+ 433 =>
2169
+ array (
2170
+ 'match' => '09C7 09DF (09CD (09BF|09C7|09C8))',
2171
+ 'replace' => '09DF \\1',
2172
+ ),
2173
+ 434 =>
2174
+ array (
2175
+ 'match' => '09C8 0995 (09CD (09BF|09C7|09C8))',
2176
+ 'replace' => '0995 \\1',
2177
+ ),
2178
+ 435 =>
2179
+ array (
2180
+ 'match' => '09C8 0996 (09CD (09BF|09C7|09C8))',
2181
+ 'replace' => '0996 \\1',
2182
+ ),
2183
+ 436 =>
2184
+ array (
2185
+ 'match' => '09C8 0997 (09CD (09BF|09C7|09C8))',
2186
+ 'replace' => '0997 \\1',
2187
+ ),
2188
+ 437 =>
2189
+ array (
2190
+ 'match' => '09C8 0998 (09CD (09BF|09C7|09C8))',
2191
+ 'replace' => '0998 \\1',
2192
+ ),
2193
+ 438 =>
2194
+ array (
2195
+ 'match' => '09C8 0999 (09CD (09BF|09C7|09C8))',
2196
+ 'replace' => '0999 \\1',
2197
+ ),
2198
+ 439 =>
2199
+ array (
2200
+ 'match' => '09C8 099A (09CD (09BF|09C7|09C8))',
2201
+ 'replace' => '099A \\1',
2202
+ ),
2203
+ 440 =>
2204
+ array (
2205
+ 'match' => '09C8 099B (09CD (09BF|09C7|09C8))',
2206
+ 'replace' => '099B \\1',
2207
+ ),
2208
+ 441 =>
2209
+ array (
2210
+ 'match' => '09C8 099C (09CD (09BF|09C7|09C8))',
2211
+ 'replace' => '099C \\1',
2212
+ ),
2213
+ 442 =>
2214
+ array (
2215
+ 'match' => '09C8 099D (09CD (09BF|09C7|09C8))',
2216
+ 'replace' => '099D \\1',
2217
+ ),
2218
+ 443 =>
2219
+ array (
2220
+ 'match' => '09C8 099F (09CD (09BF|09C7|09C8))',
2221
+ 'replace' => '099F \\1',
2222
+ ),
2223
+ 444 =>
2224
+ array (
2225
+ 'match' => '09C8 09A0 (09CD (09BF|09C7|09C8))',
2226
+ 'replace' => '09A0 \\1',
2227
+ ),
2228
+ 445 =>
2229
+ array (
2230
+ 'match' => '09C8 09A1 (09CD (09BF|09C7|09C8))',
2231
+ 'replace' => '09A1 \\1',
2232
+ ),
2233
+ 446 =>
2234
+ array (
2235
+ 'match' => '09C8 09A2 (09CD (09BF|09C7|09C8))',
2236
+ 'replace' => '09A2 \\1',
2237
+ ),
2238
+ 447 =>
2239
+ array (
2240
+ 'match' => '09C8 09A3 (09CD (09BF|09C7|09C8))',
2241
+ 'replace' => '09A3 \\1',
2242
+ ),
2243
+ 448 =>
2244
+ array (
2245
+ 'match' => '09C8 09A4 (09CD (09BF|09C7|09C8))',
2246
+ 'replace' => '09A4 \\1',
2247
+ ),
2248
+ 449 =>
2249
+ array (
2250
+ 'match' => '09C8 09A5 (09CD (09BF|09C7|09C8))',
2251
+ 'replace' => '09A5 \\1',
2252
+ ),
2253
+ 450 =>
2254
+ array (
2255
+ 'match' => '09C8 09A6 (09CD (09BF|09C7|09C8))',
2256
+ 'replace' => '09A6 \\1',
2257
+ ),
2258
+ 451 =>
2259
+ array (
2260
+ 'match' => '09C8 09A7 (09CD (09BF|09C7|09C8))',
2261
+ 'replace' => '09A7 \\1',
2262
+ ),
2263
+ 452 =>
2264
+ array (
2265
+ 'match' => '09C8 09A8 (09CD (09BF|09C7|09C8))',
2266
+ 'replace' => '09A8 \\1',
2267
+ ),
2268
+ 453 =>
2269
+ array (
2270
+ 'match' => '09C8 09AA (09CD (09BF|09C7|09C8))',
2271
+ 'replace' => '09AA \\1',
2272
+ ),
2273
+ 454 =>
2274
+ array (
2275
+ 'match' => '09C8 09AB (09CD (09BF|09C7|09C8))',
2276
+ 'replace' => '09AB \\1',
2277
+ ),
2278
+ 455 =>
2279
+ array (
2280
+ 'match' => '09C8 09AC (09CD (09BF|09C7|09C8))',
2281
+ 'replace' => '09AC \\1',
2282
+ ),
2283
+ 456 =>
2284
+ array (
2285
+ 'match' => '09C8 09AD (09CD (09BF|09C7|09C8))',
2286
+ 'replace' => '09AD \\1',
2287
+ ),
2288
+ 457 =>
2289
+ array (
2290
+ 'match' => '09C8 09AE (09CD (09BF|09C7|09C8))',
2291
+ 'replace' => '09AE \\1',
2292
+ ),
2293
+ 458 =>
2294
+ array (
2295
+ 'match' => '09C8 09AF (09CD (09BF|09C7|09C8))',
2296
+ 'replace' => '09AF \\1',
2297
+ ),
2298
+ 459 =>
2299
+ array (
2300
+ 'match' => '09C8 09B0 (09CD (09BF|09C7|09C8))',
2301
+ 'replace' => '09B0 \\1',
2302
+ ),
2303
+ 460 =>
2304
+ array (
2305
+ 'match' => '09C8 09B2 (09CD (09BF|09C7|09C8))',
2306
+ 'replace' => '09B2 \\1',
2307
+ ),
2308
+ 461 =>
2309
+ array (
2310
+ 'match' => '09C8 09B6 (09CD (09BF|09C7|09C8))',
2311
+ 'replace' => '09B6 \\1',
2312
+ ),
2313
+ 462 =>
2314
+ array (
2315
+ 'match' => '09C8 09B7 (09CD (09BF|09C7|09C8))',
2316
+ 'replace' => '09B7 \\1',
2317
+ ),
2318
+ 463 =>
2319
+ array (
2320
+ 'match' => '09C8 09B8 (09CD (09BF|09C7|09C8))',
2321
+ 'replace' => '09B8 \\1',
2322
+ ),
2323
+ 464 =>
2324
+ array (
2325
+ 'match' => '09C8 09B9 (09CD (09BF|09C7|09C8))',
2326
+ 'replace' => '09B9 \\1',
2327
+ ),
2328
+ 465 =>
2329
+ array (
2330
+ 'match' => '09C8 09DC (09CD (09BF|09C7|09C8))',
2331
+ 'replace' => '09DC \\1',
2332
+ ),
2333
+ 466 =>
2334
+ array (
2335
+ 'match' => '09C8 09DD (09CD (09BF|09C7|09C8))',
2336
+ 'replace' => '09DD \\1',
2337
+ ),
2338
+ 467 =>
2339
+ array (
2340
+ 'match' => '09C8 09DF (09CD (09BF|09C7|09C8))',
2341
+ 'replace' => '09DF \\1',
2342
+ ),
2343
+ 468 =>
2344
+ array (
2345
+ 'match' => '09BF 0995 (007E (09BF|09C7|09C8))',
2346
+ 'replace' => '0995 \\1',
2347
+ ),
2348
+ 469 =>
2349
+ array (
2350
+ 'match' => '09BF 0996 (007E (09BF|09C7|09C8))',
2351
+ 'replace' => '0996 \\1',
2352
+ ),
2353
+ 470 =>
2354
+ array (
2355
+ 'match' => '09BF 0997 (007E (09BF|09C7|09C8))',
2356
+ 'replace' => '0997 \\1',
2357
+ ),
2358
+ 471 =>
2359
+ array (
2360
+ 'match' => '09BF 0998 (007E (09BF|09C7|09C8))',
2361
+ 'replace' => '0998 \\1',
2362
+ ),
2363
+ 472 =>
2364
+ array (
2365
+ 'match' => '09BF 0999 (007E (09BF|09C7|09C8))',
2366
+ 'replace' => '0999 \\1',
2367
+ ),
2368
+ 473 =>
2369
+ array (
2370
+ 'match' => '09BF 099A (007E (09BF|09C7|09C8))',
2371
+ 'replace' => '099A \\1',
2372
+ ),
2373
+ 474 =>
2374
+ array (
2375
+ 'match' => '09BF 099B (007E (09BF|09C7|09C8))',
2376
+ 'replace' => '099B \\1',
2377
+ ),
2378
+ 475 =>
2379
+ array (
2380
+ 'match' => '09BF 099C (007E (09BF|09C7|09C8))',
2381
+ 'replace' => '099C \\1',
2382
+ ),
2383
+ 476 =>
2384
+ array (
2385
+ 'match' => '09BF 099D (007E (09BF|09C7|09C8))',
2386
+ 'replace' => '099D \\1',
2387
+ ),
2388
+ 477 =>
2389
+ array (
2390
+ 'match' => '09BF 099F (007E (09BF|09C7|09C8))',
2391
+ 'replace' => '099F \\1',
2392
+ ),
2393
+ 478 =>
2394
+ array (
2395
+ 'match' => '09BF 09A0 (007E (09BF|09C7|09C8))',
2396
+ 'replace' => '09A0 \\1',
2397
+ ),
2398
+ 479 =>
2399
+ array (
2400
+ 'match' => '09BF 09A1 (007E (09BF|09C7|09C8))',
2401
+ 'replace' => '09A1 \\1',
2402
+ ),
2403
+ 480 =>
2404
+ array (
2405
+ 'match' => '09BF 09A2 (007E (09BF|09C7|09C8))',
2406
+ 'replace' => '09A2 \\1',
2407
+ ),
2408
+ 481 =>
2409
+ array (
2410
+ 'match' => '09BF 09A3 (007E (09BF|09C7|09C8))',
2411
+ 'replace' => '09A3 \\1',
2412
+ ),
2413
+ 482 =>
2414
+ array (
2415
+ 'match' => '09BF 09A4 (007E (09BF|09C7|09C8))',
2416
+ 'replace' => '09A4 \\1',
2417
+ ),
2418
+ 483 =>
2419
+ array (
2420
+ 'match' => '09BF 09A5 (007E (09BF|09C7|09C8))',
2421
+ 'replace' => '09A5 \\1',
2422
+ ),
2423
+ 484 =>
2424
+ array (
2425
+ 'match' => '09BF 09A6 (007E (09BF|09C7|09C8))',
2426
+ 'replace' => '09A6 \\1',
2427
+ ),
2428
+ 485 =>
2429
+ array (
2430
+ 'match' => '09BF 09A7 (007E (09BF|09C7|09C8))',
2431
+ 'replace' => '09A7 \\1',
2432
+ ),
2433
+ 486 =>
2434
+ array (
2435
+ 'match' => '09BF 09A8 (007E (09BF|09C7|09C8))',
2436
+ 'replace' => '09A8 \\1',
2437
+ ),
2438
+ 487 =>
2439
+ array (
2440
+ 'match' => '09BF 09AA (007E (09BF|09C7|09C8))',
2441
+ 'replace' => '09AA \\1',
2442
+ ),
2443
+ 488 =>
2444
+ array (
2445
+ 'match' => '09BF 09AB (007E (09BF|09C7|09C8))',
2446
+ 'replace' => '09AB \\1',
2447
+ ),
2448
+ 489 =>
2449
+ array (
2450
+ 'match' => '09BF 09AC (007E (09BF|09C7|09C8))',
2451
+ 'replace' => '09AC \\1',
2452
+ ),
2453
+ 490 =>
2454
+ array (
2455
+ 'match' => '09BF 09AD (007E (09BF|09C7|09C8))',
2456
+ 'replace' => '09AD \\1',
2457
+ ),
2458
+ 491 =>
2459
+ array (
2460
+ 'match' => '09BF 09AE (007E (09BF|09C7|09C8))',
2461
+ 'replace' => '09AE \\1',
2462
+ ),
2463
+ 492 =>
2464
+ array (
2465
+ 'match' => '09BF 09AF (007E (09BF|09C7|09C8))',
2466
+ 'replace' => '09AF \\1',
2467
+ ),
2468
+ 493 =>
2469
+ array (
2470
+ 'match' => '09BF 09B0 (007E (09BF|09C7|09C8))',
2471
+ 'replace' => '09B0 \\1',
2472
+ ),
2473
+ 494 =>
2474
+ array (
2475
+ 'match' => '09BF 09B2 (007E (09BF|09C7|09C8))',
2476
+ 'replace' => '09B2 \\1',
2477
+ ),
2478
+ 495 =>
2479
+ array (
2480
+ 'match' => '09BF 09B6 (007E (09BF|09C7|09C8))',
2481
+ 'replace' => '09B6 \\1',
2482
+ ),
2483
+ 496 =>
2484
+ array (
2485
+ 'match' => '09BF 09B7 (007E (09BF|09C7|09C8))',
2486
+ 'replace' => '09B7 \\1',
2487
+ ),
2488
+ 497 =>
2489
+ array (
2490
+ 'match' => '09BF 09B8 (007E (09BF|09C7|09C8))',
2491
+ 'replace' => '09B8 \\1',
2492
+ ),
2493
+ 498 =>
2494
+ array (
2495
+ 'match' => '09BF 09B9 (007E (09BF|09C7|09C8))',
2496
+ 'replace' => '09B9 \\1',
2497
+ ),
2498
+ 499 =>
2499
+ array (
2500
+ 'match' => '09BF 09DC (007E (09BF|09C7|09C8))',
2501
+ 'replace' => '09DC \\1',
2502
+ ),
2503
+ 500 =>
2504
+ array (
2505
+ 'match' => '09BF 09DD (007E (09BF|09C7|09C8))',
2506
+ 'replace' => '09DD \\1',
2507
+ ),
2508
+ 501 =>
2509
+ array (
2510
+ 'match' => '09BF 09DF (007E (09BF|09C7|09C8))',
2511
+ 'replace' => '09DF \\1',
2512
+ ),
2513
+ 502 =>
2514
+ array (
2515
+ 'match' => '09C7 0995 (007E (09BF|09C7|09C8))',
2516
+ 'replace' => '0995 \\1',
2517
+ ),
2518
+ 503 =>
2519
+ array (
2520
+ 'match' => '09C7 0996 (007E (09BF|09C7|09C8))',
2521
+ 'replace' => '0996 \\1',
2522
+ ),
2523
+ 504 =>
2524
+ array (
2525
+ 'match' => '09C7 0997 (007E (09BF|09C7|09C8))',
2526
+ 'replace' => '0997 \\1',
2527
+ ),
2528
+ 505 =>
2529
+ array (
2530
+ 'match' => '09C7 0998 (007E (09BF|09C7|09C8))',
2531
+ 'replace' => '0998 \\1',
2532
+ ),
2533
+ 506 =>
2534
+ array (
2535
+ 'match' => '09C7 0999 (007E (09BF|09C7|09C8))',
2536
+ 'replace' => '0999 \\1',
2537
+ ),
2538
+ 507 =>
2539
+ array (
2540
+ 'match' => '09C7 099A (007E (09BF|09C7|09C8))',
2541
+ 'replace' => '099A \\1',
2542
+ ),
2543
+ 508 =>
2544
+ array (
2545
+ 'match' => '09C7 099B (007E (09BF|09C7|09C8))',
2546
+ 'replace' => '099B \\1',
2547
+ ),
2548
+ 509 =>
2549
+ array (
2550
+ 'match' => '09C7 099C (007E (09BF|09C7|09C8))',
2551
+ 'replace' => '099C \\1',
2552
+ ),
2553
+ 510 =>
2554
+ array (
2555
+ 'match' => '09C7 099D (007E (09BF|09C7|09C8))',
2556
+ 'replace' => '099D \\1',
2557
+ ),
2558
+ 511 =>
2559
+ array (
2560
+ 'match' => '09C7 099F (007E (09BF|09C7|09C8))',
2561
+ 'replace' => '099F \\1',
2562
+ ),
2563
+ 512 =>
2564
+ array (
2565
+ 'match' => '09C7 09A0 (007E (09BF|09C7|09C8))',
2566
+ 'replace' => '09A0 \\1',
2567
+ ),
2568
+ 513 =>
2569
+ array (
2570
+ 'match' => '09C7 09A1 (007E (09BF|09C7|09C8))',
2571
+ 'replace' => '09A1 \\1',
2572
+ ),
2573
+ 514 =>
2574
+ array (
2575
+ 'match' => '09C7 09A2 (007E (09BF|09C7|09C8))',
2576
+ 'replace' => '09A2 \\1',
2577
+ ),
2578
+ 515 =>
2579
+ array (
2580
+ 'match' => '09C7 09A3 (007E (09BF|09C7|09C8))',
2581
+ 'replace' => '09A3 \\1',
2582
+ ),
2583
+ 516 =>
2584
+ array (
2585
+ 'match' => '09C7 09A4 (007E (09BF|09C7|09C8))',
2586
+ 'replace' => '09A4 \\1',
2587
+ ),
2588
+ 517 =>
2589
+ array (
2590
+ 'match' => '09C7 09A5 (007E (09BF|09C7|09C8))',
2591
+ 'replace' => '09A5 \\1',
2592
+ ),
2593
+ 518 =>
2594
+ array (
2595
+ 'match' => '09C7 09A6 (007E (09BF|09C7|09C8))',
2596
+ 'replace' => '09A6 \\1',
2597
+ ),
2598
+ 519 =>
2599
+ array (
2600
+ 'match' => '09C7 09A7 (007E (09BF|09C7|09C8))',
2601
+ 'replace' => '09A7 \\1',
2602
+ ),
2603
+ 520 =>
2604
+ array (
2605
+ 'match' => '09C7 09A8 (007E (09BF|09C7|09C8))',
2606
+ 'replace' => '09A8 \\1',
2607
+ ),
2608
+ 521 =>
2609
+ array (
2610
+ 'match' => '09C7 09AA (007E (09BF|09C7|09C8))',
2611
+ 'replace' => '09AA \\1',
2612
+ ),
2613
+ 522 =>
2614
+ array (
2615
+ 'match' => '09C7 09AB (007E (09BF|09C7|09C8))',
2616
+ 'replace' => '09AB \\1',
2617
+ ),
2618
+ 523 =>
2619
+ array (
2620
+ 'match' => '09C7 09AC (007E (09BF|09C7|09C8))',
2621
+ 'replace' => '09AC \\1',
2622
+ ),
2623
+ 524 =>
2624
+ array (
2625
+ 'match' => '09C7 09AD (007E (09BF|09C7|09C8))',
2626
+ 'replace' => '09AD \\1',
2627
+ ),
2628
+ 525 =>
2629
+ array (
2630
+ 'match' => '09C7 09AE (007E (09BF|09C7|09C8))',
2631
+ 'replace' => '09AE \\1',
2632
+ ),
2633
+ 526 =>
2634
+ array (
2635
+ 'match' => '09C7 09AF (007E (09BF|09C7|09C8))',
2636
+ 'replace' => '09AF \\1',
2637
+ ),
2638
+ 527 =>
2639
+ array (
2640
+ 'match' => '09C7 09B0 (007E (09BF|09C7|09C8))',
2641
+ 'replace' => '09B0 \\1',
2642
+ ),
2643
+ 528 =>
2644
+ array (
2645
+ 'match' => '09C7 09B2 (007E (09BF|09C7|09C8))',
2646
+ 'replace' => '09B2 \\1',
2647
+ ),
2648
+ 529 =>
2649
+ array (
2650
+ 'match' => '09C7 09B6 (007E (09BF|09C7|09C8))',
2651
+ 'replace' => '09B6 \\1',
2652
+ ),
2653
+ 530 =>
2654
+ array (
2655
+ 'match' => '09C7 09B7 (007E (09BF|09C7|09C8))',
2656
+ 'replace' => '09B7 \\1',
2657
+ ),
2658
+ 531 =>
2659
+ array (
2660
+ 'match' => '09C7 09B8 (007E (09BF|09C7|09C8))',
2661
+ 'replace' => '09B8 \\1',
2662
+ ),
2663
+ 532 =>
2664
+ array (
2665
+ 'match' => '09C7 09B9 (007E (09BF|09C7|09C8))',
2666
+ 'replace' => '09B9 \\1',
2667
+ ),
2668
+ 533 =>
2669
+ array (
2670
+ 'match' => '09C7 09DC (007E (09BF|09C7|09C8))',
2671
+ 'replace' => '09DC \\1',
2672
+ ),
2673
+ 534 =>
2674
+ array (
2675
+ 'match' => '09C7 09DD (007E (09BF|09C7|09C8))',
2676
+ 'replace' => '09DD \\1',
2677
+ ),
2678
+ 535 =>
2679
+ array (
2680
+ 'match' => '09C7 09DF (007E (09BF|09C7|09C8))',
2681
+ 'replace' => '09DF \\1',
2682
+ ),
2683
+ 536 =>
2684
+ array (
2685
+ 'match' => '09C8 0995 (007E (09BF|09C7|09C8))',
2686
+ 'replace' => '0995 \\1',
2687
+ ),
2688
+ 537 =>
2689
+ array (
2690
+ 'match' => '09C8 0996 (007E (09BF|09C7|09C8))',
2691
+ 'replace' => '0996 \\1',
2692
+ ),
2693
+ 538 =>
2694
+ array (
2695
+ 'match' => '09C8 0997 (007E (09BF|09C7|09C8))',
2696
+ 'replace' => '0997 \\1',
2697
+ ),
2698
+ 539 =>
2699
+ array (
2700
+ 'match' => '09C8 0998 (007E (09BF|09C7|09C8))',
2701
+ 'replace' => '0998 \\1',
2702
+ ),
2703
+ 540 =>
2704
+ array (
2705
+ 'match' => '09C8 0999 (007E (09BF|09C7|09C8))',
2706
+ 'replace' => '0999 \\1',
2707
+ ),
2708
+ 541 =>
2709
+ array (
2710
+ 'match' => '09C8 099A (007E (09BF|09C7|09C8))',
2711
+ 'replace' => '099A \\1',
2712
+ ),
2713
+ 542 =>
2714
+ array (
2715
+ 'match' => '09C8 099B (007E (09BF|09C7|09C8))',
2716
+ 'replace' => '099B \\1',
2717
+ ),
2718
+ 543 =>
2719
+ array (
2720
+ 'match' => '09C8 099C (007E (09BF|09C7|09C8))',
2721
+ 'replace' => '099C \\1',
2722
+ ),
2723
+ 544 =>
2724
+ array (
2725
+ 'match' => '09C8 099D (007E (09BF|09C7|09C8))',
2726
+ 'replace' => '099D \\1',
2727
+ ),
2728
+ 545 =>
2729
+ array (
2730
+ 'match' => '09C8 099F (007E (09BF|09C7|09C8))',
2731
+ 'replace' => '099F \\1',
2732
+ ),
2733
+ 546 =>
2734
+ array (
2735
+ 'match' => '09C8 09A0 (007E (09BF|09C7|09C8))',
2736
+ 'replace' => '09A0 \\1',
2737
+ ),
2738
+ 547 =>
2739
+ array (
2740
+ 'match' => '09C8 09A1 (007E (09BF|09C7|09C8))',
2741
+ 'replace' => '09A1 \\1',
2742
+ ),
2743
+ 548 =>
2744
+ array (
2745
+ 'match' => '09C8 09A2 (007E (09BF|09C7|09C8))',
2746
+ 'replace' => '09A2 \\1',
2747
+ ),
2748
+ 549 =>
2749
+ array (
2750
+ 'match' => '09C8 09A3 (007E (09BF|09C7|09C8))',
2751
+ 'replace' => '09A3 \\1',
2752
+ ),
2753
+ 550 =>
2754
+ array (
2755
+ 'match' => '09C8 09A4 (007E (09BF|09C7|09C8))',
2756
+ 'replace' => '09A4 \\1',
2757
+ ),
2758
+ 551 =>
2759
+ array (
2760
+ 'match' => '09C8 09A5 (007E (09BF|09C7|09C8))',
2761
+ 'replace' => '09A5 \\1',
2762
+ ),
2763
+ 552 =>
2764
+ array (
2765
+ 'match' => '09C8 09A6 (007E (09BF|09C7|09C8))',
2766
+ 'replace' => '09A6 \\1',
2767
+ ),
2768
+ 553 =>
2769
+ array (
2770
+ 'match' => '09C8 09A7 (007E (09BF|09C7|09C8))',
2771
+ 'replace' => '09A7 \\1',
2772
+ ),
2773
+ 554 =>
2774
+ array (
2775
+ 'match' => '09C8 09A8 (007E (09BF|09C7|09C8))',
2776
+ 'replace' => '09A8 \\1',
2777
+ ),
2778
+ 555 =>
2779
+ array (
2780
+ 'match' => '09C8 09AA (007E (09BF|09C7|09C8))',
2781
+ 'replace' => '09AA \\1',
2782
+ ),
2783
+ 556 =>
2784
+ array (
2785
+ 'match' => '09C8 09AB (007E (09BF|09C7|09C8))',
2786
+ 'replace' => '09AB \\1',
2787
+ ),
2788
+ 557 =>
2789
+ array (
2790
+ 'match' => '09C8 09AC (007E (09BF|09C7|09C8))',
2791
+ 'replace' => '09AC \\1',
2792
+ ),
2793
+ 558 =>
2794
+ array (
2795
+ 'match' => '09C8 09AD (007E (09BF|09C7|09C8))',
2796
+ 'replace' => '09AD \\1',
2797
+ ),
2798
+ 559 =>
2799
+ array (
2800
+ 'match' => '09C8 09AE (007E (09BF|09C7|09C8))',
2801
+ 'replace' => '09AE \\1',
2802
+ ),
2803
+ 560 =>
2804
+ array (
2805
+ 'match' => '09C8 09AF (007E (09BF|09C7|09C8))',
2806
+ 'replace' => '09AF \\1',
2807
+ ),
2808
+ 561 =>
2809
+ array (
2810
+ 'match' => '09C8 09B0 (007E (09BF|09C7|09C8))',
2811
+ 'replace' => '09B0 \\1',
2812
+ ),
2813
+ 562 =>
2814
+ array (
2815
+ 'match' => '09C8 09B2 (007E (09BF|09C7|09C8))',
2816
+ 'replace' => '09B2 \\1',
2817
+ ),
2818
+ 563 =>
2819
+ array (
2820
+ 'match' => '09C8 09B6 (007E (09BF|09C7|09C8))',
2821
+ 'replace' => '09B6 \\1',
2822
+ ),
2823
+ 564 =>
2824
+ array (
2825
+ 'match' => '09C8 09B7 (007E (09BF|09C7|09C8))',
2826
+ 'replace' => '09B7 \\1',
2827
+ ),
2828
+ 565 =>
2829
+ array (
2830
+ 'match' => '09C8 09B8 (007E (09BF|09C7|09C8))',
2831
+ 'replace' => '09B8 \\1',
2832
+ ),
2833
+ 566 =>
2834
+ array (
2835
+ 'match' => '09C8 09B9 (007E (09BF|09C7|09C8))',
2836
+ 'replace' => '09B9 \\1',
2837
+ ),
2838
+ 567 =>
2839
+ array (
2840
+ 'match' => '09C8 09DC (007E (09BF|09C7|09C8))',
2841
+ 'replace' => '09DC \\1',
2842
+ ),
2843
+ 568 =>
2844
+ array (
2845
+ 'match' => '09C8 09DD (007E (09BF|09C7|09C8))',
2846
+ 'replace' => '09DD \\1',
2847
+ ),
2848
+ 569 =>
2849
+ array (
2850
+ 'match' => '09C8 09DF (007E (09BF|09C7|09C8))',
2851
+ 'replace' => '09DF \\1',
2852
+ ),
2853
+ 570 =>
2854
+ array (
2855
+ 'match' => '09A4 09CD',
2856
+ 'replace' => 'E066',
2857
+ ),
2858
+ 571 =>
2859
+ array (
2860
+ 'match' => '09A4 007E',
2861
+ 'replace' => 'E066',
2862
+ ),
2863
+ 572 =>
2864
+ array (
2865
+ 'match' => 'E066 200D',
2866
+ 'replace' => 'E066',
2867
+ ),
2868
+ 573 =>
2869
+ array (
2870
+ 'match' => '09BF 200D',
2871
+ 'replace' => '09BF',
2872
+ ),
2873
+ 574 =>
2874
+ array (
2875
+ 'match' => '09C7 200D',
2876
+ 'replace' => '09C7',
2877
+ ),
2878
+ 575 =>
2879
+ array (
2880
+ 'match' => '09C8 200D',
2881
+ 'replace' => '09C8',
2882
+ ),
2883
+ 576 =>
2884
+ array (
2885
+ 'match' => '007E',
2886
+ 'replace' => '09CD',
2887
+ ),
2888
+ 577 =>
2889
+ array (
2890
+ 'match' => '200C',
2891
+ 'replace' => '09CD',
2892
+ ),
2893
+ 578 =>
2894
+ array (
2895
+ 'match' => '00D0',
2896
+ 'replace' => '09CD',
2897
+ ),
2898
+ 579 =>
2899
+ array (
2900
+ 'match' => '0997 09C1',
2901
+ 'replace' => 'E00A',
2902
+ ),
2903
+ 580 =>
2904
+ array (
2905
+ 'match' => '09DC 09C1',
2906
+ 'replace' => 'E012',
2907
+ ),
2908
+ 581 =>
2909
+ array (
2910
+ 'match' => '09DC 09C2',
2911
+ 'replace' => 'E013',
2912
+ ),
2913
+ 582 =>
2914
+ array (
2915
+ 'match' => '09DC 09C3',
2916
+ 'replace' => 'E014',
2917
+ ),
2918
+ 583 =>
2919
+ array (
2920
+ 'match' => '09DC 09C4',
2921
+ 'replace' => 'E015',
2922
+ ),
2923
+ 584 =>
2924
+ array (
2925
+ 'match' => '09DD 09C1',
2926
+ 'replace' => 'E016',
2927
+ ),
2928
+ 585 =>
2929
+ array (
2930
+ 'match' => '09DD 09C2',
2931
+ 'replace' => 'E017',
2932
+ ),
2933
+ 586 =>
2934
+ array (
2935
+ 'match' => '09DD 09C3',
2936
+ 'replace' => 'E018',
2937
+ ),
2938
+ 587 =>
2939
+ array (
2940
+ 'match' => '09DD 09C4',
2941
+ 'replace' => 'E019',
2942
+ ),
2943
+ 588 =>
2944
+ array (
2945
+ 'match' => '09B6 09C1',
2946
+ 'replace' => 'E00F',
2947
+ ),
2948
+ 589 =>
2949
+ array (
2950
+ 'match' => '09B9 09C1',
2951
+ 'replace' => 'E010',
2952
+ ),
2953
+ 590 =>
2954
+ array (
2955
+ 'match' => '09B9 09C3',
2956
+ 'replace' => 'E011',
2957
+ ),
2958
+ 591 =>
2959
+ array (
2960
+ 'match' => 'E084 09C1',
2961
+ 'replace' => 'E19B',
2962
+ ),
2963
+ 592 =>
2964
+ array (
2965
+ 'match' => 'E0F4 09C1',
2966
+ 'replace' => 'E19C',
2967
+ ),
2968
+ 593 =>
2969
+ array (
2970
+ 'match' => 'E10D 09C1',
2971
+ 'replace' => 'E19D',
2972
+ ),
2973
+ 594 =>
2974
+ array (
2975
+ 'match' => 'E128 09C1',
2976
+ 'replace' => 'E19E',
2977
+ ),
2978
+ 595 =>
2979
+ array (
2980
+ 'match' => 'E133 09C1',
2981
+ 'replace' => 'E19F',
2982
+ ),
2983
+ 596 =>
2984
+ array (
2985
+ 'match' => 'E155 09C1',
2986
+ 'replace' => 'E1A0',
2987
+ ),
2988
+ 597 =>
2989
+ array (
2990
+ 'match' => 'E169 09C1',
2991
+ 'replace' => 'E1A1',
2992
+ ),
2993
+ 598 =>
2994
+ array (
2995
+ 'match' => 'E182 09C1',
2996
+ 'replace' => 'E1A2',
2997
+ ),
2998
+ 599 =>
2999
+ array (
3000
+ 'match' => '09BF ((E002|E003|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E079|E07A|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E086|E089|E08A|E08B|E08C|E08D|E08F|E090|E092|E095|E097|E098|E09A|E09B|E09D|E09F|E0A2|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF|E0B1|E0B2|E0B3|E0B4|E0B7|E0B8|E0B9|E0BB|E0BC|E0BD|E0BE|E0BF|E0C5|E0C6|E0C7|E0C8|E0C9|E0CB|E0CC|E0CD|E0CE|E0CF|E0D2|E0D3|E0D5|E0D6|E0D8|E0D9|E0DA|E0DB|E0E0|E0E1|E0E3|E0E5|E0E7|E0E8|E0ED|E0F1|E0F5|E0F6|E0FB|E0FC|E0FD|E0FE|E102|E104|E105|E106|E108|E109|E10A|E10B|E10C|E10F|E110|E112|E114|E115|E117|E118|E119|E11A|E11B|E11E|E11F|E120|E121|E122|E123|E124|E125|E126|E127|E12B|E12C|E130|E131|E132|E133|E134|E135|E136|E137|E139|E13A|E13B|E13F|E144|E149|E14A|E14D|E14F|E150|E153|E154|E156|E157|E158|E159|E15A|E15C|E161|E162|E163|E165|E166|E167|E168|E16C|E16D|E174|E175|E176|E177|E178|E17A|E17B|E17C|E17D|E17E|E17F|E180|E181|E185|E186|E187|E188|E18B|E18C|E18D|E190|E191|E193|E194|E195|E198|E199|E19A))',
3001
+ 'replace' => 'E01C \\1',
3002
+ ),
3003
+ 600 =>
3004
+ array (
3005
+ 'match' => '((0995|0999|099A|099B|099F|09A0|09A1|09A2|09A4|09AB|09AD|09B9)) 09BE',
3006
+ 'replace' => '\\1 E01A',
3007
+ ),
3008
+ 601 =>
3009
+ array (
3010
+ 'match' => '((0995|0999|099A|099B|099F|09A0|09A1|09A2|09A4|09AB|09AD|09B9)) 09D7',
3011
+ 'replace' => '\\1 E03F',
3012
+ ),
3013
+ 602 =>
3014
+ array (
3015
+ 'match' => '((09A6)) 09BE',
3016
+ 'replace' => '\\1 E01B',
3017
+ ),
3018
+ 603 =>
3019
+ array (
3020
+ 'match' => '((09A6)) 09D7',
3021
+ 'replace' => '\\1 E040',
3022
+ ),
3023
+ 604 =>
3024
+ array (
3025
+ 'match' => '09C0 0981',
3026
+ 'replace' => 'E1B4',
3027
+ ),
3028
+ 605 =>
3029
+ array (
3030
+ 'match' => '09D7 0981',
3031
+ 'replace' => 'E1B5',
3032
+ ),
3033
+ 606 =>
3034
+ array (
3035
+ 'match' => 'E01D 0981',
3036
+ 'replace' => 'E1B6',
3037
+ ),
3038
+ 607 =>
3039
+ array (
3040
+ 'match' => 'E01E 0981',
3041
+ 'replace' => 'E1B7',
3042
+ ),
3043
+ 608 =>
3044
+ array (
3045
+ 'match' => 'E01F 0981',
3046
+ 'replace' => 'E1B8',
3047
+ ),
3048
+ 609 =>
3049
+ array (
3050
+ 'match' => 'E03F 0981',
3051
+ 'replace' => 'E1B9',
3052
+ ),
3053
+ 610 =>
3054
+ array (
3055
+ 'match' => 'E040 0981',
3056
+ 'replace' => 'E1BA',
3057
+ ),
3058
+ 611 =>
3059
+ array (
3060
+ 'match' => '09C0 E069',
3061
+ 'replace' => 'E1BB',
3062
+ ),
3063
+ 612 =>
3064
+ array (
3065
+ 'match' => '09D7 E069',
3066
+ 'replace' => 'E1BC',
3067
+ ),
3068
+ 613 =>
3069
+ array (
3070
+ 'match' => 'E01D E069',
3071
+ 'replace' => 'E1BD',
3072
+ ),
3073
+ 614 =>
3074
+ array (
3075
+ 'match' => 'E01E E069',
3076
+ 'replace' => 'E1BE',
3077
+ ),
3078
+ 615 =>
3079
+ array (
3080
+ 'match' => 'E01F E069',
3081
+ 'replace' => 'E1BF',
3082
+ ),
3083
+ 616 =>
3084
+ array (
3085
+ 'match' => 'E03F E069',
3086
+ 'replace' => 'E1C0',
3087
+ ),
3088
+ 617 =>
3089
+ array (
3090
+ 'match' => 'E040 E069',
3091
+ 'replace' => 'E1C1',
3092
+ ),
3093
+ 618 =>
3094
+ array (
3095
+ 'match' => '0987 0981',
3096
+ 'replace' => 'E1C2',
3097
+ ),
3098
+ 619 =>
3099
+ array (
3100
+ 'match' => '0988 0981',
3101
+ 'replace' => 'E1C3',
3102
+ ),
3103
+ 620 =>
3104
+ array (
3105
+ 'match' => '098A 0981',
3106
+ 'replace' => 'E1C4',
3107
+ ),
3108
+ 621 =>
3109
+ array (
3110
+ 'match' => '0990 0981',
3111
+ 'replace' => 'E1C5',
3112
+ ),
3113
+ 622 =>
3114
+ array (
3115
+ 'match' => '0994 0981',
3116
+ 'replace' => 'E1C6',
3117
+ ),
3118
+ 623 =>
3119
+ array (
3120
+ 'match' => '099F 0981',
3121
+ 'replace' => 'E1C7',
3122
+ ),
3123
+ 624 =>
3124
+ array (
3125
+ 'match' => '09A0 0981',
3126
+ 'replace' => 'E1C8',
3127
+ ),
3128
+ 625 =>
3129
+ array (
3130
+ 'match' => '099F E068',
3131
+ 'replace' => 'E1C9',
3132
+ ),
3133
+ 626 =>
3134
+ array (
3135
+ 'match' => '09A0 E068',
3136
+ 'replace' => 'E1CA',
3137
+ ),
3138
+ 627 =>
3139
+ array (
3140
+ 'match' => '099F E069',
3141
+ 'replace' => 'E1CB',
3142
+ ),
3143
+ 628 =>
3144
+ array (
3145
+ 'match' => '09A0 E069',
3146
+ 'replace' => 'E1CC',
3147
+ ),
3148
+ 629 =>
3149
+ array (
3150
+ 'match' => '((0995|0999|099A|099B|099E|09A1|09A2|09A4|09AB|09AD|09B9|E002|E003|E06A|E073|E074|E077|E078|E07B|E07D|E07E|E07F|E081|E082|E084|E08A|E08C|E08D|E090|E092|E094|E097|E098|E09C|E0A0|E0A1|E0A6|E0A7|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0B1|E0B2|E0B3|E0B4|E0B5|E0B6|E0C1|E0C2|E0C3|E0C4|E0C6|E0C8|E0C9|E0CC|E0CF|E0D9|E0DA|E0DC|E0DD|E0DF|E0E2|E0E3|E0E9|E0EA|E0F0|E108|E109|E10C|E10D|E10E|E110|E112|E113|E11B|E120|E121|E122|E124|E125|E128|E12B|E133|E134|E135|E136|E137|E139|E13A|E13C|E140|E143|E14A|E14C|E153|E156|E157|E159|E15C|E162|E166|E167|E168|E169|E171|E174|E176|E17A|E17E|E180|E182|E183|E18C|E192|E193|E194|E195|E196|E197)) 09C0',
3151
+ 'replace' => '\\1 E01D',
3152
+ ),
3153
+ 630 =>
3154
+ array (
3155
+ 'match' => '((09A6|E08F|E0B9|E0F4|E0F6|E0F7|E0F8|E0F9|E0FA|E0FD|E0DC|E0FF|E100|E101|E10F|E11E|E11F|E13B|E15A)) 09C0',
3156
+ 'replace' => '\\1 E01E',
3157
+ ),
3158
+ 631 =>
3159
+ array (
3160
+ 'match' => '((099F|09A0|E06E|E06F|E07C|E0CA|E0CB|E0D0|E0D1|E0D4|E0D5|E0D7|E0E0|E0E1|E0E8|E10A|E10B|E11A|E126|E127|E132|E158|E163|E165|E172|E173|E17B|E17C|E181|E18D)) 09C0',
3161
+ 'replace' => '\\1 E01F',
3162
+ ),
3163
+ );
3164
+ ?>
mPDF/includes/ind_gu_1_001.volt.php ADDED
@@ -0,0 +1,3314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $volt = array (
3
+ 0 =>
4
+ array (
5
+ 'match' => '0A95 0ACD 0AB7',
6
+ 'replace' => 'E002',
7
+ ),
8
+ 1 =>
9
+ array (
10
+ 'match' => '0A9C 0ACD 0A9E',
11
+ 'replace' => 'E003',
12
+ ),
13
+ 2 =>
14
+ array (
15
+ 'match' => '0ACD 200C',
16
+ 'replace' => 'E163',
17
+ ),
18
+ 3 =>
19
+ array (
20
+ 'match' => '0A95 0ABC',
21
+ 'replace' => 'E004',
22
+ ),
23
+ 4 =>
24
+ array (
25
+ 'match' => '0A96 0ABC',
26
+ 'replace' => 'E005',
27
+ ),
28
+ 5 =>
29
+ array (
30
+ 'match' => '0A97 0ABC',
31
+ 'replace' => 'E006',
32
+ ),
33
+ 6 =>
34
+ array (
35
+ 'match' => '0A98 0ABC',
36
+ 'replace' => 'E007',
37
+ ),
38
+ 7 =>
39
+ array (
40
+ 'match' => '0A99 0ABC',
41
+ 'replace' => 'E008',
42
+ ),
43
+ 8 =>
44
+ array (
45
+ 'match' => '0A9A 0ABC',
46
+ 'replace' => 'E009',
47
+ ),
48
+ 9 =>
49
+ array (
50
+ 'match' => '0A9B 0ABC',
51
+ 'replace' => 'E00A',
52
+ ),
53
+ 10 =>
54
+ array (
55
+ 'match' => '0A9C 0ABC',
56
+ 'replace' => 'E00B',
57
+ ),
58
+ 11 =>
59
+ array (
60
+ 'match' => '0A9D 0ABC',
61
+ 'replace' => 'E00C',
62
+ ),
63
+ 12 =>
64
+ array (
65
+ 'match' => '0A9E 0ABC',
66
+ 'replace' => 'E00D',
67
+ ),
68
+ 13 =>
69
+ array (
70
+ 'match' => '0A9F 0ABC',
71
+ 'replace' => 'E00E',
72
+ ),
73
+ 14 =>
74
+ array (
75
+ 'match' => '0AA0 0ABC',
76
+ 'replace' => 'E00F',
77
+ ),
78
+ 15 =>
79
+ array (
80
+ 'match' => '0AA1 0ABC',
81
+ 'replace' => 'E010',
82
+ ),
83
+ 16 =>
84
+ array (
85
+ 'match' => '0AA2 0ABC',
86
+ 'replace' => 'E011',
87
+ ),
88
+ 17 =>
89
+ array (
90
+ 'match' => '0AA3 0ABC',
91
+ 'replace' => 'E012',
92
+ ),
93
+ 18 =>
94
+ array (
95
+ 'match' => '0AA4 0ABC',
96
+ 'replace' => 'E013',
97
+ ),
98
+ 19 =>
99
+ array (
100
+ 'match' => '0AA5 0ABC',
101
+ 'replace' => 'E014',
102
+ ),
103
+ 20 =>
104
+ array (
105
+ 'match' => '0AA6 0ABC',
106
+ 'replace' => 'E015',
107
+ ),
108
+ 21 =>
109
+ array (
110
+ 'match' => '0AA7 0ABC',
111
+ 'replace' => 'E016',
112
+ ),
113
+ 22 =>
114
+ array (
115
+ 'match' => '0AA8 0ABC',
116
+ 'replace' => 'E017',
117
+ ),
118
+ 23 =>
119
+ array (
120
+ 'match' => '0AAA 0ABC',
121
+ 'replace' => 'E018',
122
+ ),
123
+ 24 =>
124
+ array (
125
+ 'match' => '0AAB 0ABC',
126
+ 'replace' => 'E019',
127
+ ),
128
+ 25 =>
129
+ array (
130
+ 'match' => '0AAC 0ABC',
131
+ 'replace' => 'E01A',
132
+ ),
133
+ 26 =>
134
+ array (
135
+ 'match' => '0AAD 0ABC',
136
+ 'replace' => 'E01B',
137
+ ),
138
+ 27 =>
139
+ array (
140
+ 'match' => '0AAE 0ABC',
141
+ 'replace' => 'E01C',
142
+ ),
143
+ 28 =>
144
+ array (
145
+ 'match' => '0AAF 0ABC',
146
+ 'replace' => 'E01D',
147
+ ),
148
+ 29 =>
149
+ array (
150
+ 'match' => '0AB0 0ABC',
151
+ 'replace' => 'E01E',
152
+ ),
153
+ 30 =>
154
+ array (
155
+ 'match' => '0AB2 0ABC',
156
+ 'replace' => 'E01F',
157
+ ),
158
+ 31 =>
159
+ array (
160
+ 'match' => '0AB3 0ABC',
161
+ 'replace' => 'E020',
162
+ ),
163
+ 32 =>
164
+ array (
165
+ 'match' => '0AB5 0ABC',
166
+ 'replace' => 'E021',
167
+ ),
168
+ 33 =>
169
+ array (
170
+ 'match' => '0AB6 0ABC',
171
+ 'replace' => 'E022',
172
+ ),
173
+ 34 =>
174
+ array (
175
+ 'match' => '0AB7 0ABC',
176
+ 'replace' => 'E023',
177
+ ),
178
+ 35 =>
179
+ array (
180
+ 'match' => '0AB8 0ABC',
181
+ 'replace' => 'E024',
182
+ ),
183
+ 36 =>
184
+ array (
185
+ 'match' => '0AB9 0ABC',
186
+ 'replace' => 'E025',
187
+ ),
188
+ 37 =>
189
+ array (
190
+ 'match' => 'E002 0ABC',
191
+ 'replace' => 'E026',
192
+ ),
193
+ 38 =>
194
+ array (
195
+ 'match' => 'E003 0ABC',
196
+ 'replace' => 'E027',
197
+ ),
198
+ 39 =>
199
+ array (
200
+ 'match' => '((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E)) 0ACD 0AB0',
201
+ 'replace' => '\\1 E05D',
202
+ ),
203
+ 40 =>
204
+ array (
205
+ 'match' => '(25CC) 0ACD 0AB0',
206
+ 'replace' => '\\1 E05D',
207
+ ),
208
+ 41 =>
209
+ array (
210
+ 'match' => '(200D) 0ACD 0AB0',
211
+ 'replace' => '\\1 E05D',
212
+ ),
213
+ 42 =>
214
+ array (
215
+ 'match' => '(0020) 0ACD 0AB0',
216
+ 'replace' => '\\1 E05D',
217
+ ),
218
+ 43 =>
219
+ array (
220
+ 'match' => '((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E)) 0AB0 0ACD',
221
+ 'replace' => '\\1 E032',
222
+ ),
223
+ 44 =>
224
+ array (
225
+ 'match' => '((0ABE|0AC0|0AC1|0AC2|0AC3|0AC4|0AC5|0AC7|0AC8|0AC9|0ACB|0ACC)) 0AB0 0ACD',
226
+ 'replace' => '\\1 E032',
227
+ ),
228
+ 45 =>
229
+ array (
230
+ 'match' => '(E05D) 0AB0 0ACD',
231
+ 'replace' => '\\1 E032',
232
+ ),
233
+ 46 =>
234
+ array (
235
+ 'match' => '(25CC) 0AB0 0ACD',
236
+ 'replace' => '\\1 E032',
237
+ ),
238
+ 47 =>
239
+ array (
240
+ 'match' => '0A95 E05D',
241
+ 'replace' => 'E05E',
242
+ ),
243
+ 48 =>
244
+ array (
245
+ 'match' => '0A96 E05D',
246
+ 'replace' => 'E05F',
247
+ ),
248
+ 49 =>
249
+ array (
250
+ 'match' => '0A97 E05D',
251
+ 'replace' => 'E060',
252
+ ),
253
+ 50 =>
254
+ array (
255
+ 'match' => '0A98 E05D',
256
+ 'replace' => 'E061',
257
+ ),
258
+ 51 =>
259
+ array (
260
+ 'match' => '0A99 E05D',
261
+ 'replace' => 'E062',
262
+ ),
263
+ 52 =>
264
+ array (
265
+ 'match' => '0A9A E05D',
266
+ 'replace' => 'E063',
267
+ ),
268
+ 53 =>
269
+ array (
270
+ 'match' => '0A9B E05D',
271
+ 'replace' => 'E064',
272
+ ),
273
+ 54 =>
274
+ array (
275
+ 'match' => '0A9C E05D',
276
+ 'replace' => 'E065',
277
+ ),
278
+ 55 =>
279
+ array (
280
+ 'match' => '0A9D E05D',
281
+ 'replace' => 'E066',
282
+ ),
283
+ 56 =>
284
+ array (
285
+ 'match' => '0A9E E05D',
286
+ 'replace' => 'E067',
287
+ ),
288
+ 57 =>
289
+ array (
290
+ 'match' => '0A9F E05D',
291
+ 'replace' => 'E068',
292
+ ),
293
+ 58 =>
294
+ array (
295
+ 'match' => '0AA0 E05D',
296
+ 'replace' => 'E069',
297
+ ),
298
+ 59 =>
299
+ array (
300
+ 'match' => '0AA1 E05D',
301
+ 'replace' => 'E06A',
302
+ ),
303
+ 60 =>
304
+ array (
305
+ 'match' => '0AA2 E05D',
306
+ 'replace' => 'E06B',
307
+ ),
308
+ 61 =>
309
+ array (
310
+ 'match' => '0AA3 E05D',
311
+ 'replace' => 'E06C',
312
+ ),
313
+ 62 =>
314
+ array (
315
+ 'match' => '0AA4 E05D',
316
+ 'replace' => 'E06D',
317
+ ),
318
+ 63 =>
319
+ array (
320
+ 'match' => '0AA5 E05D',
321
+ 'replace' => 'E06E',
322
+ ),
323
+ 64 =>
324
+ array (
325
+ 'match' => '0AA6 E05D',
326
+ 'replace' => 'E06F',
327
+ ),
328
+ 65 =>
329
+ array (
330
+ 'match' => '0AA7 E05D',
331
+ 'replace' => 'E070',
332
+ ),
333
+ 66 =>
334
+ array (
335
+ 'match' => '0AA8 E05D',
336
+ 'replace' => 'E071',
337
+ ),
338
+ 67 =>
339
+ array (
340
+ 'match' => '0AAA E05D',
341
+ 'replace' => 'E072',
342
+ ),
343
+ 68 =>
344
+ array (
345
+ 'match' => '0AAB E05D',
346
+ 'replace' => 'E073',
347
+ ),
348
+ 69 =>
349
+ array (
350
+ 'match' => '0AAC E05D',
351
+ 'replace' => 'E074',
352
+ ),
353
+ 70 =>
354
+ array (
355
+ 'match' => '0AAD E05D',
356
+ 'replace' => 'E075',
357
+ ),
358
+ 71 =>
359
+ array (
360
+ 'match' => '0AAE E05D',
361
+ 'replace' => 'E076',
362
+ ),
363
+ 72 =>
364
+ array (
365
+ 'match' => '0AAF E05D',
366
+ 'replace' => 'E077',
367
+ ),
368
+ 73 =>
369
+ array (
370
+ 'match' => '0AB0 E05D',
371
+ 'replace' => 'E078',
372
+ ),
373
+ 74 =>
374
+ array (
375
+ 'match' => '0AB2 E05D',
376
+ 'replace' => 'E079',
377
+ ),
378
+ 75 =>
379
+ array (
380
+ 'match' => '0AB3 E05D',
381
+ 'replace' => 'E07A',
382
+ ),
383
+ 76 =>
384
+ array (
385
+ 'match' => '0AB5 E05D',
386
+ 'replace' => 'E07B',
387
+ ),
388
+ 77 =>
389
+ array (
390
+ 'match' => '0AB6 E05D',
391
+ 'replace' => 'E07C',
392
+ ),
393
+ 78 =>
394
+ array (
395
+ 'match' => '0AB7 E05D',
396
+ 'replace' => 'E07D',
397
+ ),
398
+ 79 =>
399
+ array (
400
+ 'match' => '0AB8 E05D',
401
+ 'replace' => 'E07E',
402
+ ),
403
+ 80 =>
404
+ array (
405
+ 'match' => '0AB9 E05D',
406
+ 'replace' => 'E07F',
407
+ ),
408
+ 81 =>
409
+ array (
410
+ 'match' => 'E002 E05D',
411
+ 'replace' => 'E080',
412
+ ),
413
+ 82 =>
414
+ array (
415
+ 'match' => 'E003 E05D',
416
+ 'replace' => 'E081',
417
+ ),
418
+ 83 =>
419
+ array (
420
+ 'match' => 'E004 E05D',
421
+ 'replace' => 'E082',
422
+ ),
423
+ 84 =>
424
+ array (
425
+ 'match' => 'E005 E05D',
426
+ 'replace' => 'E083',
427
+ ),
428
+ 85 =>
429
+ array (
430
+ 'match' => 'E006 E05D',
431
+ 'replace' => 'E084',
432
+ ),
433
+ 86 =>
434
+ array (
435
+ 'match' => 'E007 E05D',
436
+ 'replace' => 'E085',
437
+ ),
438
+ 87 =>
439
+ array (
440
+ 'match' => 'E008 E05D',
441
+ 'replace' => 'E086',
442
+ ),
443
+ 88 =>
444
+ array (
445
+ 'match' => 'E009 E05D',
446
+ 'replace' => 'E087',
447
+ ),
448
+ 89 =>
449
+ array (
450
+ 'match' => 'E00A E05D',
451
+ 'replace' => 'E088',
452
+ ),
453
+ 90 =>
454
+ array (
455
+ 'match' => 'E00B E05D',
456
+ 'replace' => 'E089',
457
+ ),
458
+ 91 =>
459
+ array (
460
+ 'match' => 'E00C E05D',
461
+ 'replace' => 'E08A',
462
+ ),
463
+ 92 =>
464
+ array (
465
+ 'match' => 'E00D E05D',
466
+ 'replace' => 'E08B',
467
+ ),
468
+ 93 =>
469
+ array (
470
+ 'match' => 'E00E E05D',
471
+ 'replace' => 'E08C',
472
+ ),
473
+ 94 =>
474
+ array (
475
+ 'match' => 'E00F E05D',
476
+ 'replace' => 'E08D',
477
+ ),
478
+ 95 =>
479
+ array (
480
+ 'match' => 'E010 E05D',
481
+ 'replace' => 'E08E',
482
+ ),
483
+ 96 =>
484
+ array (
485
+ 'match' => 'E011 E05D',
486
+ 'replace' => 'E08F',
487
+ ),
488
+ 97 =>
489
+ array (
490
+ 'match' => 'E012 E05D',
491
+ 'replace' => 'E090',
492
+ ),
493
+ 98 =>
494
+ array (
495
+ 'match' => 'E013 E05D',
496
+ 'replace' => 'E091',
497
+ ),
498
+ 99 =>
499
+ array (
500
+ 'match' => 'E014 E05D',
501
+ 'replace' => 'E092',
502
+ ),
503
+ 100 =>
504
+ array (
505
+ 'match' => 'E015 E05D',
506
+ 'replace' => 'E093',
507
+ ),
508
+ 101 =>
509
+ array (
510
+ 'match' => 'E016 E05D',
511
+ 'replace' => 'E094',
512
+ ),
513
+ 102 =>
514
+ array (
515
+ 'match' => 'E017 E05D',
516
+ 'replace' => 'E095',
517
+ ),
518
+ 103 =>
519
+ array (
520
+ 'match' => 'E018 E05D',
521
+ 'replace' => 'E096',
522
+ ),
523
+ 104 =>
524
+ array (
525
+ 'match' => 'E019 E05D',
526
+ 'replace' => 'E097',
527
+ ),
528
+ 105 =>
529
+ array (
530
+ 'match' => 'E01A E05D',
531
+ 'replace' => 'E098',
532
+ ),
533
+ 106 =>
534
+ array (
535
+ 'match' => 'E01B E05D',
536
+ 'replace' => 'E099',
537
+ ),
538
+ 107 =>
539
+ array (
540
+ 'match' => 'E01C E05D',
541
+ 'replace' => 'E09A',
542
+ ),
543
+ 108 =>
544
+ array (
545
+ 'match' => 'E01D E05D',
546
+ 'replace' => 'E09B',
547
+ ),
548
+ 109 =>
549
+ array (
550
+ 'match' => 'E01E E05D',
551
+ 'replace' => 'E09C',
552
+ ),
553
+ 110 =>
554
+ array (
555
+ 'match' => 'E01F E05D',
556
+ 'replace' => 'E09D',
557
+ ),
558
+ 111 =>
559
+ array (
560
+ 'match' => 'E020 E05D',
561
+ 'replace' => 'E09E',
562
+ ),
563
+ 112 =>
564
+ array (
565
+ 'match' => 'E021 E05D',
566
+ 'replace' => 'E09F',
567
+ ),
568
+ 113 =>
569
+ array (
570
+ 'match' => 'E022 E05D',
571
+ 'replace' => 'E0A0',
572
+ ),
573
+ 114 =>
574
+ array (
575
+ 'match' => 'E023 E05D',
576
+ 'replace' => 'E0A1',
577
+ ),
578
+ 115 =>
579
+ array (
580
+ 'match' => 'E024 E05D',
581
+ 'replace' => 'E0A2',
582
+ ),
583
+ 116 =>
584
+ array (
585
+ 'match' => 'E025 E05D',
586
+ 'replace' => 'E0A3',
587
+ ),
588
+ 117 =>
589
+ array (
590
+ 'match' => 'E026 E05D',
591
+ 'replace' => 'E0A4',
592
+ ),
593
+ 118 =>
594
+ array (
595
+ 'match' => 'E027 E05D',
596
+ 'replace' => 'E0A5',
597
+ ),
598
+ 119 =>
599
+ array (
600
+ 'match' => '0A95 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
601
+ 'replace' => 'E0A6 \\1',
602
+ ),
603
+ 120 =>
604
+ array (
605
+ 'match' => '0A96 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
606
+ 'replace' => 'E0A7 \\1',
607
+ ),
608
+ 121 =>
609
+ array (
610
+ 'match' => '0A97 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
611
+ 'replace' => 'E0A8 \\1',
612
+ ),
613
+ 122 =>
614
+ array (
615
+ 'match' => '0A98 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
616
+ 'replace' => 'E0A9 \\1',
617
+ ),
618
+ 123 =>
619
+ array (
620
+ 'match' => '0A99 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
621
+ 'replace' => 'E0AA \\1',
622
+ ),
623
+ 124 =>
624
+ array (
625
+ 'match' => '0A9A 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
626
+ 'replace' => 'E0AB \\1',
627
+ ),
628
+ 125 =>
629
+ array (
630
+ 'match' => '0A9B 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
631
+ 'replace' => 'E0AC \\1',
632
+ ),
633
+ 126 =>
634
+ array (
635
+ 'match' => '0A9C 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
636
+ 'replace' => 'E0AD \\1',
637
+ ),
638
+ 127 =>
639
+ array (
640
+ 'match' => '0A9D 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
641
+ 'replace' => 'E0AE \\1',
642
+ ),
643
+ 128 =>
644
+ array (
645
+ 'match' => '0A9E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
646
+ 'replace' => 'E0AF \\1',
647
+ ),
648
+ 129 =>
649
+ array (
650
+ 'match' => '0A9F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
651
+ 'replace' => 'E0B0 \\1',
652
+ ),
653
+ 130 =>
654
+ array (
655
+ 'match' => '0AA0 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
656
+ 'replace' => 'E0B1 \\1',
657
+ ),
658
+ 131 =>
659
+ array (
660
+ 'match' => '0AA1 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
661
+ 'replace' => 'E0B2 \\1',
662
+ ),
663
+ 132 =>
664
+ array (
665
+ 'match' => '0AA2 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
666
+ 'replace' => 'E0B3 \\1',
667
+ ),
668
+ 133 =>
669
+ array (
670
+ 'match' => '0AA3 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
671
+ 'replace' => 'E0B4 \\1',
672
+ ),
673
+ 134 =>
674
+ array (
675
+ 'match' => '0AA4 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
676
+ 'replace' => 'E0B5 \\1',
677
+ ),
678
+ 135 =>
679
+ array (
680
+ 'match' => '0AA5 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
681
+ 'replace' => 'E0B6 \\1',
682
+ ),
683
+ 136 =>
684
+ array (
685
+ 'match' => '0AA6 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
686
+ 'replace' => 'E0B7 \\1',
687
+ ),
688
+ 137 =>
689
+ array (
690
+ 'match' => '0AA7 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
691
+ 'replace' => 'E0B8 \\1',
692
+ ),
693
+ 138 =>
694
+ array (
695
+ 'match' => '0AA8 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
696
+ 'replace' => 'E0B9 \\1',
697
+ ),
698
+ 139 =>
699
+ array (
700
+ 'match' => '0AAA 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
701
+ 'replace' => 'E0BA \\1',
702
+ ),
703
+ 140 =>
704
+ array (
705
+ 'match' => '0AAB 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
706
+ 'replace' => 'E0BB \\1',
707
+ ),
708
+ 141 =>
709
+ array (
710
+ 'match' => '0AAC 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
711
+ 'replace' => 'E0BC \\1',
712
+ ),
713
+ 142 =>
714
+ array (
715
+ 'match' => '0AAD 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
716
+ 'replace' => 'E0BD \\1',
717
+ ),
718
+ 143 =>
719
+ array (
720
+ 'match' => '0AAE 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
721
+ 'replace' => 'E0BE \\1',
722
+ ),
723
+ 144 =>
724
+ array (
725
+ 'match' => '0AAF 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
726
+ 'replace' => 'E0BF \\1',
727
+ ),
728
+ 145 =>
729
+ array (
730
+ 'match' => '0AB0 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
731
+ 'replace' => 'E0C0 \\1',
732
+ ),
733
+ 146 =>
734
+ array (
735
+ 'match' => '0AB2 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
736
+ 'replace' => 'E0C1 \\1',
737
+ ),
738
+ 147 =>
739
+ array (
740
+ 'match' => '0AB3 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
741
+ 'replace' => 'E0C2 \\1',
742
+ ),
743
+ 148 =>
744
+ array (
745
+ 'match' => '0AB5 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
746
+ 'replace' => 'E0C3 \\1',
747
+ ),
748
+ 149 =>
749
+ array (
750
+ 'match' => '0AB6 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
751
+ 'replace' => 'E0C4 \\1',
752
+ ),
753
+ 150 =>
754
+ array (
755
+ 'match' => '0AB7 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
756
+ 'replace' => 'E0C5 \\1',
757
+ ),
758
+ 151 =>
759
+ array (
760
+ 'match' => '0AB8 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
761
+ 'replace' => 'E0C6 \\1',
762
+ ),
763
+ 152 =>
764
+ array (
765
+ 'match' => '0AB9 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
766
+ 'replace' => 'E0C7 \\1',
767
+ ),
768
+ 153 =>
769
+ array (
770
+ 'match' => 'E002 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
771
+ 'replace' => 'E0C8 \\1',
772
+ ),
773
+ 154 =>
774
+ array (
775
+ 'match' => 'E003 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
776
+ 'replace' => 'E0C9 \\1',
777
+ ),
778
+ 155 =>
779
+ array (
780
+ 'match' => 'E004 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
781
+ 'replace' => 'E0CA \\1',
782
+ ),
783
+ 156 =>
784
+ array (
785
+ 'match' => 'E005 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
786
+ 'replace' => 'E0CB \\1',
787
+ ),
788
+ 157 =>
789
+ array (
790
+ 'match' => 'E006 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
791
+ 'replace' => 'E0CC \\1',
792
+ ),
793
+ 158 =>
794
+ array (
795
+ 'match' => 'E007 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
796
+ 'replace' => 'E0CD \\1',
797
+ ),
798
+ 159 =>
799
+ array (
800
+ 'match' => 'E008 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
801
+ 'replace' => 'E0CE \\1',
802
+ ),
803
+ 160 =>
804
+ array (
805
+ 'match' => 'E009 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
806
+ 'replace' => 'E0CF \\1',
807
+ ),
808
+ 161 =>
809
+ array (
810
+ 'match' => 'E00A 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
811
+ 'replace' => 'E0D0 \\1',
812
+ ),
813
+ 162 =>
814
+ array (
815
+ 'match' => 'E00B 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
816
+ 'replace' => 'E0D1 \\1',
817
+ ),
818
+ 163 =>
819
+ array (
820
+ 'match' => 'E00C 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
821
+ 'replace' => 'E0D2 \\1',
822
+ ),
823
+ 164 =>
824
+ array (
825
+ 'match' => 'E00D 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
826
+ 'replace' => 'E0D3 \\1',
827
+ ),
828
+ 165 =>
829
+ array (
830
+ 'match' => 'E00E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
831
+ 'replace' => 'E0D4 \\1',
832
+ ),
833
+ 166 =>
834
+ array (
835
+ 'match' => 'E00F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
836
+ 'replace' => 'E0D5 \\1',
837
+ ),
838
+ 167 =>
839
+ array (
840
+ 'match' => 'E010 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
841
+ 'replace' => 'E0D6 \\1',
842
+ ),
843
+ 168 =>
844
+ array (
845
+ 'match' => 'E011 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
846
+ 'replace' => 'E0D7 \\1',
847
+ ),
848
+ 169 =>
849
+ array (
850
+ 'match' => 'E012 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
851
+ 'replace' => 'E0D8 \\1',
852
+ ),
853
+ 170 =>
854
+ array (
855
+ 'match' => 'E013 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
856
+ 'replace' => 'E0D9 \\1',
857
+ ),
858
+ 171 =>
859
+ array (
860
+ 'match' => 'E014 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
861
+ 'replace' => 'E0DA \\1',
862
+ ),
863
+ 172 =>
864
+ array (
865
+ 'match' => 'E015 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
866
+ 'replace' => 'E0DB \\1',
867
+ ),
868
+ 173 =>
869
+ array (
870
+ 'match' => 'E016 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
871
+ 'replace' => 'E0DC \\1',
872
+ ),
873
+ 174 =>
874
+ array (
875
+ 'match' => 'E017 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
876
+ 'replace' => 'E0DD \\1',
877
+ ),
878
+ 175 =>
879
+ array (
880
+ 'match' => 'E018 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
881
+ 'replace' => 'E0DE \\1',
882
+ ),
883
+ 176 =>
884
+ array (
885
+ 'match' => 'E019 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
886
+ 'replace' => 'E0DF \\1',
887
+ ),
888
+ 177 =>
889
+ array (
890
+ 'match' => 'E01A 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
891
+ 'replace' => 'E0E0 \\1',
892
+ ),
893
+ 178 =>
894
+ array (
895
+ 'match' => 'E01B 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
896
+ 'replace' => 'E0E1 \\1',
897
+ ),
898
+ 179 =>
899
+ array (
900
+ 'match' => 'E01C 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
901
+ 'replace' => 'E0E2 \\1',
902
+ ),
903
+ 180 =>
904
+ array (
905
+ 'match' => 'E01D 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
906
+ 'replace' => 'E0E3 \\1',
907
+ ),
908
+ 181 =>
909
+ array (
910
+ 'match' => 'E01E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
911
+ 'replace' => 'E0E4 \\1',
912
+ ),
913
+ 182 =>
914
+ array (
915
+ 'match' => 'E01F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
916
+ 'replace' => 'E0E5 \\1',
917
+ ),
918
+ 183 =>
919
+ array (
920
+ 'match' => 'E020 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
921
+ 'replace' => 'E0E6 \\1',
922
+ ),
923
+ 184 =>
924
+ array (
925
+ 'match' => 'E021 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
926
+ 'replace' => 'E0E7 \\1',
927
+ ),
928
+ 185 =>
929
+ array (
930
+ 'match' => 'E022 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
931
+ 'replace' => 'E0E8 \\1',
932
+ ),
933
+ 186 =>
934
+ array (
935
+ 'match' => 'E023 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
936
+ 'replace' => 'E0E9 \\1',
937
+ ),
938
+ 187 =>
939
+ array (
940
+ 'match' => 'E024 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
941
+ 'replace' => 'E0EA \\1',
942
+ ),
943
+ 188 =>
944
+ array (
945
+ 'match' => 'E025 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
946
+ 'replace' => 'E0EB \\1',
947
+ ),
948
+ 189 =>
949
+ array (
950
+ 'match' => 'E026 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
951
+ 'replace' => 'E0EC \\1',
952
+ ),
953
+ 190 =>
954
+ array (
955
+ 'match' => 'E027 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
956
+ 'replace' => 'E0ED \\1',
957
+ ),
958
+ 191 =>
959
+ array (
960
+ 'match' => 'E05E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
961
+ 'replace' => 'E0EE \\1',
962
+ ),
963
+ 192 =>
964
+ array (
965
+ 'match' => 'E05F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
966
+ 'replace' => 'E0EF \\1',
967
+ ),
968
+ 193 =>
969
+ array (
970
+ 'match' => 'E060 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
971
+ 'replace' => 'E0F0 \\1',
972
+ ),
973
+ 194 =>
974
+ array (
975
+ 'match' => 'E061 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
976
+ 'replace' => 'E0F1 \\1',
977
+ ),
978
+ 195 =>
979
+ array (
980
+ 'match' => 'E062 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
981
+ 'replace' => 'E0F2 \\1',
982
+ ),
983
+ 196 =>
984
+ array (
985
+ 'match' => 'E063 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
986
+ 'replace' => 'E0F3 \\1',
987
+ ),
988
+ 197 =>
989
+ array (
990
+ 'match' => 'E064 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
991
+ 'replace' => 'E0F4 \\1',
992
+ ),
993
+ 198 =>
994
+ array (
995
+ 'match' => 'E065 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
996
+ 'replace' => 'E0F5 \\1',
997
+ ),
998
+ 199 =>
999
+ array (
1000
+ 'match' => 'E066 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1001
+ 'replace' => 'E0F6 \\1',
1002
+ ),
1003
+ 200 =>
1004
+ array (
1005
+ 'match' => 'E067 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1006
+ 'replace' => 'E0F7 \\1',
1007
+ ),
1008
+ 201 =>
1009
+ array (
1010
+ 'match' => 'E068 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1011
+ 'replace' => 'E0F8 \\1',
1012
+ ),
1013
+ 202 =>
1014
+ array (
1015
+ 'match' => 'E069 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1016
+ 'replace' => 'E0F9 \\1',
1017
+ ),
1018
+ 203 =>
1019
+ array (
1020
+ 'match' => 'E06A 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1021
+ 'replace' => 'E0FA \\1',
1022
+ ),
1023
+ 204 =>
1024
+ array (
1025
+ 'match' => 'E06B 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1026
+ 'replace' => 'E0FB \\1',
1027
+ ),
1028
+ 205 =>
1029
+ array (
1030
+ 'match' => 'E06C 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1031
+ 'replace' => 'E0FC \\1',
1032
+ ),
1033
+ 206 =>
1034
+ array (
1035
+ 'match' => 'E06D 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1036
+ 'replace' => 'E0FD \\1',
1037
+ ),
1038
+ 207 =>
1039
+ array (
1040
+ 'match' => 'E06E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1041
+ 'replace' => 'E0FE \\1',
1042
+ ),
1043
+ 208 =>
1044
+ array (
1045
+ 'match' => 'E06F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1046
+ 'replace' => 'E0FF \\1',
1047
+ ),
1048
+ 209 =>
1049
+ array (
1050
+ 'match' => 'E070 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1051
+ 'replace' => 'E100 \\1',
1052
+ ),
1053
+ 210 =>
1054
+ array (
1055
+ 'match' => 'E071 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1056
+ 'replace' => 'E101 \\1',
1057
+ ),
1058
+ 211 =>
1059
+ array (
1060
+ 'match' => 'E072 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1061
+ 'replace' => 'E102 \\1',
1062
+ ),
1063
+ 212 =>
1064
+ array (
1065
+ 'match' => 'E073 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1066
+ 'replace' => 'E103 \\1',
1067
+ ),
1068
+ 213 =>
1069
+ array (
1070
+ 'match' => 'E074 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1071
+ 'replace' => 'E104 \\1',
1072
+ ),
1073
+ 214 =>
1074
+ array (
1075
+ 'match' => 'E075 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1076
+ 'replace' => 'E105 \\1',
1077
+ ),
1078
+ 215 =>
1079
+ array (
1080
+ 'match' => 'E076 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1081
+ 'replace' => 'E106 \\1',
1082
+ ),
1083
+ 216 =>
1084
+ array (
1085
+ 'match' => 'E077 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1086
+ 'replace' => 'E107 \\1',
1087
+ ),
1088
+ 217 =>
1089
+ array (
1090
+ 'match' => 'E078 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1091
+ 'replace' => 'E108 \\1',
1092
+ ),
1093
+ 218 =>
1094
+ array (
1095
+ 'match' => 'E079 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1096
+ 'replace' => 'E109 \\1',
1097
+ ),
1098
+ 219 =>
1099
+ array (
1100
+ 'match' => 'E07A 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1101
+ 'replace' => 'E10A \\1',
1102
+ ),
1103
+ 220 =>
1104
+ array (
1105
+ 'match' => 'E07B 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1106
+ 'replace' => 'E10B \\1',
1107
+ ),
1108
+ 221 =>
1109
+ array (
1110
+ 'match' => 'E07C 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1111
+ 'replace' => 'E10C \\1',
1112
+ ),
1113
+ 222 =>
1114
+ array (
1115
+ 'match' => 'E07D 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1116
+ 'replace' => 'E10D \\1',
1117
+ ),
1118
+ 223 =>
1119
+ array (
1120
+ 'match' => 'E07E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1121
+ 'replace' => 'E10E \\1',
1122
+ ),
1123
+ 224 =>
1124
+ array (
1125
+ 'match' => 'E07F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1126
+ 'replace' => 'E10F \\1',
1127
+ ),
1128
+ 225 =>
1129
+ array (
1130
+ 'match' => 'E080 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1131
+ 'replace' => 'E110 \\1',
1132
+ ),
1133
+ 226 =>
1134
+ array (
1135
+ 'match' => 'E081 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1136
+ 'replace' => 'E111 \\1',
1137
+ ),
1138
+ 227 =>
1139
+ array (
1140
+ 'match' => 'E082 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1141
+ 'replace' => 'E112 \\1',
1142
+ ),
1143
+ 228 =>
1144
+ array (
1145
+ 'match' => 'E083 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1146
+ 'replace' => 'E113 \\1',
1147
+ ),
1148
+ 229 =>
1149
+ array (
1150
+ 'match' => 'E084 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1151
+ 'replace' => 'E114 \\1',
1152
+ ),
1153
+ 230 =>
1154
+ array (
1155
+ 'match' => 'E085 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1156
+ 'replace' => 'E115 \\1',
1157
+ ),
1158
+ 231 =>
1159
+ array (
1160
+ 'match' => 'E086 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1161
+ 'replace' => 'E116 \\1',
1162
+ ),
1163
+ 232 =>
1164
+ array (
1165
+ 'match' => 'E087 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1166
+ 'replace' => 'E117 \\1',
1167
+ ),
1168
+ 233 =>
1169
+ array (
1170
+ 'match' => 'E088 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1171
+ 'replace' => 'E118 \\1',
1172
+ ),
1173
+ 234 =>
1174
+ array (
1175
+ 'match' => 'E089 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1176
+ 'replace' => 'E119 \\1',
1177
+ ),
1178
+ 235 =>
1179
+ array (
1180
+ 'match' => 'E08A 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1181
+ 'replace' => 'E11A \\1',
1182
+ ),
1183
+ 236 =>
1184
+ array (
1185
+ 'match' => 'E08B 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1186
+ 'replace' => 'E11B \\1',
1187
+ ),
1188
+ 237 =>
1189
+ array (
1190
+ 'match' => 'E08C 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1191
+ 'replace' => 'E11C \\1',
1192
+ ),
1193
+ 238 =>
1194
+ array (
1195
+ 'match' => 'E08D 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1196
+ 'replace' => 'E11D \\1',
1197
+ ),
1198
+ 239 =>
1199
+ array (
1200
+ 'match' => 'E08E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1201
+ 'replace' => 'E11E \\1',
1202
+ ),
1203
+ 240 =>
1204
+ array (
1205
+ 'match' => 'E08F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1206
+ 'replace' => 'E11F \\1',
1207
+ ),
1208
+ 241 =>
1209
+ array (
1210
+ 'match' => 'E090 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1211
+ 'replace' => 'E120 \\1',
1212
+ ),
1213
+ 242 =>
1214
+ array (
1215
+ 'match' => 'E091 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1216
+ 'replace' => 'E121 \\1',
1217
+ ),
1218
+ 243 =>
1219
+ array (
1220
+ 'match' => 'E092 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1221
+ 'replace' => 'E122 \\1',
1222
+ ),
1223
+ 244 =>
1224
+ array (
1225
+ 'match' => 'E093 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1226
+ 'replace' => 'E123 \\1',
1227
+ ),
1228
+ 245 =>
1229
+ array (
1230
+ 'match' => 'E094 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1231
+ 'replace' => 'E124 \\1',
1232
+ ),
1233
+ 246 =>
1234
+ array (
1235
+ 'match' => 'E095 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1236
+ 'replace' => 'E125 \\1',
1237
+ ),
1238
+ 247 =>
1239
+ array (
1240
+ 'match' => 'E096 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1241
+ 'replace' => 'E126 \\1',
1242
+ ),
1243
+ 248 =>
1244
+ array (
1245
+ 'match' => 'E097 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1246
+ 'replace' => 'E127 \\1',
1247
+ ),
1248
+ 249 =>
1249
+ array (
1250
+ 'match' => 'E098 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1251
+ 'replace' => 'E128 \\1',
1252
+ ),
1253
+ 250 =>
1254
+ array (
1255
+ 'match' => 'E099 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1256
+ 'replace' => 'E129 \\1',
1257
+ ),
1258
+ 251 =>
1259
+ array (
1260
+ 'match' => 'E09A 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1261
+ 'replace' => 'E12A \\1',
1262
+ ),
1263
+ 252 =>
1264
+ array (
1265
+ 'match' => 'E09B 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1266
+ 'replace' => 'E12B \\1',
1267
+ ),
1268
+ 253 =>
1269
+ array (
1270
+ 'match' => 'E09C 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1271
+ 'replace' => 'E12C \\1',
1272
+ ),
1273
+ 254 =>
1274
+ array (
1275
+ 'match' => 'E09D 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1276
+ 'replace' => 'E12D \\1',
1277
+ ),
1278
+ 255 =>
1279
+ array (
1280
+ 'match' => 'E09E 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1281
+ 'replace' => 'E12E \\1',
1282
+ ),
1283
+ 256 =>
1284
+ array (
1285
+ 'match' => 'E09F 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1286
+ 'replace' => 'E12F \\1',
1287
+ ),
1288
+ 257 =>
1289
+ array (
1290
+ 'match' => 'E0A0 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1291
+ 'replace' => 'E130 \\1',
1292
+ ),
1293
+ 258 =>
1294
+ array (
1295
+ 'match' => 'E0A1 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1296
+ 'replace' => 'E131 \\1',
1297
+ ),
1298
+ 259 =>
1299
+ array (
1300
+ 'match' => 'E0A2 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1301
+ 'replace' => 'E132 \\1',
1302
+ ),
1303
+ 260 =>
1304
+ array (
1305
+ 'match' => 'E0A3 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1306
+ 'replace' => 'E133 \\1',
1307
+ ),
1308
+ 261 =>
1309
+ array (
1310
+ 'match' => 'E0A4 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1311
+ 'replace' => 'E134 \\1',
1312
+ ),
1313
+ 262 =>
1314
+ array (
1315
+ 'match' => 'E0A5 0ACD ((0A95|0A96|0A97|0A98|0A99|0A9A|0A9B|0A9C|0A9D|0A9E|0A9F|0AA0|0AA1|0AA2|0AA3|0AA4|0AA5|0AA6|0AA7|0AA8|0AAA|0AAB|0AAC|0AAD|0AAE|0AAF|0AB0|0AB2|0AB3|0AB5|0AB6|0AB7|0AB8|0AB9|E002|E003|E004|E005|E006|E007|E008|E009|E00A|E00B|E00C|E00D|E00E|E00F|E010|E011|E012|E013|E014|E015|E016|E017|E018|E019|E01A|E01B|E01C|E01D|E01E|E01F|E020|E021|E022|E023|E024|E025|E026|E027|E05E|E05F|E060|E061|E062|E063|E064|E065|E066|E067|E068|E069|E06A|E06B|E06C|E06D|E06E|E06F|E070|E071|E072|E073|E074|E075|E076|E077|E078|E079|E07A|E07B|E07C|E07D|E07E|E07F|E080|E081|E082|E083|E084|E085|E086|E087|E088|E089|E08A|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E136|E137|E138|E139|E13A|E13B|E13C|E13D|E13E|E13F|E140|E141|E142|E143|E144|E145|E146|E147|E148|E149|E14A|E14B|E14C|E14D|E14E|E14F|E150|E151|E152|E153|E154|E155|E156|E157|E158|E159|E15A|E15B|E15C|E15D|E15E))',
1316
+ 'replace' => 'E135 \\1',
1317
+ ),
1318
+ 263 =>
1319
+ array (
1320
+ 'match' => '0A95 0ACD (200D)',
1321
+ 'replace' => 'E0A6 \\1',
1322
+ ),
1323
+ 264 =>
1324
+ array (
1325
+ 'match' => '0A96 0ACD (200D)',
1326
+ 'replace' => 'E0A7 \\1',
1327
+ ),
1328
+ 265 =>
1329
+ array (
1330
+ 'match' => '0A97 0ACD (200D)',
1331
+ 'replace' => 'E0A8 \\1',
1332
+ ),
1333
+ 266 =>
1334
+ array (
1335
+ 'match' => '0A98 0ACD (200D)',
1336
+ 'replace' => 'E0A9 \\1',
1337
+ ),
1338
+ 267 =>
1339
+ array (
1340
+ 'match' => '0A99 0ACD (200D)',
1341
+ 'replace' => 'E0AA \\1',
1342
+ ),
1343
+ 268 =>
1344
+ array (
1345
+ 'match' => '0A9A 0ACD (200D)',
1346
+ 'replace' => 'E0AB \\1',
1347
+ ),
1348
+ 269 =>
1349
+ array (
1350
+ 'match' => '0A9B 0ACD (200D)',
1351
+ 'replace' => 'E0AC \\1',
1352
+ ),
1353
+ 270 =>
1354
+ array (
1355
+ 'match' => '0A9C 0ACD (200D)',
1356
+ 'replace' => 'E0AD \\1',
1357
+ ),
1358
+ 271 =>
1359
+ array (
1360
+ 'match' => '0A9D 0ACD (200D)',
1361
+ 'replace' => 'E0AE \\1',
1362
+ ),
1363
+ 272 =>
1364
+ array (
1365
+ 'match' => '0A9E 0ACD (200D)',
1366
+ 'replace' => 'E0AF \\1',
1367
+ ),
1368
+ 273 =>
1369
+ array (
1370
+ 'match' => '0A9F 0ACD (200D)',
1371
+ 'replace' => 'E0B0 \\1',
1372
+ ),
1373
+ 274 =>
1374
+ array (
1375
+ 'match' => '0AA0 0ACD (200D)',
1376
+ 'replace' => 'E0B1 \\1',
1377
+ ),
1378
+ 275 =>
1379
+ array (
1380
+ 'match' => '0AA1 0ACD (200D)',
1381
+ 'replace' => 'E0B2 \\1',
1382
+ ),
1383
+ 276 =>
1384
+ array (
1385
+ 'match' => '0AA2 0ACD (200D)',
1386
+ 'replace' => 'E0B3 \\1',
1387
+ ),
1388
+ 277 =>
1389
+ array (
1390
+ 'match' => '0AA3 0ACD (200D)',
1391
+ 'replace' => 'E0B4 \\1',
1392
+ ),
1393
+ 278 =>
1394
+ array (
1395
+ 'match' => '0AA4 0ACD (200D)',
1396
+ 'replace' => 'E0B5 \\1',
1397
+ ),
1398
+ 279 =>
1399
+ array (
1400
+ 'match' => '0AA5 0ACD (200D)',
1401
+ 'replace' => 'E0B6 \\1',
1402
+ ),
1403
+ 280 =>
1404
+ array (
1405
+ 'match' => '0AA6 0ACD (200D)',
1406
+ 'replace' => 'E0B7 \\1',
1407
+ ),
1408
+ 281 =>
1409
+ array (
1410
+ 'match' => '0AA7 0ACD (200D)',
1411
+ 'replace' => 'E0B8 \\1',
1412
+ ),
1413
+ 282 =>
1414
+ array (
1415
+ 'match' => '0AA8 0ACD (200D)',
1416
+ 'replace' => 'E0B9 \\1',
1417
+ ),
1418
+ 283 =>
1419
+ array (
1420
+ 'match' => '0AAA 0ACD (200D)',
1421
+ 'replace' => 'E0BA \\1',
1422
+ ),
1423
+ 284 =>
1424
+ array (
1425
+ 'match' => '0AAB 0ACD (200D)',
1426
+ 'replace' => 'E0BB \\1',
1427
+ ),
1428
+ 285 =>
1429
+ array (
1430
+ 'match' => '0AAC 0ACD (200D)',
1431
+ 'replace' => 'E0BC \\1',
1432
+ ),
1433
+ 286 =>
1434
+ array (
1435
+ 'match' => '0AAD 0ACD (200D)',
1436
+ 'replace' => 'E0BD \\1',
1437
+ ),
1438
+ 287 =>
1439
+ array (
1440
+ 'match' => '0AAE 0ACD (200D)',
1441
+ 'replace' => 'E0BE \\1',
1442
+ ),
1443
+ 288 =>
1444
+ array (
1445
+ 'match' => '0AAF 0ACD (200D)',
1446
+ 'replace' => 'E0BF \\1',
1447
+ ),
1448
+ 289 =>
1449
+ array (
1450
+ 'match' => '0AB0 0ACD (200D)',
1451
+ 'replace' => 'E0C0 \\1',
1452
+ ),
1453
+ 290 =>
1454
+ array (
1455
+ 'match' => '0AB2 0ACD (200D)',
1456
+ 'replace' => 'E0C1 \\1',
1457
+ ),
1458
+ 291 =>
1459
+ array (
1460
+ 'match' => '0AB3 0ACD (200D)',
1461
+ 'replace' => 'E0C2 \\1',
1462
+ ),
1463
+ 292 =>
1464
+ array (
1465
+ 'match' => '0AB5 0ACD (200D)',
1466
+ 'replace' => 'E0C3 \\1',
1467
+ ),
1468
+ 293 =>
1469
+ array (
1470
+ 'match' => '0AB6 0ACD (200D)',
1471
+ 'replace' => 'E0C4 \\1',
1472
+ ),
1473
+ 294 =>
1474
+ array (
1475
+ 'match' => '0AB7 0ACD (200D)',
1476
+ 'replace' => 'E0C5 \\1',
1477
+ ),
1478
+ 295 =>
1479
+ array (
1480
+ 'match' => '0AB8 0ACD (200D)',
1481
+ 'replace' => 'E0C6 \\1',
1482
+ ),
1483
+ 296 =>
1484
+ array (
1485
+ 'match' => '0AB9 0ACD (200D)',
1486
+ 'replace' => 'E0C7 \\1',
1487
+ ),
1488
+ 297 =>
1489
+ array (
1490
+ 'match' => 'E002 0ACD (200D)',
1491
+ 'replace' => 'E0C8 \\1',
1492
+ ),
1493
+ 298 =>
1494
+ array (
1495
+ 'match' => 'E003 0ACD (200D)',
1496
+ 'replace' => 'E0C9 \\1',
1497
+ ),
1498
+ 299 =>
1499
+ array (
1500
+ 'match' => 'E004 0ACD (200D)',
1501
+ 'replace' => 'E0CA \\1',
1502
+ ),
1503
+ 300 =>
1504
+ array (
1505
+ 'match' => 'E005 0ACD (200D)',
1506
+ 'replace' => 'E0CB \\1',
1507
+ ),
1508
+ 301 =>
1509
+ array (
1510
+ 'match' => 'E006 0ACD (200D)',
1511
+ 'replace' => 'E0CC \\1',
1512
+ ),
1513
+ 302 =>
1514
+ array (
1515
+ 'match' => 'E007 0ACD (200D)',
1516
+ 'replace' => 'E0CD \\1',
1517
+ ),
1518
+ 303 =>
1519
+ array (
1520
+ 'match' => 'E008 0ACD (200D)',
1521
+ 'replace' => 'E0CE \\1',
1522
+ ),
1523
+ 304 =>
1524
+ array (
1525
+ 'match' => 'E009 0ACD (200D)',
1526
+ 'replace' => 'E0CF \\1',
1527
+ ),
1528
+ 305 =>
1529
+ array (
1530
+ 'match' => 'E00A 0ACD (200D)',
1531
+ 'replace' => 'E0D0 \\1',
1532
+ ),
1533
+ 306 =>
1534
+ array (
1535
+ 'match' => 'E00B 0ACD (200D)',
1536
+ 'replace' => 'E0D1 \\1',
1537
+ ),
1538
+ 307 =>
1539
+ array (
1540
+ 'match' => 'E00C 0ACD (200D)',
1541
+ 'replace' => 'E0D2 \\1',
1542
+ ),
1543
+ 308 =>
1544
+ array (
1545
+ 'match' => 'E00D 0ACD (200D)',
1546
+ 'replace' => 'E0D3 \\1',
1547
+ ),
1548
+ 309 =>
1549
+ array (
1550
+ 'match' => 'E00E 0ACD (200D)',
1551
+ 'replace' => 'E0D4 \\1',
1552
+ ),
1553
+ 310 =>
1554
+ array (
1555
+ 'match' => 'E00F 0ACD (200D)',
1556
+ 'replace' => 'E0D5 \\1',
1557
+ ),
1558
+ 311 =>
1559
+ array (
1560
+ 'match' => 'E010 0ACD (200D)',
1561
+ 'replace' => 'E0D6 \\1',
1562
+ ),
1563
+ 312 =>
1564
+ array (
1565
+ 'match' => 'E011 0ACD (200D)',
1566
+ 'replace' => 'E0D7 \\1',
1567
+ ),
1568
+ 313 =>
1569
+ array (
1570
+ 'match' => 'E012 0ACD (200D)',
1571
+ 'replace' => 'E0D8 \\1',
1572
+ ),
1573
+ 314 =>
1574
+ array (
1575
+ 'match' => 'E013 0ACD (200D)',
1576
+ 'replace' => 'E0D9 \\1',
1577
+ ),
1578
+ 315 =>
1579
+ array (
1580
+ 'match' => 'E014 0ACD (200D)',
1581
+ 'replace' => 'E0DA \\1',
1582
+ ),
1583
+ 316 =>
1584
+ array (
1585
+ 'match' => 'E015 0ACD (200D)',
1586
+ 'replace' => 'E0DB \\1',
1587
+ ),
1588
+ 317 =>
1589
+ array (
1590
+ 'match' => 'E016 0ACD (200D)',
1591
+ 'replace' => 'E0DC \\1',
1592
+ ),
1593
+ 318 =>
1594
+ array (
1595
+ 'match' => 'E017 0ACD (200D)',
1596
+ 'replace' => 'E0DD \\1',
1597
+ ),
1598
+ 319 =>
1599
+ array (
1600
+ 'match' => 'E018 0ACD (200D)',
1601
+ 'replace' => 'E0DE \\1',
1602
+ ),
1603
+ 320 =>
1604
+ array (
1605
+ 'match' => 'E019 0ACD (200D)',
1606
+ 'replace' => 'E0DF \\1',
1607
+ ),
1608
+ 321 =>
1609
+ array (
1610
+ 'match' => 'E01A 0ACD (200D)',
1611
+ 'replace' => 'E0E0 \\1',
1612
+ ),
1613
+ 322 =>
1614
+ array (
1615
+ 'match' => 'E01B 0ACD (200D)',
1616
+ 'replace' => 'E0E1 \\1',
1617
+ ),
1618
+ 323 =>
1619
+ array (
1620
+ 'match' => 'E01C 0ACD (200D)',
1621
+ 'replace' => 'E0E2 \\1',
1622
+ ),
1623
+ 324 =>
1624
+ array (
1625
+ 'match' => 'E01D 0ACD (200D)',
1626
+ 'replace' => 'E0E3 \\1',
1627
+ ),
1628
+ 325 =>
1629
+ array (
1630
+ 'match' => 'E01E 0ACD (200D)',
1631
+ 'replace' => 'E0E4 \\1',
1632
+ ),
1633
+ 326 =>
1634
+ array (
1635
+ 'match' => 'E01F 0ACD (200D)',
1636
+ 'replace' => 'E0E5 \\1',
1637
+ ),
1638
+ 327 =>
1639
+ array (
1640
+ 'match' => 'E020 0ACD (200D)',
1641
+ 'replace' => 'E0E6 \\1',
1642
+ ),
1643
+ 328 =>
1644
+ array (
1645
+ 'match' => 'E021 0ACD (200D)',
1646
+ 'replace' => 'E0E7 \\1',
1647
+ ),
1648
+ 329 =>
1649
+ array (
1650
+ 'match' => 'E022 0ACD (200D)',
1651
+ 'replace' => 'E0E8 \\1',
1652
+ ),
1653
+ 330 =>
1654
+ array (
1655
+ 'match' => 'E023 0ACD (200D)',
1656
+ 'replace' => 'E0E9 \\1',
1657
+ ),
1658
+ 331 =>
1659
+ array (
1660
+ 'match' => 'E024 0ACD (200D)',
1661
+ 'replace' => 'E0EA \\1',
1662
+ ),
1663
+ 332 =>
1664
+ array (
1665
+ 'match' => 'E025 0ACD (200D)',
1666
+ 'replace' => 'E0EB \\1',
1667
+ ),
1668
+ 333 =>
1669
+ array (
1670
+ 'match' => 'E026 0ACD (200D)',
1671
+ 'replace' => 'E0EC \\1',
1672
+ ),
1673
+ 334 =>
1674
+ array (
1675
+ 'match' => 'E027 0ACD (200D)',
1676
+ 'replace' => 'E0ED \\1',
1677
+ ),
1678
+ 335 =>
1679
+ array (
1680
+ 'match' => 'E05E 0ACD (200D)',
1681
+ 'replace' => 'E0EE \\1',
1682
+ ),
1683
+ 336 =>
1684
+ array (
1685
+ 'match' => 'E05F 0ACD (200D)',
1686
+ 'replace' => 'E0EF \\1',
1687
+ ),
1688
+ 337 =>
1689
+ array (
1690
+ 'match' => 'E060 0ACD (200D)',
1691
+ 'replace' => 'E0F0 \\1',
1692
+ ),
1693
+ 338 =>
1694
+ array (
1695
+ 'match' => 'E061 0ACD (200D)',
1696
+ 'replace' => 'E0F1 \\1',
1697
+ ),
1698
+ 339 =>
1699
+ array (
1700
+ 'match' => 'E062 0ACD (200D)',
1701
+ 'replace' => 'E0F2 \\1',
1702
+ ),
1703
+ 340 =>
1704
+ array (
1705
+ 'match' => 'E063 0ACD (200D)',
1706
+ 'replace' => 'E0F3 \\1',
1707
+ ),
1708
+ 341 =>
1709
+ array (
1710
+ 'match' => 'E064 0ACD (200D)',
1711
+ 'replace' => 'E0F4 \\1',
1712
+ ),
1713
+ 342 =>
1714
+ array (
1715
+ 'match' => 'E065 0ACD (200D)',
1716
+ 'replace' => 'E0F5 \\1',
1717
+ ),
1718
+ 343 =>
1719
+ array (
1720
+ 'match' => 'E066 0ACD (200D)',
1721
+ 'replace' => 'E0F6 \\1',
1722
+ ),
1723
+ 344 =>
1724
+ array (
1725
+ 'match' => 'E067 0ACD (200D)',
1726
+ 'replace' => 'E0F7 \\1',
1727
+ ),
1728
+ 345 =>
1729
+ array (
1730
+ 'match' => 'E068 0ACD (200D)',
1731
+ 'replace' => 'E0F8 \\1',
1732
+ ),
1733
+ 346 =>
1734
+ array (
1735
+ 'match' => 'E069 0ACD (200D)',
1736
+ 'replace' => 'E0F9 \\1',
1737
+ ),
1738
+ 347 =>
1739
+ array (
1740
+ 'match' => 'E06A 0ACD (200D)',
1741
+ 'replace' => 'E0FA \\1',
1742
+ ),
1743
+ 348 =>
1744
+ array (
1745
+ 'match' => 'E06B 0ACD (200D)',
1746
+ 'replace' => 'E0FB \\1',
1747
+ ),
1748
+ 349 =>
1749
+ array (
1750
+ 'match' => 'E06C 0ACD (200D)',
1751
+ 'replace' => 'E0FC \\1',
1752
+ ),
1753
+ 350 =>
1754
+ array (
1755
+ 'match' => 'E06D 0ACD (200D)',
1756
+ 'replace' => 'E0FD \\1',
1757
+ ),
1758
+ 351 =>
1759
+ array (
1760
+ 'match' => 'E06E 0ACD (200D)',
1761
+ 'replace' => 'E0FE \\1',
1762
+ ),
1763
+ 352 =>
1764
+ array (
1765
+ 'match' => 'E06F 0ACD (200D)',
1766
+ 'replace' => 'E0FF \\1',
1767
+ ),
1768
+ 353 =>
1769
+ array (
1770
+ 'match' => 'E070 0ACD (200D)',
1771
+ 'replace' => 'E100 \\1',
1772
+ ),
1773
+ 354 =>
1774
+ array (
1775
+ 'match' => 'E071 0ACD (200D)',
1776
+ 'replace' => 'E101 \\1',
1777
+ ),
1778
+ 355 =>
1779
+ array (
1780
+ 'match' => 'E072 0ACD (200D)',
1781
+ 'replace' => 'E102 \\1',
1782
+ ),
1783
+ 356 =>
1784
+ array (
1785
+ 'match' => 'E073 0ACD (200D)',
1786
+ 'replace' => 'E103 \\1',
1787
+ ),
1788
+ 357 =>
1789
+ array (
1790
+ 'match' => 'E074 0ACD (200D)',
1791
+ 'replace' => 'E104 \\1',
1792
+ ),
1793
+ 358 =>
1794
+ array (
1795
+ 'match' => 'E075 0ACD (200D)',
1796
+ 'replace' => 'E105 \\1',
1797
+ ),
1798
+ 359 =>
1799
+ array (
1800
+ 'match' => 'E076 0ACD (200D)',
1801
+ 'replace' => 'E106 \\1',
1802
+ ),
1803
+ 360 =>
1804
+ array (
1805
+ 'match' => 'E077 0ACD (200D)',
1806
+ 'replace' => 'E107 \\1',
1807
+ ),
1808
+ 361 =>
1809
+ array (
1810
+ 'match' => 'E078 0ACD (200D)',
1811
+ 'replace' => 'E108 \\1',
1812
+ ),
1813
+ 362 =>
1814
+ array (
1815
+ 'match' => 'E079 0ACD (200D)',
1816
+ 'replace' => 'E109 \\1',
1817
+ ),
1818
+ 363 =>
1819
+ array (
1820
+ 'match' => 'E07A 0ACD (200D)',
1821
+ 'replace' => 'E10A \\1',
1822
+ ),
1823
+ 364 =>
1824
+ array (
1825
+ 'match' => 'E07B 0ACD (200D)',
1826
+ 'replace' => 'E10B \\1',
1827
+ ),
1828
+ 365 =>
1829
+ array (
1830
+ 'match' => 'E07C 0ACD (200D)',
1831
+ 'replace' => 'E10C \\1',
1832
+ ),
1833
+ 366 =>
1834
+ array (
1835
+ 'match' => 'E07D 0ACD (200D)',
1836
+ 'replace' => 'E10D \\1',
1837
+ ),
1838
+ 367 =>
1839
+ array (
1840
+ 'match' => 'E07E 0ACD (200D)',
1841
+ 'replace' => 'E10E \\1',
1842
+ ),
1843
+ 368 =>
1844
+ array (
1845
+ 'match' => 'E07F 0ACD (200D)',
1846
+ 'replace' => 'E10F \\1',
1847
+ ),
1848
+ 369 =>
1849
+ array (
1850
+ 'match' => 'E080 0ACD (200D)',
1851
+ 'replace' => 'E110 \\1',
1852
+ ),
1853
+ 370 =>
1854
+ array (
1855
+ 'match' => 'E081 0ACD (200D)',
1856
+ 'replace' => 'E111 \\1',
1857
+ ),
1858
+ 371 =>
1859
+ array (
1860
+ 'match' => 'E082 0ACD (200D)',
1861
+ 'replace' => 'E112 \\1',
1862
+ ),
1863
+ 372 =>
1864
+ array (
1865
+ 'match' => 'E083 0ACD (200D)',
1866
+ 'replace' => 'E113 \\1',
1867
+ ),
1868
+ 373 =>
1869
+ array (
1870
+ 'match' => 'E084 0ACD (200D)',
1871
+ 'replace' => 'E114 \\1',
1872
+ ),
1873
+ 374 =>
1874
+ array (
1875
+ 'match' => 'E085 0ACD (200D)',
1876
+ 'replace' => 'E115 \\1',
1877
+ ),
1878
+ 375 =>
1879
+ array (
1880
+ 'match' => 'E086 0ACD (200D)',
1881
+ 'replace' => 'E116 \\1',
1882
+ ),
1883
+ 376 =>
1884
+ array (
1885
+ 'match' => 'E087 0ACD (200D)',
1886
+ 'replace' => 'E117 \\1',
1887
+ ),
1888
+ 377 =>
1889
+ array (
1890
+ 'match' => 'E088 0ACD (200D)',
1891
+ 'replace' => 'E118 \\1',
1892
+ ),
1893
+ 378 =>
1894
+ array (
1895
+ 'match' => 'E089 0ACD (200D)',
1896
+ 'replace' => 'E119 \\1',
1897
+ ),
1898
+ 379 =>
1899
+ array (
1900
+ 'match' => 'E08A 0ACD (200D)',
1901
+ 'replace' => 'E11A \\1',
1902
+ ),
1903
+ 380 =>
1904
+ array (
1905
+ 'match' => 'E08B 0ACD (200D)',
1906
+ 'replace' => 'E11B \\1',
1907
+ ),
1908
+ 381 =>
1909
+ array (
1910
+ 'match' => 'E08C 0ACD (200D)',
1911
+ 'replace' => 'E11C \\1',
1912
+ ),
1913
+ 382 =>
1914
+ array (
1915
+ 'match' => 'E08D 0ACD (200D)',
1916
+ 'replace' => 'E11D \\1',
1917
+ ),
1918
+ 383 =>
1919
+ array (
1920
+ 'match' => 'E08E 0ACD (200D)',
1921
+ 'replace' => 'E11E \\1',
1922
+ ),
1923
+ 384 =>
1924
+ array (
1925
+ 'match' => 'E08F 0ACD (200D)',
1926
+ 'replace' => 'E11F \\1',
1927
+ ),
1928
+ 385 =>
1929
+ array (
1930
+ 'match' => 'E090 0ACD (200D)',
1931
+ 'replace' => 'E120 \\1',
1932
+ ),
1933
+ 386 =>
1934
+ array (
1935
+ 'match' => 'E091 0ACD (200D)',
1936
+ 'replace' => 'E121 \\1',
1937
+ ),
1938
+ 387 =>
1939
+ array (
1940
+ 'match' => 'E092 0ACD (200D)',
1941
+ 'replace' => 'E122 \\1',
1942
+ ),
1943
+ 388 =>
1944
+ array (
1945
+ 'match' => 'E093 0ACD (200D)',
1946
+ 'replace' => 'E123 \\1',
1947
+ ),
1948
+ 389 =>
1949
+ array (
1950
+ 'match' => 'E094 0ACD (200D)',
1951
+ 'replace' => 'E124 \\1',
1952
+ ),
1953
+ 390 =>
1954
+ array (
1955
+ 'match' => 'E095 0ACD (200D)',
1956
+ 'replace' => 'E125 \\1',
1957
+ ),
1958
+ 391 =>
1959
+ array (
1960
+ 'match' => 'E096 0ACD (200D)',
1961
+ 'replace' => 'E126 \\1',
1962
+ ),
1963
+ 392 =>
1964
+ array (
1965
+ 'match' => 'E097 0ACD (200D)',
1966
+ 'replace' => 'E127 \\1',
1967
+ ),
1968
+ 393 =>
1969
+ array (
1970
+ 'match' => 'E098 0ACD (200D)',
1971
+ 'replace' => 'E128 \\1',
1972
+ ),
1973
+ 394 =>
1974
+ array (
1975
+ 'match' => 'E099 0ACD (200D)',
1976
+ 'replace' => 'E129 \\1',
1977
+ ),
1978
+ 395 =>
1979
+ array (
1980
+ 'match' => 'E09A 0ACD (200D)',
1981
+ 'replace' => 'E12A \\1',
1982
+ ),
1983
+ 396 =>
1984
+ array (
1985
+ 'match' => 'E09B 0ACD (200D)',
1986
+ 'replace' => 'E12B \\1',
1987
+ ),
1988
+ 397 =>
1989
+ array (
1990
+ 'match' => 'E09C 0ACD (200D)',
1991
+ 'replace' => 'E12C \\1',
1992
+ ),
1993
+ 398 =>
1994
+ array (
1995
+ 'match' => 'E09D 0ACD (200D)',
1996
+ 'replace' => 'E12D \\1',
1997
+ ),
1998
+ 399 =>
1999
+ array (
2000
+ 'match' => 'E09E 0ACD (200D)',
2001
+ 'replace' => 'E12E \\1',
2002
+ ),
2003
+ 400 =>
2004
+ array (
2005
+ 'match' => 'E09F 0ACD (200D)',
2006
+ 'replace' => 'E12F \\1',
2007
+ ),
2008
+ 401 =>
2009
+ array (
2010
+ 'match' => 'E0A0 0ACD (200D)',
2011
+ 'replace' => 'E130 \\1',
2012
+ ),
2013
+ 402 =>
2014
+ array (
2015
+ 'match' => 'E0A1 0ACD (200D)',
2016
+ 'replace' => 'E131 \\1',
2017
+ ),
2018
+ 403 =>
2019
+ array (
2020
+ 'match' => 'E0A2 0ACD (200D)',
2021
+ 'replace' => 'E132 \\1',
2022
+ ),
2023
+ 404 =>
2024
+ array (
2025
+ 'match' => 'E0A3 0ACD (200D)',
2026
+ 'replace' => 'E133 \\1',
2027
+ ),
2028
+ 405 =>
2029
+ array (
2030
+ 'match' => 'E0A4 0ACD (200D)',
2031
+ 'replace' => 'E134 \\1',
2032
+ ),
2033
+ 406 =>
2034
+ array (
2035
+ 'match' => 'E0A5 0ACD (200D)',
2036
+ 'replace' => 'E135 \\1',
2037
+ ),
2038
+ 407 =>
2039
+ array (
2040
+ 'match' => 'E0A6 E0A6',
2041
+ 'replace' => 'E221',
2042
+ ),
2043
+ 408 =>
2044
+ array (
2045
+ 'match' => 'E0B7 E0A8',
2046
+ 'replace' => 'E223',
2047
+ ),
2048
+ 409 =>
2049
+ array (
2050
+ 'match' => 'E0C6 E0B5',
2051
+ 'replace' => 'E222',
2052
+ ),
2053
+ 410 =>
2054
+ array (
2055
+ 'match' => 'E0AA 0A95',
2056
+ 'replace' => 'E136',
2057
+ ),
2058
+ 411 =>
2059
+ array (
2060
+ 'match' => 'E0AA 0A96',
2061
+ 'replace' => 'E137',
2062
+ ),
2063
+ 412 =>
2064
+ array (
2065
+ 'match' => 'E0AA 0A97',
2066
+ 'replace' => 'E138',
2067
+ ),
2068
+ 413 =>
2069
+ array (
2070
+ 'match' => 'E0AA 0A98',
2071
+ 'replace' => 'E139',
2072
+ ),
2073
+ 414 =>
2074
+ array (
2075
+ 'match' => 'E0AA 0AAE',
2076
+ 'replace' => 'E13A',
2077
+ ),
2078
+ 415 =>
2079
+ array (
2080
+ 'match' => 'E0AA 0AB5',
2081
+ 'replace' => 'E13B',
2082
+ ),
2083
+ 416 =>
2084
+ array (
2085
+ 'match' => 'E0AA E002',
2086
+ 'replace' => 'E13C',
2087
+ ),
2088
+ 417 =>
2089
+ array (
2090
+ 'match' => 'E0AC 0AB5',
2091
+ 'replace' => 'E13D',
2092
+ ),
2093
+ 418 =>
2094
+ array (
2095
+ 'match' => 'E0B0 0A9F',
2096
+ 'replace' => 'E13E',
2097
+ ),
2098
+ 419 =>
2099
+ array (
2100
+ 'match' => 'E0B0 0AA0',
2101
+ 'replace' => 'E13F',
2102
+ ),
2103
+ 420 =>
2104
+ array (
2105
+ 'match' => 'E0B1 0AA0',
2106
+ 'replace' => 'E140',
2107
+ ),
2108
+ 421 =>
2109
+ array (
2110
+ 'match' => 'E0B2 0AA1',
2111
+ 'replace' => 'E141',
2112
+ ),
2113
+ 422 =>
2114
+ array (
2115
+ 'match' => 'E0B2 0AA2',
2116
+ 'replace' => 'E142',
2117
+ ),
2118
+ 423 =>
2119
+ array (
2120
+ 'match' => 'E0B3 0AA2',
2121
+ 'replace' => 'E143',
2122
+ ),
2123
+ 424 =>
2124
+ array (
2125
+ 'match' => 'E0B7 0A97',
2126
+ 'replace' => 'E145',
2127
+ ),
2128
+ 425 =>
2129
+ array (
2130
+ 'match' => 'E0B7 E060',
2131
+ 'replace' => 'E146',
2132
+ ),
2133
+ 426 =>
2134
+ array (
2135
+ 'match' => 'E0B7 0A98',
2136
+ 'replace' => 'E147',
2137
+ ),
2138
+ 427 =>
2139
+ array (
2140
+ 'match' => 'E0B7 0AA8',
2141
+ 'replace' => 'E148',
2142
+ ),
2143
+ 428 =>
2144
+ array (
2145
+ 'match' => 'E0B7 0AA7',
2146
+ 'replace' => 'E149',
2147
+ ),
2148
+ 429 =>
2149
+ array (
2150
+ 'match' => 'E0B7 0AB5',
2151
+ 'replace' => 'E14A',
2152
+ ),
2153
+ 430 =>
2154
+ array (
2155
+ 'match' => 'E0B7 0AAC',
2156
+ 'replace' => 'E14B',
2157
+ ),
2158
+ 431 =>
2159
+ array (
2160
+ 'match' => 'E0B7 0AAE',
2161
+ 'replace' => 'E14C',
2162
+ ),
2163
+ 432 =>
2164
+ array (
2165
+ 'match' => 'E0B7 0AB2',
2166
+ 'replace' => 'E14D',
2167
+ ),
2168
+ 433 =>
2169
+ array (
2170
+ 'match' => 'E0B7 0AA6',
2171
+ 'replace' => 'E14E',
2172
+ ),
2173
+ 434 =>
2174
+ array (
2175
+ 'match' => 'E0C7 0AA8',
2176
+ 'replace' => 'E14F',
2177
+ ),
2178
+ 435 =>
2179
+ array (
2180
+ 'match' => 'E0C7 0AA3',
2181
+ 'replace' => 'E150',
2182
+ ),
2183
+ 436 =>
2184
+ array (
2185
+ 'match' => 'E0C7 0AAF',
2186
+ 'replace' => 'E151',
2187
+ ),
2188
+ 437 =>
2189
+ array (
2190
+ 'match' => 'E0C7 0AB2',
2191
+ 'replace' => 'E152',
2192
+ ),
2193
+ 438 =>
2194
+ array (
2195
+ 'match' => 'E0C7 0AB5',
2196
+ 'replace' => 'E153',
2197
+ ),
2198
+ 439 =>
2199
+ array (
2200
+ 'match' => 'E0C7 0AAE',
2201
+ 'replace' => 'E154',
2202
+ ),
2203
+ 440 =>
2204
+ array (
2205
+ 'match' => 'E0AF 0A9A',
2206
+ 'replace' => 'E155',
2207
+ ),
2208
+ 441 =>
2209
+ array (
2210
+ 'match' => 'E0AF 0A9C',
2211
+ 'replace' => 'E156',
2212
+ ),
2213
+ 442 =>
2214
+ array (
2215
+ 'match' => 'E0B9 0AA8',
2216
+ 'replace' => 'E157',
2217
+ ),
2218
+ 443 =>
2219
+ array (
2220
+ 'match' => 'E0C4 0AA8',
2221
+ 'replace' => 'E158',
2222
+ ),
2223
+ 444 =>
2224
+ array (
2225
+ 'match' => 'E0C4 0AB5',
2226
+ 'replace' => 'E159',
2227
+ ),
2228
+ 445 =>
2229
+ array (
2230
+ 'match' => 'E0C4 0A9A',
2231
+ 'replace' => 'E15A',
2232
+ ),
2233
+ 446 =>
2234
+ array (
2235
+ 'match' => 'E0B5 0AA4',
2236
+ 'replace' => 'E15B',
2237
+ ),
2238
+ 447 =>
2239
+ array (
2240
+ 'match' => 'E0C6 E06D',
2241
+ 'replace' => 'E15C',
2242
+ ),
2243
+ 448 =>
2244
+ array (
2245
+ 'match' => 'E0B7 0AAF',
2246
+ 'replace' => 'E15D',
2247
+ ),
2248
+ 449 =>
2249
+ array (
2250
+ 'match' => 'E0FF 0AAF',
2251
+ 'replace' => 'E15E',
2252
+ ),
2253
+ 450 =>
2254
+ array (
2255
+ 'match' => 'E0A6 0A95',
2256
+ 'replace' => 'E21F',
2257
+ ),
2258
+ 451 =>
2259
+ array (
2260
+ 'match' => 'E0A6 E05E',
2261
+ 'replace' => 'E220',
2262
+ ),
2263
+ 452 =>
2264
+ array (
2265
+ 'match' => 'E163',
2266
+ 'replace' => '0ACD',
2267
+ ),
2268
+ 453 =>
2269
+ array (
2270
+ 'match' => 'E0A6 200D',
2271
+ 'replace' => 'E0A6',
2272
+ ),
2273
+ 454 =>
2274
+ array (
2275
+ 'match' => 'E0A7 200D',
2276
+ 'replace' => 'E0A7',
2277
+ ),
2278
+ 455 =>
2279
+ array (
2280
+ 'match' => 'E0A8 200D',
2281
+ 'replace' => 'E0A8',
2282
+ ),
2283
+ 456 =>
2284
+ array (
2285
+ 'match' => 'E0A9 200D',
2286
+ 'replace' => 'E0A9',
2287
+ ),
2288
+ 457 =>
2289
+ array (
2290
+ 'match' => 'E0AA 200D',
2291
+ 'replace' => 'E0AA',
2292
+ ),
2293
+ 458 =>
2294
+ array (
2295
+ 'match' => 'E0AB 200D',
2296
+ 'replace' => 'E0AB',
2297
+ ),
2298
+ 459 =>
2299
+ array (
2300
+ 'match' => 'E0AC 200D',
2301
+ 'replace' => 'E0AC',
2302
+ ),
2303
+ 460 =>
2304
+ array (
2305
+ 'match' => 'E0AD 200D',
2306
+ 'replace' => 'E0AD',
2307
+ ),
2308
+ 461 =>
2309
+ array (
2310
+ 'match' => 'E0AE 200D',
2311
+ 'replace' => 'E0AE',
2312
+ ),
2313
+ 462 =>
2314
+ array (
2315
+ 'match' => 'E0AF 200D',
2316
+ 'replace' => 'E0AF',
2317
+ ),
2318
+ 463 =>
2319
+ array (
2320
+ 'match' => 'E0B0 200D',
2321
+ 'replace' => 'E0B0',
2322
+ ),
2323
+ 464 =>
2324
+ array (
2325
+ 'match' => 'E0B1 200D',
2326
+ 'replace' => 'E0B1',
2327
+ ),
2328
+ 465 =>
2329
+ array (
2330
+ 'match' => 'E0B2 200D',
2331
+ 'replace' => 'E0B2',
2332
+ ),
2333
+ 466 =>
2334
+ array (
2335
+ 'match' => 'E0B3 200D',
2336
+ 'replace' => 'E0B3',
2337
+ ),
2338
+ 467 =>
2339
+ array (
2340
+ 'match' => 'E0B4 200D',
2341
+ 'replace' => 'E0B4',
2342
+ ),
2343
+ 468 =>
2344
+ array (
2345
+ 'match' => 'E0B5 200D',
2346
+ 'replace' => 'E0B5',
2347
+ ),
2348
+ 469 =>
2349
+ array (
2350
+ 'match' => 'E0B6 200D',
2351
+ 'replace' => 'E0B6',
2352
+ ),
2353
+ 470 =>
2354
+ array (
2355
+ 'match' => 'E0B7 200D',
2356
+ 'replace' => 'E0B7',
2357
+ ),
2358
+ 471 =>
2359
+ array (
2360
+ 'match' => 'E0B8 200D',
2361
+ 'replace' => 'E0B8',
2362
+ ),
2363
+ 472 =>
2364
+ array (
2365
+ 'match' => 'E0B9 200D',
2366
+ 'replace' => 'E0B9',
2367
+ ),
2368
+ 473 =>
2369
+ array (
2370
+ 'match' => 'E0BA 200D',
2371
+ 'replace' => 'E0BA',
2372
+ ),
2373
+ 474 =>
2374
+ array (
2375
+ 'match' => 'E0BB 200D',
2376
+ 'replace' => 'E0BB',
2377
+ ),
2378
+ 475 =>
2379
+ array (
2380
+ 'match' => 'E0BC 200D',
2381
+ 'replace' => 'E0BC',
2382
+ ),
2383
+ 476 =>
2384
+ array (
2385
+ 'match' => 'E0BD 200D',
2386
+ 'replace' => 'E0BD',
2387
+ ),
2388
+ 477 =>
2389
+ array (
2390
+ 'match' => 'E0BE 200D',
2391
+ 'replace' => 'E0BE',
2392
+ ),
2393
+ 478 =>
2394
+ array (
2395
+ 'match' => 'E0BF 200D',
2396
+ 'replace' => 'E0BF',
2397
+ ),
2398
+ 479 =>
2399
+ array (
2400
+ 'match' => 'E0C0 200D',
2401
+ 'replace' => 'E0C0',
2402
+ ),
2403
+ 480 =>
2404
+ array (
2405
+ 'match' => 'E0C1 200D',
2406
+ 'replace' => 'E0C1',
2407
+ ),
2408
+ 481 =>
2409
+ array (
2410
+ 'match' => 'E0C2 200D',
2411
+ 'replace' => 'E0C2',
2412
+ ),
2413
+ 482 =>
2414
+ array (
2415
+ 'match' => 'E0C3 200D',
2416
+ 'replace' => 'E0C3',
2417
+ ),
2418
+ 483 =>
2419
+ array (
2420
+ 'match' => 'E0C4 200D',
2421
+ 'replace' => 'E0C4',
2422
+ ),
2423
+ 484 =>
2424
+ array (
2425
+ 'match' => 'E0C5 200D',
2426
+ 'replace' => 'E0C5',
2427
+ ),
2428
+ 485 =>
2429
+ array (
2430
+ 'match' => 'E0C6 200D',
2431
+ 'replace' => 'E0C6',
2432
+ ),
2433
+ 486 =>
2434
+ array (
2435
+ 'match' => 'E0C7 200D',
2436
+ 'replace' => 'E0C7',
2437
+ ),
2438
+ 487 =>
2439
+ array (
2440
+ 'match' => 'E0C8 200D',
2441
+ 'replace' => 'E0C8',
2442
+ ),
2443
+ 488 =>
2444
+ array (
2445
+ 'match' => 'E0C9 200D',
2446
+ 'replace' => 'E0C9',
2447
+ ),
2448
+ 489 =>
2449
+ array (
2450
+ 'match' => 'E0CA 200D',
2451
+ 'replace' => 'E0CA',
2452
+ ),
2453
+ 490 =>
2454
+ array (
2455
+ 'match' => 'E0CB 200D',
2456
+ 'replace' => 'E0CB',
2457
+ ),
2458
+ 491 =>
2459
+ array (
2460
+ 'match' => 'E0CC 200D',
2461
+ 'replace' => 'E0CC',
2462
+ ),
2463
+ 492 =>
2464
+ array (
2465
+ 'match' => 'E0CD 200D',
2466
+ 'replace' => 'E0CD',
2467
+ ),
2468
+ 493 =>
2469
+ array (
2470
+ 'match' => 'E0CE 200D',
2471
+ 'replace' => 'E0CE',
2472
+ ),
2473
+ 494 =>
2474
+ array (
2475
+ 'match' => 'E0CF 200D',
2476
+ 'replace' => 'E0CF',
2477
+ ),
2478
+ 495 =>
2479
+ array (
2480
+ 'match' => 'E0D0 200D',
2481
+ 'replace' => 'E0D0',
2482
+ ),
2483
+ 496 =>
2484
+ array (
2485
+ 'match' => 'E0D1 200D',
2486
+ 'replace' => 'E0D1',
2487
+ ),
2488
+ 497 =>
2489
+ array (
2490
+ 'match' => 'E0D2 200D',
2491
+ 'replace' => 'E0D2',
2492
+ ),
2493
+ 498 =>
2494
+ array (
2495
+ 'match' => 'E0D3 200D',
2496
+ 'replace' => 'E0D3',
2497
+ ),
2498
+ 499 =>
2499
+ array (
2500
+ 'match' => 'E0D4 200D',
2501
+ 'replace' => 'E0D4',
2502
+ ),
2503
+ 500 =>
2504
+ array (
2505
+ 'match' => 'E0D5 200D',
2506
+ 'replace' => 'E0D5',
2507
+ ),
2508
+ 501 =>
2509
+ array (
2510
+ 'match' => 'E0D6 200D',
2511
+ 'replace' => 'E0D6',
2512
+ ),
2513
+ 502 =>
2514
+ array (
2515
+ 'match' => 'E0D7 200D',
2516
+ 'replace' => 'E0D7',
2517
+ ),
2518
+ 503 =>
2519
+ array (
2520
+ 'match' => 'E0D8 200D',
2521
+ 'replace' => 'E0D8',
2522
+ ),
2523
+ 504 =>
2524
+ array (
2525
+ 'match' => 'E0D9 200D',
2526
+ 'replace' => 'E0D9',
2527
+ ),
2528
+ 505 =>
2529
+ array (
2530
+ 'match' => 'E0DA 200D',
2531
+ 'replace' => 'E0DA',
2532
+ ),
2533
+ 506 =>
2534
+ array (
2535
+ 'match' => 'E0DB 200D',
2536
+ 'replace' => 'E0DB',
2537
+ ),
2538
+ 507 =>
2539
+ array (
2540
+ 'match' => 'E0DC 200D',
2541
+ 'replace' => 'E0DC',
2542
+ ),
2543
+ 508 =>
2544
+ array (
2545
+ 'match' => 'E0DD 200D',
2546
+ 'replace' => 'E0DD',
2547
+ ),
2548
+ 509 =>
2549
+ array (
2550
+ 'match' => 'E0DE 200D',
2551
+ 'replace' => 'E0DE',
2552
+ ),
2553
+ 510 =>
2554
+ array (
2555
+ 'match' => 'E0DF 200D',
2556
+ 'replace' => 'E0DF',
2557
+ ),
2558
+ 511 =>
2559
+ array (
2560
+ 'match' => 'E0E0 200D',
2561
+ 'replace' => 'E0E0',
2562
+ ),
2563
+ 512 =>
2564
+ array (
2565
+ 'match' => 'E0E1 200D',
2566
+ 'replace' => 'E0E1',
2567
+ ),
2568
+ 513 =>
2569
+ array (
2570
+ 'match' => 'E0E2 200D',
2571
+ 'replace' => 'E0E2',
2572
+ ),
2573
+ 514 =>
2574
+ array (
2575
+ 'match' => 'E0E3 200D',
2576
+ 'replace' => 'E0E3',
2577
+ ),
2578
+ 515 =>
2579
+ array (
2580
+ 'match' => 'E0E4 200D',
2581
+ 'replace' => 'E0E4',
2582
+ ),
2583
+ 516 =>
2584
+ array (
2585
+ 'match' => 'E0E5 200D',
2586
+ 'replace' => 'E0E5',
2587
+ ),
2588
+ 517 =>
2589
+ array (
2590
+ 'match' => 'E0E6 200D',
2591
+ 'replace' => 'E0E6',
2592
+ ),
2593
+ 518 =>
2594
+ array (
2595
+ 'match' => 'E0E7 200D',
2596
+ 'replace' => 'E0E7',
2597
+ ),
2598
+ 519 =>
2599
+ array (
2600
+ 'match' => 'E0E8 200D',
2601
+ 'replace' => 'E0E8',
2602
+ ),
2603
+ 520 =>
2604
+ array (
2605
+ 'match' => 'E0E9 200D',
2606
+ 'replace' => 'E0E9',
2607
+ ),
2608
+ 521 =>
2609
+ array (
2610
+ 'match' => 'E0EA 200D',
2611
+ 'replace' => 'E0EA',
2612
+ ),
2613
+ 522 =>
2614
+ array (
2615
+ 'match' => 'E0EB 200D',
2616
+ 'replace' => 'E0EB',
2617
+ ),
2618
+ 523 =>
2619
+ array (
2620
+ 'match' => 'E0EC 200D',
2621
+ 'replace' => 'E0EC',
2622
+ ),
2623
+ 524 =>
2624
+ array (
2625
+ 'match' => 'E0ED 200D',
2626
+ 'replace' => 'E0ED',
2627
+ ),
2628
+ 525 =>
2629
+ array (
2630
+ 'match' => 'E0EE 200D',
2631
+ 'replace' => 'E0EE',
2632
+ ),
2633
+ 526 =>
2634
+ array (
2635
+ 'match' => 'E0EF 200D',
2636
+ 'replace' => 'E0EF',
2637
+ ),
2638
+ 527 =>
2639
+ array (
2640
+ 'match' => 'E0F0 200D',
2641
+ 'replace' => 'E0F0',
2642
+ ),
2643
+ 528 =>
2644
+ array (
2645
+ 'match' => 'E0F1 200D',
2646
+ 'replace' => 'E0F1',
2647
+ ),
2648
+ 529 =>
2649
+ array (
2650
+ 'match' => 'E0F2 200D',
2651
+ 'replace' => 'E0F2',
2652
+ ),
2653
+ 530 =>
2654
+ array (
2655
+ 'match' => 'E0F3 200D',
2656
+ 'replace' => 'E0F3',
2657
+ ),
2658
+ 531 =>
2659
+ array (
2660
+ 'match' => 'E0F4 200D',
2661
+ 'replace' => 'E0F4',
2662
+ ),
2663
+ 532 =>
2664
+ array (
2665
+ 'match' => 'E0F5 200D',
2666
+ 'replace' => 'E0F5',
2667
+ ),
2668
+ 533 =>
2669
+ array (
2670
+ 'match' => 'E0F6 200D',
2671
+ 'replace' => 'E0F6',
2672
+ ),
2673
+ 534 =>
2674
+ array (
2675
+ 'match' => 'E0F7 200D',
2676
+ 'replace' => 'E0F7',
2677
+ ),
2678
+ 535 =>
2679
+ array (
2680
+ 'match' => 'E0F8 200D',
2681
+ 'replace' => 'E0F8',
2682
+ ),
2683
+ 536 =>
2684
+ array (
2685
+ 'match' => 'E0F9 200D',
2686
+ 'replace' => 'E0F9',
2687
+ ),
2688
+ 537 =>
2689
+ array (
2690
+ 'match' => 'E0FA 200D',
2691
+ 'replace' => 'E0FA',
2692
+ ),
2693
+ 538 =>
2694
+ array (
2695
+ 'match' => 'E0FB 200D',
2696
+ 'replace' => 'E0FB',
2697
+ ),
2698
+ 539 =>
2699
+ array (
2700
+ 'match' => 'E0FC 200D',
2701
+ 'replace' => 'E0FC',
2702
+ ),
2703
+ 540 =>
2704
+ array (
2705
+ 'match' => 'E0FD 200D',
2706
+ 'replace' => 'E0FD',
2707
+ ),
2708
+ 541 =>
2709
+ array (
2710
+ 'match' => 'E0FE 200D',
2711
+ 'replace' => 'E0FE',
2712
+ ),
2713
+ 542 =>
2714
+ array (
2715
+ 'match' => 'E0FF 200D',
2716
+ 'replace' => 'E0FF',
2717
+ ),
2718
+ 543 =>
2719
+ array (
2720
+ 'match' => 'E100 200D',
2721
+ 'replace' => 'E100',
2722
+ ),
2723
+ 544 =>
2724
+ array (
2725
+ 'match' => 'E101 200D',
2726
+ 'replace' => 'E101',
2727
+ ),
2728
+ 545 =>
2729
+ array (
2730
+ 'match' => 'E102 200D',
2731
+ 'replace' => 'E102',
2732
+ ),
2733
+ 546 =>
2734
+ array (
2735
+ 'match' => 'E103 200D',
2736
+ 'replace' => 'E103',
2737
+ ),
2738
+ 547 =>
2739
+ array (
2740
+ 'match' => 'E104 200D',
2741
+ 'replace' => 'E104',
2742
+ ),
2743
+ 548 =>
2744
+ array (
2745
+ 'match' => 'E105 200D',
2746
+ 'replace' => 'E105',
2747
+ ),
2748
+ 549 =>
2749
+ array (
2750
+ 'match' => 'E106 200D',
2751
+ 'replace' => 'E106',
2752
+ ),
2753
+ 550 =>
2754
+ array (
2755
+ 'match' => 'E107 200D',
2756
+ 'replace' => 'E107',
2757
+ ),
2758
+ 551 =>
2759
+ array (
2760
+ 'match' => 'E108 200D',
2761
+ 'replace' => 'E108',
2762
+ ),
2763
+ 552 =>
2764
+ array (
2765
+ 'match' => 'E109 200D',
2766
+ 'replace' => 'E109',
2767
+ ),
2768
+ 553 =>
2769
+ array (
2770
+ 'match' => 'E10A 200D',
2771
+ 'replace' => 'E10A',
2772
+ ),
2773
+ 554 =>
2774
+ array (
2775
+ 'match' => 'E10B 200D',
2776
+ 'replace' => 'E10B',
2777
+ ),
2778
+ 555 =>
2779
+ array (
2780
+ 'match' => 'E10C 200D',
2781
+ 'replace' => 'E10C',
2782
+ ),
2783
+ 556 =>
2784
+ array (
2785
+ 'match' => 'E10D 200D',
2786
+ 'replace' => 'E10D',
2787
+ ),
2788
+ 557 =>
2789
+ array (
2790
+ 'match' => 'E10E 200D',
2791
+ 'replace' => 'E10E',
2792
+ ),
2793
+ 558 =>
2794
+ array (
2795
+ 'match' => 'E10F 200D',
2796
+ 'replace' => 'E10F',
2797
+ ),
2798
+ 559 =>
2799
+ array (
2800
+ 'match' => 'E110 200D',
2801
+ 'replace' => 'E110',
2802
+ ),
2803
+ 560 =>
2804
+ array (
2805
+ 'match' => 'E111 200D',
2806
+ 'replace' => 'E111',
2807
+ ),
2808
+ 561 =>
2809
+ array (
2810
+ 'match' => 'E112 200D',
2811
+ 'replace' => 'E112',
2812
+ ),
2813
+ 562 =>
2814
+ array (
2815
+ 'match' => 'E113 200D',
2816
+ 'replace' => 'E113',
2817
+ ),
2818
+ 563 =>
2819
+ array (
2820
+ 'match' => 'E114 200D',
2821
+ 'replace' => 'E114',
2822
+ ),
2823
+ 564 =>
2824
+ array (
2825
+ 'match' => 'E115 200D',
2826
+ 'replace' => 'E115',
2827
+ ),
2828
+ 565 =>
2829
+ array (
2830
+ 'match' => 'E116 200D',
2831
+ 'replace' => 'E116',
2832
+ ),
2833
+ 566 =>
2834
+ array (
2835
+ 'match' => 'E117 200D',
2836
+ 'replace' => 'E117',
2837
+ ),
2838
+ 567 =>
2839
+ array (
2840
+ 'match' => 'E118 200D',
2841
+ 'replace' => 'E118',
2842
+ ),
2843
+ 568 =>
2844
+ array (
2845
+ 'match' => 'E119 200D',
2846
+ 'replace' => 'E119',
2847
+ ),
2848
+ 569 =>
2849
+ array (
2850
+ 'match' => 'E11A 200D',
2851
+ 'replace' => 'E11A',
2852
+ ),
2853
+ 570 =>
2854
+ array (
2855
+ 'match' => 'E11B 200D',
2856
+ 'replace' => 'E11B',
2857
+ ),
2858
+ 571 =>
2859
+ array (
2860
+ 'match' => 'E11C 200D',
2861
+ 'replace' => 'E11C',
2862
+ ),
2863
+ 572 =>
2864
+ array (
2865
+ 'match' => 'E11D 200D',
2866
+ 'replace' => 'E11D',
2867
+ ),
2868
+ 573 =>
2869
+ array (
2870
+ 'match' => 'E11E 200D',
2871
+ 'replace' => 'E11E',
2872
+ ),
2873
+ 574 =>
2874
+ array (
2875
+ 'match' => 'E11F 200D',
2876
+ 'replace' => 'E11F',
2877
+ ),
2878
+ 575 =>
2879
+ array (
2880
+ 'match' => 'E120 200D',
2881
+ 'replace' => 'E120',
2882
+ ),
2883
+ 576 =>
2884
+ array (
2885
+ 'match' => 'E121 200D',
2886
+ 'replace' => 'E121',
2887
+ ),
2888
+ 577 =>
2889
+ array (
2890
+ 'match' => 'E122 200D',
2891
+ 'replace' => 'E122',
2892
+ ),
2893
+ 578 =>
2894
+ array (
2895
+ 'match' => 'E123 200D',
2896
+ 'replace' => 'E123',
2897
+ ),
2898
+ 579 =>
2899
+ array (
2900
+ 'match' => 'E124 200D',
2901
+ 'replace' => 'E124',
2902
+ ),
2903
+ 580 =>
2904
+ array (
2905
+ 'match' => 'E125 200D',
2906
+ 'replace' => 'E125',
2907
+ ),
2908
+ 581 =>
2909
+ array (
2910
+ 'match' => 'E126 200D',
2911
+ 'replace' => 'E126',
2912
+ ),
2913
+ 582 =>
2914
+ array (
2915
+ 'match' => 'E127 200D',
2916
+ 'replace' => 'E127',
2917
+ ),
2918
+ 583 =>
2919
+ array (
2920
+ 'match' => 'E128 200D',
2921
+ 'replace' => 'E128',
2922
+ ),
2923
+ 584 =>
2924
+ array (
2925
+ 'match' => 'E129 200D',
2926
+ 'replace' => 'E129',
2927
+ ),
2928
+ 585 =>
2929
+ array (
2930
+ 'match' => 'E12A 200D',
2931
+ 'replace' => 'E12A',
2932
+ ),
2933
+ 586 =>
2934
+ array (
2935
+ 'match' => 'E12B 200D',
2936
+ 'replace' => 'E12B',
2937
+ ),
2938
+ 587 =>
2939
+ array (
2940
+ 'match' => 'E12C 200D',
2941
+ 'replace' => 'E12C',
2942
+ ),
2943
+ 588 =>
2944
+ array (
2945
+ 'match' => 'E12D 200D',
2946
+ 'replace' => 'E12D',
2947
+ ),
2948
+ 589 =>
2949
+ array (
2950
+ 'match' => 'E12E 200D',
2951
+ 'replace' => 'E12E',
2952
+ ),
2953
+ 590 =>
2954
+ array (
2955
+ 'match' => 'E12F 200D',
2956
+ 'replace' => 'E12F',
2957
+ ),
2958
+ 591 =>
2959
+ array (
2960
+ 'match' => 'E130 200D',
2961
+ 'replace' => 'E130',
2962
+ ),
2963
+ 592 =>
2964
+ array (
2965
+ 'match' => 'E131 200D',
2966
+ 'replace' => 'E131',
2967
+ ),
2968
+ 593 =>
2969
+ array (
2970
+ 'match' => 'E132 200D',
2971
+ 'replace' => 'E132',
2972
+ ),
2973
+ 594 =>
2974
+ array (
2975
+ 'match' => 'E133 200D',
2976
+ 'replace' => 'E133',
2977
+ ),
2978
+ 595 =>
2979
+ array (
2980
+ 'match' => 'E134 200D',
2981
+ 'replace' => 'E134',
2982
+ ),
2983
+ 596 =>
2984
+ array (
2985
+ 'match' => 'E135 200D',
2986
+ 'replace' => 'E135',
2987
+ ),
2988
+ 597 =>
2989
+ array (
2990
+ 'match' => '200D 0ACD',
2991
+ 'replace' => '0ACD',
2992
+ ),
2993
+ 598 =>
2994
+ array (
2995
+ 'match' => '200D E05D',
2996
+ 'replace' => 'E05D',
2997
+ ),
2998
+ 599 =>
2999
+ array (
3000
+ 'match' => '0A9C 0ABE',
3001
+ 'replace' => 'E21B',
3002
+ ),
3003
+ 600 =>
3004
+ array (
3005
+ 'match' => '0A9C 0AC9',
3006
+ 'replace' => 'E21C',
3007
+ ),
3008
+ 601 =>
3009
+ array (
3010
+ 'match' => '0A9C 0ACB',
3011
+ 'replace' => 'E21D',
3012
+ ),
3013
+ 602 =>
3014
+ array (
3015
+ 'match' => '0A9C 0ACC',
3016
+ 'replace' => 'E21E',
3017
+ ),
3018
+ 603 =>
3019
+ array (
3020
+ 'match' => '0ABF ((0A95|0A99|0AA1|0AA6|0AAB|0AB0|0AB9|E004|E008|E010|E015|E019|E01E|E025|E05E|E062|E06A|E06F|E073|E078|E07F|E082|E086|E08E|E093|E097|E09C|E0A3|E136|E137|E138|E139|E13A|E13B|E13C|E141|E142|E144|E145|E146|E148|E14A|E14B|E14E))',
3021
+ 'replace' => 'E038 \\1',
3022
+ ),
3023
+ 604 =>
3024
+ array (
3025
+ 'match' => '0ABF ((0A9F|0AA0|0AA2|0A9C|E00E|E00F|E011|E00B|E068|E069|E06B|E065|E08C|E08D|E08F|E089|E14F|E150|E151|E152|E153|E154))',
3026
+ 'replace' => 'E03A \\1',
3027
+ ),
3028
+ 605 =>
3029
+ array (
3030
+ 'match' => '0ABF ((0A96|0AA3|0AAC|0AAD|0AB3|E002|E003|E005|E012|E01A|E01B|E020|E026|E027|E05F|E06C|E074|E075|E07A|E080|E081|E083|E090|E098|E099|E09E|E0A4|E0A5|E15E))',
3031
+ 'replace' => 'E039 \\1',
3032
+ ),
3033
+ 606 =>
3034
+ array (
3035
+ 'match' => '0ABF ((E13D))',
3036
+ 'replace' => 'E03B \\1',
3037
+ ),
3038
+ 607 =>
3039
+ array (
3040
+ 'match' => '0ABF ((E13E|E13F|E140|E143))',
3041
+ 'replace' => 'E03C \\1',
3042
+ ),
3043
+ 608 =>
3044
+ array (
3045
+ 'match' => '0ABF ((E15C))',
3046
+ 'replace' => 'E03D \\1',
3047
+ ),
3048
+ 609 =>
3049
+ array (
3050
+ 'match' => '0ABF ((E0A7|E0BC|E0BD|E0C8|E0C9|E0C2) (0A97|0A98|0AAF|0A9B|0A9D|0A9E|0AA4|0AA5|0AA7|0AA8|0AAA|0AAE|0AAF|0AB2|0AB5|0AB6|0AB7|0AB8))',
3051
+ 'replace' => 'E25C \\1',
3052
+ ),
3053
+ 610 =>
3054
+ array (
3055
+ 'match' => '0ABF ((E0A7|E0BC|E0BD|E0C8|E0C9|E0C2) (0A96|0AA3|0AAC|0AAD|0AB3|E002|E003))',
3056
+ 'replace' => 'E25C \\1',
3057
+ ),
3058
+ 611 =>
3059
+ array (
3060
+ 'match' => '0ABF ((E0AB|E0B6|E0BA|E0BE|E0BF|E0C1|E0C3|E0C5|E0C6|E0A9|E0B8|E0AD|E0AF|E0B0|E0B3) (0A96|0AA3|0AAC|0AAD|0AB3|E002|E003))',
3061
+ 'replace' => 'E25C \\1',
3062
+ ),
3063
+ 612 =>
3064
+ array (
3065
+ 'match' => '0ABF ((E0AC|E0AE) (0A97|0A98|0AAF|0A9B|0A9D|0A9E|0AA4|0AA5|0AA7|0AA8|0AAA|0AAE|0AAF|0AB2|0AB5|0AB6|0AB7|0AB8))',
3066
+ 'replace' => 'E25C \\1',
3067
+ ),
3068
+ 613 =>
3069
+ array (
3070
+ 'match' => '0ABF ((E0AC|E0AE) (0A96|0AA3|0AAC|0AAD|0AB3|E002|E003))',
3071
+ 'replace' => 'E25C \\1',
3072
+ ),
3073
+ 614 =>
3074
+ array (
3075
+ 'match' => '0ABF ((E0B4|E0B5|E0B9) (0A96|0AA3|0AAC|0AAD|0AB3|E002|E003))',
3076
+ 'replace' => 'E25C \\1',
3077
+ ),
3078
+ 615 =>
3079
+ array (
3080
+ 'match' => '0ABF ((E0B1) (0A96|0AA3|0AAC|0AAD|0AB3|E002|E003))',
3081
+ 'replace' => 'E25C \\1',
3082
+ ),
3083
+ 616 =>
3084
+ array (
3085
+ 'match' => '0ABF ((E0A6|E0A8|E0AA|E0B2|E0B7|E0BB|E0C4|E0C7) (0A9C|0A9F|0AA0|0AA2))',
3086
+ 'replace' => 'E25D \\1',
3087
+ ),
3088
+ 617 =>
3089
+ array (
3090
+ 'match' => '0ABF ((E0AB|E0B6|E0BA|E0BE|E0BF|E0C1|E0C3|E0C5|E0C6|E0A9|E0B8|E0AD|E0AF|E0B0|E0B3) (0A95|0A99|0AA1|0AA6|0AAB|0AB9))',
3091
+ 'replace' => 'E25D \\1',
3092
+ ),
3093
+ 618 =>
3094
+ array (
3095
+ 'match' => '0ABF ((E0AB|E0B6|E0BA|E0BE|E0BF|E0C1|E0C3|E0C5|E0C6|E0A9|E0B8|E0AD|E0AF|E0B0|E0B3) (0A9C|0A9F|0AA0|0AA2))',
3096
+ 'replace' => 'E25D \\1',
3097
+ ),
3098
+ 619 =>
3099
+ array (
3100
+ 'match' => '0ABF ((E0B4|E0B5|E0B9) (0A95|0A99|0AA1|0AA6|0AAB|0AB9))',
3101
+ 'replace' => 'E25D \\1',
3102
+ ),
3103
+ 620 =>
3104
+ array (
3105
+ 'match' => '0ABF ((E0B1) (0A95|0A99|0AA1|0AA6|0AAB|0AB9))',
3106
+ 'replace' => 'E25D \\1',
3107
+ ),
3108
+ 621 =>
3109
+ array (
3110
+ 'match' => '0AB9 0AC3',
3111
+ 'replace' => 'E02F',
3112
+ ),
3113
+ 622 =>
3114
+ array (
3115
+ 'match' => '0AB0 0AC1',
3116
+ 'replace' => 'E15F',
3117
+ ),
3118
+ 623 =>
3119
+ array (
3120
+ 'match' => '0AC0 E032',
3121
+ 'replace' => 'E043',
3122
+ ),
3123
+ 624 =>
3124
+ array (
3125
+ 'match' => '0AC7 E032',
3126
+ 'replace' => 'E04D',
3127
+ ),
3128
+ 625 =>
3129
+ array (
3130
+ 'match' => '0AC8 E032',
3131
+ 'replace' => 'E051',
3132
+ ),
3133
+ 626 =>
3134
+ array (
3135
+ 'match' => '0ACB E032',
3136
+ 'replace' => 'E055',
3137
+ ),
3138
+ 627 =>
3139
+ array (
3140
+ 'match' => '0ACC E032',
3141
+ 'replace' => 'E059',
3142
+ ),
3143
+ 628 =>
3144
+ array (
3145
+ 'match' => '0A87 0A82',
3146
+ 'replace' => 'E160',
3147
+ ),
3148
+ 629 =>
3149
+ array (
3150
+ 'match' => '0A89 0A82',
3151
+ 'replace' => 'E161',
3152
+ ),
3153
+ 630 =>
3154
+ array (
3155
+ 'match' => '0A8A 0A82',
3156
+ 'replace' => 'E162',
3157
+ ),
3158
+ 631 =>
3159
+ array (
3160
+ 'match' => 'E032 0A81',
3161
+ 'replace' => 'E034',
3162
+ ),
3163
+ 632 =>
3164
+ array (
3165
+ 'match' => 'E032 0A82',
3166
+ 'replace' => 'E033',
3167
+ ),
3168
+ 633 =>
3169
+ array (
3170
+ 'match' => '0AC7 0A82',
3171
+ 'replace' => 'E04C',
3172
+ ),
3173
+ 634 =>
3174
+ array (
3175
+ 'match' => '0AC8 0A82',
3176
+ 'replace' => 'E050',
3177
+ ),
3178
+ 635 =>
3179
+ array (
3180
+ 'match' => '0AC0 0A82',
3181
+ 'replace' => 'E040',
3182
+ ),
3183
+ 636 =>
3184
+ array (
3185
+ 'match' => '0ACB 0A82',
3186
+ 'replace' => 'E054',
3187
+ ),
3188
+ 637 =>
3189
+ array (
3190
+ 'match' => '0ACC 0A82',
3191
+ 'replace' => 'E058',
3192
+ ),
3193
+ 638 =>
3194
+ array (
3195
+ 'match' => 'E04D 0A82',
3196
+ 'replace' => 'E04E',
3197
+ ),
3198
+ 639 =>
3199
+ array (
3200
+ 'match' => 'E051 0A82',
3201
+ 'replace' => 'E052',
3202
+ ),
3203
+ 640 =>
3204
+ array (
3205
+ 'match' => 'E043 0A82',
3206
+ 'replace' => 'E046',
3207
+ ),
3208
+ 641 =>
3209
+ array (
3210
+ 'match' => 'E055 0A82',
3211
+ 'replace' => 'E056',
3212
+ ),
3213
+ 642 =>
3214
+ array (
3215
+ 'match' => 'E059 0A82',
3216
+ 'replace' => 'E05A',
3217
+ ),
3218
+ 643 =>
3219
+ array (
3220
+ 'match' => 'E04D 0A81',
3221
+ 'replace' => 'E04F',
3222
+ ),
3223
+ 644 =>
3224
+ array (
3225
+ 'match' => 'E051 0A81',
3226
+ 'replace' => 'E053',
3227
+ ),
3228
+ 645 =>
3229
+ array (
3230
+ 'match' => 'E043 0A81',
3231
+ 'replace' => 'E049',
3232
+ ),
3233
+ 646 =>
3234
+ array (
3235
+ 'match' => 'E055 0A81',
3236
+ 'replace' => 'E057',
3237
+ ),
3238
+ 647 =>
3239
+ array (
3240
+ 'match' => 'E059 0A81',
3241
+ 'replace' => 'E05B',
3242
+ ),
3243
+ 648 =>
3244
+ array (
3245
+ 'match' => '((0A8D|0A8F|0A90|0A91|0A93|0A94|0AC0|E03E|E03F|0AC5|0AC7|0AC8|0AC9|0ACB|0ACC)) 0A81',
3246
+ 'replace' => '\\1 E031',
3247
+ ),
3248
+ 649 =>
3249
+ array (
3250
+ 'match' => '((0A95|0A99|0AA1|0AA6|0AAB|0AB9|E004|E008|E010|E015|E019|E025|E05E|E062|E06A|E06F|E073|E07F|E082|E086|E08E|E093|E097|E0A3|E136|E137|E138|E139|E13A|E13B|E13C|E141|E142)) 0AC0',
3251
+ 'replace' => '\\1 E03E',
3252
+ ),
3253
+ 650 =>
3254
+ array (
3255
+ 'match' => '((0A95|0A99|0AA1|0AA6|0AAB|0AB9|E004|E008|E010|E015|E019|E025|E05E|E062|E06A|E06F|E073|E07F|E082|E086|E08E|E093|E097|E0A3|E136|E137|E138|E139|E13A|E13B|E13C|E141|E142)) E040',
3256
+ 'replace' => '\\1 E041',
3257
+ ),
3258
+ 651 =>
3259
+ array (
3260
+ 'match' => '((0A95|0A99|0AA1|0AA6|0AAB|0AB9|E004|E008|E010|E015|E019|E025|E05E|E062|E06A|E06F|E073|E07F|E082|E086|E08E|E093|E097|E0A3|E136|E137|E138|E139|E13A|E13B|E13C|E141|E142)) E046',
3261
+ 'replace' => '\\1 E047',
3262
+ ),
3263
+ 652 =>
3264
+ array (
3265
+ 'match' => '((0A95|0A99|0AA1|0AA6|0AAB|0AB9|E004|E008|E010|E015|E019|E025|E05E|E062|E06A|E06F|E073|E07F|E082|E086|E08E|E093|E097|E0A3|E136|E137|E138|E139|E13A|E13B|E13C|E141|E142)) E049',
3266
+ 'replace' => '\\1 E04A',
3267
+ ),
3268
+ 653 =>
3269
+ array (
3270
+ 'match' => '((0A9F|0AA0|0AA2|0A9B|0AB0|E00E|E00F|E011|E00A|E01E|E068|E069|E06B|E064|E078|E08C|E08D|E08F|E088|E09C)) 0AC0',
3271
+ 'replace' => '\\1 E03F',
3272
+ ),
3273
+ 654 =>
3274
+ array (
3275
+ 'match' => '((0A9F|0AA0|0AA2|0A9B|0AB0|E00E|E00F|E011|E00A|E01E|E068|E069|E06B|E064|E078|E08C|E08D|E08F|E088|E09C)) E040',
3276
+ 'replace' => '\\1 E042',
3277
+ ),
3278
+ 655 =>
3279
+ array (
3280
+ 'match' => '((0A9F|0AA0|0AA2|0A9B|0AB0|E00E|E00F|E011|E00A|E01E|E068|E069|E06B|E064|E078|E08C|E08D|E08F|E088|E09C)) E046',
3281
+ 'replace' => '\\1 E048',
3282
+ ),
3283
+ 656 =>
3284
+ array (
3285
+ 'match' => '((0A9F|0AA0|0AA2|0A9B|0AB0|E00E|E00F|E011|E00A|E01E|E068|E069|E06B|E064|E078|E08C|E08D|E08F|E088|E09C)) E049',
3286
+ 'replace' => '\\1 E04B',
3287
+ ),
3288
+ 657 =>
3289
+ array (
3290
+ 'match' => '0A9C 0AC0',
3291
+ 'replace' => 'E028',
3292
+ ),
3293
+ 658 =>
3294
+ array (
3295
+ 'match' => '0AB3 0AC0',
3296
+ 'replace' => 'E02A',
3297
+ ),
3298
+ 659 =>
3299
+ array (
3300
+ 'match' => '0AB3 E043',
3301
+ 'replace' => 'E02B',
3302
+ ),
3303
+ 660 =>
3304
+ array (
3305
+ 'match' => '0AB3 E046',
3306
+ 'replace' => 'E02C',
3307
+ ),
3308
+ 661 =>
3309
+ array (
3310
+ 'match' => '0AB3 E049',
3311
+ 'replace' => 'E02D',
3312
+ ),
3313
+ );
3314
+ ?>
mPDF/includes/ind_hi_1_001.volt.php ADDED
@@ -0,0 +1,4169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $volt = array (
3
+ 0 =>
4
+ array (
5
+ 'match' => '0915 094D 0937',
6
+ 'replace' => 'E028',
7
+ ),
8
+ 1 =>
9
+ array (
10
+ 'match' => '091C 094D 091E',
11
+ 'replace' => 'E029',
12
+ ),
13
+ 2 =>
14
+ array (
15
+ 'match' => '0926 094D 092F',
16
+ 'replace' => 'E128',
17
+ ),
18
+ 3 =>
19
+ array (
20
+ 'match' => '094D (200D)',
21
+ 'replace' => 'E00E \\1',
22
+ ),
23
+ 4 =>
24
+ array (
25
+ 'match' => '094D ((0915|0916|0917|0918|0919|091A|091B|091C|091D|091E|091F|0920|0921|0922|0923|0924|0925|0926|0927|0928|092A|092B|092C|092D|092E|092F|0930|0932|0933|0935|0936|0937|0938|0939|E028|E029))',
26
+ 'replace' => 'E00E \\1',
27
+ ),
28
+ 5 =>
29
+ array (
30
+ 'match' => '094D (25CC)',
31
+ 'replace' => 'E00E \\1',
32
+ ),
33
+ 6 =>
34
+ array (
35
+ 'match' => '094D 200C',
36
+ 'replace' => 'E00C',
37
+ ),
38
+ 7 =>
39
+ array (
40
+ 'match' => '((0915|0916|0917|0918|0919|091A|091B|091C|091D|091E|091F|0920|0921|0922|0923|0924|0925|0926|0927|0928|092A|092B|092C|092D|092E|092F|0930|0932|0933|0935|0936|0937|0938|0939|E028|E029|0958|0959|095A|E02A|E02B|E02C|E02D|095B|E02E|E02F|E030|E031|095C|095D|E032|E033|E034|E035|E036|0929|E037|095E|E038|E039|E03A|095F|0931|E03B|0934|E03C|E03D|E03E|E03F|E040|E041|E042|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF|E0B0|E0B1|E0B2|E0B3|E0B4|E0B5|E0B6|E0B7|E0B8|E0B9|E0BA|E0BB|E0BC|E0BD|E0BE|E0BF|E0C0|E0C1|E0C2|E0C3|E0C4|E0C5|E0C6|E0C7|E0C8|E0C9|E0CA|E0CB|E0CC|E0CD|E0CE|E0CF|E0D0|E0D1|E0D2|E11E|E11F|E120|E121|E122|E123|E124|E125|E126|E127|E128|E129|E12A|E12B|E12C|E12D|E12E|E12F|E130|E131|E132|E133)) E00E 0930',
41
+ 'replace' => '\\1 E013',
42
+ ),
43
+ 8 =>
44
+ array (
45
+ 'match' => '(093C) E00E 0930',
46
+ 'replace' => '\\1 E013',
47
+ ),
48
+ 9 =>
49
+ array (
50
+ 'match' => '(200D) E00E 0930',
51
+ 'replace' => '\\1 E013',
52
+ ),
53
+ 10 =>
54
+ array (
55
+ 'match' => '(25CC) E00E 0930',
56
+ 'replace' => '\\1 E013',
57
+ ),
58
+ 11 =>
59
+ array (
60
+ 'match' => '(0020) E00E 0930',
61
+ 'replace' => '\\1 E013',
62
+ ),
63
+ 12 =>
64
+ array (
65
+ 'match' => '((0915|0916|0917|0918|0919|091A|091B|091C|091D|091E|091F|0920|0921|0922|0923|0924|0925|0926|0927|0928|092A|092B|092C|092D|092E|092F|0930|0932|0933|0935|0936|0937|0938|0939|E028|E029|0958|0959|095A|E02A|E02B|E02C|E02D|095B|E02E|E02F|E030|E031|095C|095D|E032|E033|E034|E035|E036|0929|E037|095E|E038|E039|E03A|095F|0931|E03B|0934|E03C|E03D|E03E|E03F|E040|E041|E042|E08B|E08C|E08D|E08E|E08F|E090|E091|E092|E093|E094|E095|E096|E097|E098|E099|E09A|E09B|E09C|E09D|E09E|E09F|E0A0|E0A1|E0A2|E0A3|E0A4|E0A5|E0A6|E0A7|E0A8|E0A9|E0AA|E0AB|E0AC|E0AD|E0AE|E0AF|E0B0|E0B1|E0B2|E0B3|E0B4|E0B5|E0B6|E0B7|E0B8|E0B9|E0BA|E0BB|E0BC|E0BD|E0BE|E0BF|E0C0|E0C1|E0C2|E0C3|E0C4|E0C5|E0C6|E0C7|E0C8|E0C9|E0CA|E0CB|E0CC|E0CD|E0CE|E0CF|E0D0|E0D1|E0D2|E11E|E11F|E120|E121|E122|E123|E124|E125|E126|E127|E128|E129|E12A|E12B|E12C|E12D|E12E|E12F|E130|E131|E132|E133)) 0930 094D',
66
+ 'replace' => '\\1 E015',
67
+ ),
68
+ 13 =>
69
+ array (
70
+ 'match' => '((E013|E015|0941|0942|0943|0962|093E|0940|0949|094A|094B|094C|0945|0946|0947|0948|0901)) 0930 094D',
71
+ 'replace' => '\\1 E015',
72
+ ),
73
+ 14 =>
74
+ array (
75
+ 'match' => '(093C) 0930 094D',
76
+ 'replace' => '\\1 E015',
77
+ ),
78
+ 15 =>
79
+ array (
80
+ 'match' => '(25CC) 0930 094D',
81
+ 'replace' => '\\1 E015',
82
+ ),
83
+ 16 =>
84
+ array (
85
+ 'match' => '(E128) 0930 094D',
86
+ 'replace' => '\\1 E015',
87
+ ),
88
+ 17 =>
89
+ array (
90
+ 'match' => '0915 093C',
91
+ 'replace' => '0958',
92
+ ),
93
+ 18 =>
94
+ array (
95
+ 'match' => '0916 093C',
96
+ 'replace' => '0959',
97
+ ),
98
+ 19 =>
99
+ array (
100
+ 'match' => '0917 093C',
101
+ 'replace' => '095A',
102
+ ),
103
+ 20 =>
104
+ array (
105
+ 'match' => '0918 093C',
106
+ 'replace' => 'E02A',
107
+ ),
108
+ 21 =>
109
+ array (
110
+ 'match' => '0919 093C',
111
+ 'replace' => 'E02B',
112
+ ),
113
+ 22 =>
114
+ array (
115
+ 'match' => '091A 093C',
116
+ 'replace' => 'E02C',
117
+ ),
118
+ 23 =>
119
+ array (
120
+ 'match' => '091B 093C',
121
+ 'replace' => 'E02D',
122
+ ),
123
+ 24 =>
124
+ array (
125
+ 'match' => '091C 093C',
126
+ 'replace' => '095B',
127
+ ),
128
+ 25 =>
129
+ array (
130
+ 'match' => '091D 093C',
131
+ 'replace' => 'E02E',
132
+ ),
133
+ 26 =>
134
+ array (
135
+ 'match' => '091E 093C',
136
+ 'replace' => 'E02F',
137
+ ),
138
+ 27 =>
139
+ array (
140
+ 'match' => '091F 093C',
141
+ 'replace' => 'E030',
142
+ ),
143
+ 28 =>
144
+ array (
145
+ 'match' => '0920 093C',
146
+ 'replace' => 'E031',
147
+ ),
148
+ 29 =>
149
+ array (
150
+ 'match' => '0921 093C',
151
+ 'replace' => '095C',
152
+ ),
153
+ 30 =>
154
+ array (
155
+ 'match' => '0922 093C',
156
+ 'replace' => '095D',
157
+ ),
158
+ 31 =>
159
+ array (
160
+ 'match' => '0923 093C',
161
+ 'replace' => 'E032',
162
+ ),
163
+ 32 =>
164
+ array (
165
+ 'match' => '0924 093C',
166
+ 'replace' => 'E033',
167
+ ),
168
+ 33 =>
169
+ array (
170
+ 'match' => '0925 093C',
171
+ 'replace' => 'E034',
172
+ ),
173
+ 34 =>
174
+ array (
175
+ 'match' => '0926 093C',
176
+ 'replace' => 'E035',
177
+ ),
178
+ 35 =>
179
+ array (
180
+ 'match' => '0927 093C',
181
+ 'replace' => 'E036',
182
+ ),
183
+ 36 =>
184
+ array (
185
+ 'match' => '0928 093C',
186
+ 'replace' => '0929',
187
+ ),
188
+ 37 =>
189
+ array (
190
+ 'match' => '092A 093C',
191
+ 'replace' => 'E037',
192
+ ),
193
+ 38 =>
194
+ array (
195
+ 'match' => '092B 093C',
196
+ 'replace' => '095E',
197
+ ),
198
+ 39 =>
199
+ array (
200
+ 'match' => '092C 093C',
201
+ 'replace' => 'E038',
202
+ ),
203
+ 40 =>
204
+ array (
205
+ 'match' => '092D 093C',
206
+ 'replace' => 'E039',
207
+ ),
208
+ 41 =>
209
+ array (
210
+ 'match' => '092E 093C',
211
+ 'replace' => 'E03A',
212
+ ),
213
+ 42 =>
214
+ array (
215
+ 'match' => '092F 093C',
216
+ 'replace' => '095F',
217
+ ),
218
+ 43 =>
219
+ array (
220
+ 'match' => '0930 093C',
221
+ 'replace' => '0931',
222
+ ),
223
+ 44 =>
224
+ array (
225
+ 'match' => '0932 093C',
226
+ 'replace' => 'E03B',
227
+ ),
228
+ 45 =>
229
+ array (
230
+ 'match' => '0933 093C',
231
+ 'replace' => '0934',
232
+ ),
233
+ 46 =>
234
+ array (
235
+ 'match' => '0935 093C',
236
+ 'replace' => 'E03C',
237
+ ),
238
+ 47 =>
239
+ array (
240
+ 'match' => '0936 093C',
241
+ 'replace' => 'E03D',
242
+ ),
243
+ 48 =>
244
+ array (
245
+ 'match' => '0937 093C',
246
+ 'replace' => 'E03E',
247
+ ),
248
+ 49 =>
249
+ array (
250
+ 'match' => '0938 093C',
251
+ 'replace' => 'E03F',
252
+ ),
253
+ 50 =>
254
+ array (
255
+ 'match' => '0939 093C',
256
+ 'replace' => 'E040',
257
+ ),
258
+ 51 =>
259
+ array (
260
+ 'match' => 'E028 093C',
261
+ 'replace' => 'E041',
262
+ ),
263
+ 52 =>
264
+ array (
265
+ 'match' => 'E029 093C',
266
+ 'replace' => 'E042',
267
+ ),
268
+ 53 =>
269
+ array (
270
+ 'match' => '0915 E013',
271
+ 'replace' => 'E08B',
272
+ ),
273
+ 54 =>
274
+ array (
275
+ 'match' => '0916 E013',
276
+ 'replace' => 'E08C',
277
+ ),
278
+ 55 =>
279
+ array (
280
+ 'match' => '0917 E013',
281
+ 'replace' => 'E08D',
282
+ ),
283
+ 56 =>
284
+ array (
285
+ 'match' => '0918 E013',
286
+ 'replace' => 'E08E',
287
+ ),
288
+ 57 =>
289
+ array (
290
+ 'match' => '0919 E013',
291
+ 'replace' => 'E08F',
292
+ ),
293
+ 58 =>
294
+ array (
295
+ 'match' => '091A E013',
296
+ 'replace' => 'E090',
297
+ ),
298
+ 59 =>
299
+ array (
300
+ 'match' => '091B E013',
301
+ 'replace' => 'E091',
302
+ ),
303
+ 60 =>
304
+ array (
305
+ 'match' => '091C E013',
306
+ 'replace' => 'E092',
307
+ ),
308
+ 61 =>
309
+ array (
310
+ 'match' => '091D E013',
311
+ 'replace' => 'E093',
312
+ ),
313
+ 62 =>
314
+ array (
315
+ 'match' => '091E E013',
316
+ 'replace' => 'E094',
317
+ ),
318
+ 63 =>
319
+ array (
320
+ 'match' => '091F E013',
321
+ 'replace' => 'E095',
322
+ ),
323
+ 64 =>
324
+ array (
325
+ 'match' => '0920 E013',
326
+ 'replace' => 'E096',
327
+ ),
328
+ 65 =>
329
+ array (
330
+ 'match' => '0921 E013',
331
+ 'replace' => 'E097',
332
+ ),
333
+ 66 =>
334
+ array (
335
+ 'match' => '0922 E013',
336
+ 'replace' => 'E098',
337
+ ),
338
+ 67 =>
339
+ array (
340
+ 'match' => '0923 E013',
341
+ 'replace' => 'E099',
342
+ ),
343
+ 68 =>
344
+ array (
345
+ 'match' => '0924 E013',
346
+ 'replace' => 'E09A',
347
+ ),
348
+ 69 =>
349
+ array (
350
+ 'match' => '0925 E013',
351
+ 'replace' => 'E09B',
352
+ ),
353
+ 70 =>
354
+ array (
355
+ 'match' => '0926 E013',
356
+ 'replace' => 'E09C',
357
+ ),
358
+ 71 =>
359
+ array (
360
+ 'match' => '0927 E013',
361
+ 'replace' => 'E09D',
362
+ ),
363
+ 72 =>
364
+ array (
365
+ 'match' => '0928 E013',
366
+ 'replace' => 'E09E',
367
+ ),
368
+ 73 =>
369
+ array (
370
+ 'match' => '092A E013',
371
+ 'replace' => 'E09F',
372
+ ),
373
+ 74 =>
374
+ ar