forked from kevinowino869/mitrobill
PHPMixBill v5.0 - First Upload
This commit is contained in:
21488
system/vendors/mpdf/utils/UnicodeData.txt
vendored
Normal file
21488
system/vendors/mpdf/utils/UnicodeData.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
218
system/vendors/mpdf/utils/UnicodeRanges.php
vendored
Normal file
218
system/vendors/mpdf/utils/UnicodeRanges.php
vendored
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
/////////////////
|
||||
$unicode_ranges = array(
|
||||
array('starthex'=> '0000', 'endhex'=>'007E', 'startdec'=> 0, 'enddec'=>126 , 'range'=>'Basic Latin'),
|
||||
array('starthex'=> '00A0', 'endhex'=>'00FF', 'startdec'=> 160, 'enddec'=>255 , 'range'=>'Latin-1 Supplement'),
|
||||
array('starthex'=> '0100', 'endhex'=>'017F', 'startdec'=> 256, 'enddec'=>383 , 'range'=>'Latin Extended-A'),
|
||||
array('starthex'=> '0180', 'endhex'=>'024F', 'startdec'=> 384, 'enddec'=>591 , 'range'=>'Latin Extended-B'),
|
||||
array('starthex'=> '0250', 'endhex'=>'02AF', 'startdec'=> 592, 'enddec'=>687 , 'range'=>'IPA Extensions'),
|
||||
array('starthex'=> '02B0', 'endhex'=>'02FF', 'startdec'=> 688, 'enddec'=>767 , 'range'=>'Spacing Modifier Letters'),
|
||||
array('starthex'=> '0300', 'endhex'=>'036F', 'startdec'=> 768, 'enddec'=>879 , 'range'=>'Combining Diacritical Marks', 'combining'=>true),
|
||||
array('starthex'=> '0370', 'endhex'=>'03FF', 'startdec'=> 880, 'enddec'=>1023 , 'range'=>'Greek'),
|
||||
array('starthex'=> '0400', 'endhex'=>'04FF', 'startdec'=> 1024, 'enddec'=>1279 , 'range'=>'Cyrillic'),
|
||||
array('starthex'=> '0500', 'endhex'=>'052F', 'startdec'=> 1280, 'enddec'=>1327 , 'range'=>'Cyrillic Supplement'),
|
||||
array('starthex'=> '0530', 'endhex'=>'058F', 'startdec'=> 1328, 'enddec'=>1423 , 'range'=>'Armenian'),
|
||||
array('starthex'=> '0590', 'endhex'=>'05FF', 'startdec'=> 1424, 'enddec'=>1535 , 'range'=>'Hebrew', 'rtl'=>true, 'special'=>true),
|
||||
array('starthex'=> '0600', 'endhex'=>'06FF', 'startdec'=> 1536, 'enddec'=>1791 , 'range'=>'Arabic', 'rtl'=>true, 'special'=>true),
|
||||
array('starthex'=> '0700', 'endhex'=>'074F', 'startdec'=> 1792, 'enddec'=>1871 , 'range'=>'Syriac', 'rtl'=>true, 'special'=>true),
|
||||
array('starthex'=> '0750', 'endhex'=>'077F', 'startdec'=> 1872, 'enddec'=>1919 , 'range'=>'Arabic Supplement', 'rtl'=>true, 'special'=>true),
|
||||
array('starthex'=> '0780', 'endhex'=>'07BF', 'startdec'=> 1920, 'enddec'=>1983 , 'range'=>'Thaana', 'rtl'=>true, 'special'=>true),
|
||||
array('starthex'=> '07C0', 'endhex'=>'07FF', 'startdec'=> 1984, 'enddec'=>2047 , 'range'=>'N\'Ko (Mandenkan)', 'rtl'=>true),
|
||||
array('starthex'=> '0800', 'endhex'=>'083E', 'startdec'=> 2048, 'enddec'=> 2110, 'range'=>'Samaritan', 'rtl'=>true),
|
||||
array('starthex'=> '0900', 'endhex'=>'097F', 'startdec'=> 2304, 'enddec'=>2431 , 'range'=>'Devanagari', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0980', 'endhex'=>'09FF', 'startdec'=> 2432, 'enddec'=>2559 , 'range'=>'Bengali', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0A00', 'endhex'=>'0A7F', 'startdec'=> 2560, 'enddec'=>2687 , 'range'=>'Gurmukhi', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0A80', 'endhex'=>'0AFF', 'startdec'=> 2688, 'enddec'=>2815 , 'range'=>'Gujarati', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0B00', 'endhex'=>'0B7F', 'startdec'=> 2816, 'enddec'=>2943 , 'range'=>'Oriya', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0B80', 'endhex'=>'0BFF', 'startdec'=> 2944, 'enddec'=>3071 , 'range'=>'Tamil', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0C00', 'endhex'=>'0C7F', 'startdec'=> 3072, 'enddec'=>3199 , 'range'=>'Telugu', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0C80', 'endhex'=>'0CFF', 'startdec'=> 3200, 'enddec'=>3327 , 'range'=>'Kannada', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0D00', 'endhex'=>'0D7F', 'startdec'=> 3328, 'enddec'=>3455 , 'range'=>'Malayalam', 'indic'=>true, 'special'=>true),
|
||||
array('starthex'=> '0D80', 'endhex'=>'0DFF', 'startdec'=> 3456, 'enddec'=>3583 , 'range'=>'Sinhala', 'special'=>true),
|
||||
array('starthex'=> '0E00', 'endhex'=>'0E7F', 'startdec'=> 3584, 'enddec'=>3711 , 'range'=>'Thai'),
|
||||
array('starthex'=> '0E80', 'endhex'=>'0EFF', 'startdec'=> 3712, 'enddec'=>3839 , 'range'=>'Lao'),
|
||||
array('starthex'=> '0F00', 'endhex'=>'0FFF', 'startdec'=> 3840, 'enddec'=>4095 , 'range'=>'Tibetan', 'special'=>true),
|
||||
array('starthex'=> '1000', 'endhex'=>'109F', 'startdec'=> 4096, 'enddec'=>4255 , 'range'=>'Myanmar', 'special'=>true),
|
||||
array('starthex'=> '10A0', 'endhex'=>'10FF', 'startdec'=> 4256, 'enddec'=>4351 , 'range'=>'Georgian'),
|
||||
array('starthex'=> '1100', 'endhex'=>'11FF', 'startdec'=> 4352, 'enddec'=>4607 , 'range'=>'Hangul Jamo', 'cjk'=>true),
|
||||
array('starthex'=> '1200', 'endhex'=>'137F', 'startdec'=> 4608, 'enddec'=>4991 , 'range'=>'Ethiopic'),
|
||||
array('starthex'=> '1380', 'endhex'=>'139F', 'startdec'=> 4992, 'enddec'=>5023 , 'range'=>'Ethiopic Supplement'),
|
||||
array('starthex'=> '13A0', 'endhex'=>'13FF', 'startdec'=> 5024, 'enddec'=>5119 , 'range'=>'Cherokee'),
|
||||
array('starthex'=> '1400', 'endhex'=>'167F', 'startdec'=> 5120, 'enddec'=>5759 , 'range'=>'Unified Canadian Aboriginal Syllabics'),
|
||||
array('starthex'=> '1680', 'endhex'=>'169F', 'startdec'=> 5760, 'enddec'=>5791 , 'range'=>'Ogham'),
|
||||
array('starthex'=> '16A0', 'endhex'=>'16FF', 'startdec'=> 5792, 'enddec'=>5887 , 'range'=>'Runic'),
|
||||
array('starthex'=> '1700', 'endhex'=>'171F', 'startdec'=> 5888, 'enddec'=> 5919, 'range'=>'Tagalog (Philippine)'),
|
||||
array('starthex'=> '1720', 'endhex'=>'173F', 'startdec'=> 5920, 'enddec'=> 5951, 'range'=>'Hanunoo (Philippine)'),
|
||||
array('starthex'=> '1740', 'endhex'=>'175F', 'startdec'=> 5952, 'enddec'=> 5983, 'range'=>'Buhid (Philippine)'),
|
||||
array('starthex'=> '1760', 'endhex'=>'177F', 'startdec'=> 5984, 'enddec'=> 6015, 'range'=>'Tagbanwa (Philippine)'),
|
||||
array('starthex'=> '1780', 'endhex'=>'17FF', 'startdec'=> 6016, 'enddec'=>6143 , 'range'=>'Khmer', 'special'=>true),
|
||||
array('starthex'=> '1800', 'endhex'=>'18AF', 'startdec'=> 6144, 'enddec'=>6319 , 'range'=>'Mongolian', 'vertical'=>true),
|
||||
array('starthex'=> '18B0', 'endhex'=>'18F5', 'startdec'=> 6320, 'enddec'=>6389 , 'range'=>'Canadian Syllabics'),
|
||||
array('starthex'=> '1900', 'endhex'=>'194F', 'startdec'=> 6400, 'enddec'=> 6479, 'range'=>'Limbu'),
|
||||
array('starthex'=> '1950', 'endhex'=>'197F', 'startdec'=> 6480, 'enddec'=> 6527, 'range'=>'Tai Le'),
|
||||
array('starthex'=> '1980', 'endhex'=>'19DF', 'startdec'=> 6528, 'enddec'=> 6623, 'range'=>'New Tai Lue'),
|
||||
array('starthex'=> '19E0', 'endhex'=>'19FF', 'startdec'=> 6624, 'enddec'=> 6655, 'range'=>'Khmer Symbols', 'special'=>true),
|
||||
array('starthex'=> '1A00', 'endhex'=>'1A1F', 'startdec'=> 6656, 'enddec'=> 6687, 'range'=>'Buginese'),
|
||||
array('starthex'=> '1A20', 'endhex'=>'1AAF', 'startdec'=> 6688, 'enddec'=> 6831, 'range'=>'Tai Tham'),
|
||||
array('starthex'=> '1B00', 'endhex'=>'1B7F', 'startdec'=> 6912, 'enddec'=> 7039, 'range'=>'Balinese', 'special'=>true),
|
||||
array('starthex'=> '1B80', 'endhex'=>'1BBF', 'startdec'=> 7040, 'enddec'=> 7103, 'range'=>'Sundanese'),
|
||||
array('starthex'=> '1C00', 'endhex'=>'1C4F', 'startdec'=> 7168, 'enddec'=> 7247, 'range'=>'Lepcha (Rong)'),
|
||||
array('starthex'=> '1C50', 'endhex'=>'1C7F', 'startdec'=> 7248, 'enddec'=> 7295, 'range'=>'Ol Chiki (Santali / Ol Cemet)'),
|
||||
array('starthex'=> '1CD0', 'endhex'=>'1CFF', 'startdec'=> 7376, 'enddec'=> 7423, 'range'=>'Vedic Extensions'),
|
||||
array('starthex'=> '1D00', 'endhex'=>'1D7F', 'startdec'=> 7424, 'enddec'=> 7551, 'range'=>'Phonetic Extensions'),
|
||||
array('starthex'=> '1D80', 'endhex'=>'1DBF', 'startdec'=> 7552, 'enddec'=> 7615, 'range'=>'Phonetic Extensions Supplement'),
|
||||
array('starthex'=> '1DC0', 'endhex'=>'1DFF', 'startdec'=> 7616, 'enddec'=> 7679, 'range'=>'Combining Diacritical Marks Supplement', 'combining'=>true),
|
||||
array('starthex'=> '1E00', 'endhex'=>'1EFF', 'startdec'=> 7680, 'enddec'=>7935 , 'range'=>'Latin Extended Additional'),
|
||||
array('starthex'=> '1F00', 'endhex'=>'1FFF', 'startdec'=> 7936, 'enddec'=>8191 , 'range'=>'Greek Extended'),
|
||||
array('starthex'=> '2000', 'endhex'=>'206F', 'startdec'=> 8192, 'enddec'=>8303 , 'range'=>'General Punctuation'),
|
||||
array('starthex'=> '2070', 'endhex'=>'209F', 'startdec'=> 8304, 'enddec'=>8351 , 'range'=>'Superscripts and Subscripts'),
|
||||
array('starthex'=> '20A0', 'endhex'=>'20CF', 'startdec'=> 8352, 'enddec'=>8399 , 'range'=>'Currency Symbols'),
|
||||
array('starthex'=> '20D0', 'endhex'=>'20FF', 'startdec'=> 8400, 'enddec'=>8447 , 'range'=>'Combining Marks for Symbols', 'combining'=>true),
|
||||
array('starthex'=> '2100', 'endhex'=>'214F', 'startdec'=> 8448, 'enddec'=>8527 , 'range'=>'Letterlike Symbols'),
|
||||
array('starthex'=> '2150', 'endhex'=>'218F', 'startdec'=> 8528, 'enddec'=>8591 , 'range'=>'Number Forms'),
|
||||
array('starthex'=> '2190', 'endhex'=>'21FF', 'startdec'=> 8592, 'enddec'=>8703 , 'range'=>'Arrows'),
|
||||
array('starthex'=> '2200', 'endhex'=>'22FF', 'startdec'=> 8704, 'enddec'=>8959 , 'range'=>'Mathematical Operators'),
|
||||
array('starthex'=> '2300', 'endhex'=>'23FF', 'startdec'=> 8960, 'enddec'=>9215 , 'range'=>'Miscellaneous Technical'),
|
||||
array('starthex'=> '2400', 'endhex'=>'243F', 'startdec'=> 9216, 'enddec'=>9279 , 'range'=>'Control Pictures'),
|
||||
array('starthex'=> '2440', 'endhex'=>'245F', 'startdec'=> 9280, 'enddec'=>9311 , 'range'=>'Optical Character Recognition'),
|
||||
array('starthex'=> '2460', 'endhex'=>'24FF', 'startdec'=> 9312, 'enddec'=>9471 , 'range'=>'Enclosed Alphanumerics'),
|
||||
array('starthex'=> '2500', 'endhex'=>'257F', 'startdec'=> 9472, 'enddec'=>9599 , 'range'=>'Box Drawing'),
|
||||
array('starthex'=> '2580', 'endhex'=>'259F', 'startdec'=> 9600, 'enddec'=>9631 , 'range'=>'Block Elements'),
|
||||
array('starthex'=> '25A0', 'endhex'=>'25FF', 'startdec'=> 9632, 'enddec'=>9727 , 'range'=>'Geometric Shapes'),
|
||||
array('starthex'=> '2600', 'endhex'=>'26FF', 'startdec'=> 9728, 'enddec'=>9983 , 'range'=>'Miscellaneous Symbols'),
|
||||
array('starthex'=> '2700', 'endhex'=>'27BF', 'startdec'=> 9984, 'enddec'=>10175 , 'range'=>'Dingbats'),
|
||||
array('starthex'=> '27C0', 'endhex'=>'27EF', 'startdec'=> 10176, 'enddec'=> 10223, 'range'=>'Miscellaneous Mathematical Symbols-A'),
|
||||
array('starthex'=> '27F0', 'endhex'=>'27FF', 'startdec'=> 10224, 'enddec'=> 10239, 'range'=>'Supplemental Arrows-A'),
|
||||
array('starthex'=> '2800', 'endhex'=>'28FF', 'startdec'=> 10240, 'enddec'=>10495 , 'range'=>'Braille Patterns'),
|
||||
array('starthex'=> '2900', 'endhex'=>'297F', 'startdec'=> 10496, 'enddec'=> 10623, 'range'=>'Supplemental Arrows-B'),
|
||||
array('starthex'=> '2980', 'endhex'=>'29FF', 'startdec'=> 10624, 'enddec'=> 10751, 'range'=>'Miscellaneous Mathematical Symbols-B'),
|
||||
array('starthex'=> '2A00', 'endhex'=>'2AFF', 'startdec'=> 10752, 'enddec'=> 11007, 'range'=>'Supplemental Mathematical Operators'),
|
||||
array('starthex'=> '2B00', 'endhex'=>'2BFF', 'startdec'=> 11008, 'enddec'=> 11263, 'range'=>'Miscellaneous Symbols and Arrows'),
|
||||
array('starthex'=> '2C00', 'endhex'=>'2C5F', 'startdec'=> 11264, 'enddec'=> 11359, 'range'=>'Glagolitic'),
|
||||
array('starthex'=> '2C60', 'endhex'=>'2C7F', 'startdec'=> 11360, 'enddec'=> 11391, 'range'=>'Latin Extended-C'),
|
||||
array('starthex'=> '2C80', 'endhex'=>'2CFF', 'startdec'=> 11392, 'enddec'=> 11519, 'range'=>'Coptic'),
|
||||
array('starthex'=> '2D00', 'endhex'=>'2D2F', 'startdec'=> 11520, 'enddec'=> 11567, 'range'=>'Georgian Supplement'),
|
||||
array('starthex'=> '2D30', 'endhex'=>'2D7F', 'startdec'=> 11568, 'enddec'=> 11647, 'range'=>'Tifinagh'),
|
||||
array('starthex'=> '2D80', 'endhex'=>'2DDF', 'startdec'=> 11648, 'enddec'=> 11743, 'range'=>'Ethiopic Extended'),
|
||||
array('starthex'=> '2DE0', 'endhex'=>'2DFF', 'startdec'=> 11744, 'enddec'=> 11775, 'range'=>'Cyrillic Extended-A'),
|
||||
array('starthex'=> '2E00', 'endhex'=>'2E7F', 'startdec'=> 11776, 'enddec'=> 11903, 'range'=>'Supplemental Punctuation'),
|
||||
|
||||
array('starthex'=> '2E80', 'endhex'=>'2EFF', 'startdec'=> 11904, 'enddec'=>12031 , 'range'=>'CJK Radicals Supplement', 'cjk'=>true),
|
||||
array('starthex'=> '2F00', 'endhex'=>'2FDF', 'startdec'=> 12032, 'enddec'=>12255 , 'range'=>'Kangxi Radicals', 'cjk'=>true),
|
||||
array('starthex'=> '2FF0', 'endhex'=>'2FFF', 'startdec'=> 12272, 'enddec'=>12287 , 'range'=>'Ideographic Description Characters', 'cjk'=>true),
|
||||
array('starthex'=> '3000', 'endhex'=>'303F', 'startdec'=> 12288, 'enddec'=>12351 , 'range'=>'CJK Symbols and Punctuation', 'cjk'=>true),
|
||||
array('starthex'=> '3040', 'endhex'=>'309F', 'startdec'=> 12352, 'enddec'=>12447 , 'range'=>'Hiragana', 'cjk'=>true),
|
||||
array('starthex'=> '30A0', 'endhex'=>'30FF', 'startdec'=> 12448, 'enddec'=>12543 , 'range'=>'Katakana', 'cjk'=>true),
|
||||
array('starthex'=> '3100', 'endhex'=>'312F', 'startdec'=> 12544, 'enddec'=>12591 , 'range'=>'Bopomofo', 'cjk'=>true),
|
||||
array('starthex'=> '3130', 'endhex'=>'318F', 'startdec'=> 12592, 'enddec'=>12687 , 'range'=>'Hangul Compatibility Jamo', 'cjk'=>true),
|
||||
array('starthex'=> '3190', 'endhex'=>'319F', 'startdec'=> 12688, 'enddec'=>12703 , 'range'=>'Kanbun', 'cjk'=>true),
|
||||
array('starthex'=> '31A0', 'endhex'=>'31BF', 'startdec'=> 12704, 'enddec'=>12735 , 'range'=>'Bopomofo Extended', 'cjk'=>true),
|
||||
array('starthex'=> '31C0', 'endhex'=>'31EF', 'startdec'=> 12736, 'enddec'=> 12783, 'range'=>'CJK Strokes', 'cjk'=>true),
|
||||
array('starthex'=> '31F0', 'endhex'=>'31FF', 'startdec'=> 12784, 'enddec'=> 12799, 'range'=>'Katakana Phonetic Extensions', 'cjk'=>true),
|
||||
array('starthex'=> '3200', 'endhex'=>'32FF', 'startdec'=> 12800, 'enddec'=>13055 , 'range'=>'Enclosed CJK Letters and Months', 'cjk'=>true),
|
||||
array('starthex'=> '3300', 'endhex'=>'33FF', 'startdec'=> 13056, 'enddec'=>13311 , 'range'=>'CJK Compatibility', 'cjk'=>true),
|
||||
array('starthex'=> '3400', 'endhex'=>'4DB5', 'startdec'=> 13312, 'enddec'=>19893 , 'range'=>'CJK Unified Ideographs Extension A', 'cjk'=>true),
|
||||
array('starthex'=> '4DC0', 'endhex'=>'4DFF', 'startdec'=> 19904, 'enddec'=> 19967, 'range'=>'Yijing Hexagram Symbols', 'cjk'=>true),
|
||||
array('starthex'=> '4E00', 'endhex'=>'9FFF', 'startdec'=> 19968, 'enddec'=>40959 , 'range'=>'CJK Unified Ideographs', 'cjk'=>true),
|
||||
array('starthex'=> 'A000', 'endhex'=>'A48F', 'startdec'=> 40960, 'enddec'=>42127 , 'range'=>'Yi Syllables', 'cjk'=>true),
|
||||
array('starthex'=> 'A490', 'endhex'=>'A4CF', 'startdec'=> 42128, 'enddec'=> 42191, 'range'=>'Yi Radicals', 'cjk'=>true),
|
||||
|
||||
array('starthex'=> 'A4D0', 'endhex'=>'A4FF', 'startdec'=> 42192, 'enddec'=> 42239, 'range'=>'Lisu'),
|
||||
|
||||
array('starthex'=> 'A500', 'endhex'=>'A63F', 'startdec'=> 42240, 'enddec'=> 42559, 'range'=>'Vai'),
|
||||
array('starthex'=> 'A640', 'endhex'=>'A69F', 'startdec'=> 42560, 'enddec'=> 42655, 'range'=>'Cyrillic Extended-B'),
|
||||
|
||||
array('starthex'=> 'A6A0', 'endhex'=>'A6FF', 'startdec'=> 42656, 'enddec'=> 42751, 'range'=>'Bamum'),
|
||||
|
||||
array('starthex'=> 'A700', 'endhex'=>'A71F', 'startdec'=> 42752, 'enddec'=> 42783, 'range'=>'Modifier Tone Letters'),
|
||||
array('starthex'=> 'A720', 'endhex'=>'A7FF', 'startdec'=> 42784, 'enddec'=> 43007, 'range'=>'Latin Extended-D'),
|
||||
array('starthex'=> 'A800', 'endhex'=>'A82F', 'startdec'=> 43008, 'enddec'=> 43055, 'range'=>'Syloti Nagri'),
|
||||
|
||||
array('starthex'=> 'A840', 'endhex'=>'A87F', 'startdec'=> 43072, 'enddec'=> 43135, 'range'=>'Phags-pa', 'vertical'=>true),
|
||||
array('starthex'=> 'A880', 'endhex'=>'A8DF', 'startdec'=> 43136, 'enddec'=> 43231, 'range'=>'Saurashtra'),
|
||||
|
||||
array('starthex'=> 'A900', 'endhex'=>'A92F', 'startdec'=> 43264, 'enddec'=> 43311, 'range'=>'Kayah Li'),
|
||||
array('starthex'=> 'A930', 'endhex'=>'A95F', 'startdec'=> 43312, 'enddec'=> 43359, 'range'=>'Rejang'),
|
||||
|
||||
array('starthex'=> 'A960', 'endhex'=>'A97F', 'startdec'=> 43360, 'enddec'=> 43391, 'range'=>'Hangul Choseong', 'cjk'=>true),
|
||||
array('starthex'=> 'A980', 'endhex'=>'A9DF', 'startdec'=> 43392, 'enddec'=> 43487, 'range'=>'Javanese'),
|
||||
|
||||
array('starthex'=> 'AA00', 'endhex'=>'AA5F', 'startdec'=> 43520, 'enddec'=> 43615, 'range'=>'Cham'),
|
||||
array('starthex'=> 'AA60', 'endhex'=>'AA7B', 'startdec'=> 43616, 'enddec'=> 43647, 'range'=>'Myanmar', 'special'=>true),
|
||||
array('starthex'=> 'AA80', 'endhex'=>'AADF', 'startdec'=> 43648, 'enddec'=> 43743, 'range'=>'Tai Viet'),
|
||||
|
||||
array('starthex'=> 'ABC0', 'endhex'=>'ABF9', 'startdec'=> 43968, 'enddec'=> 44025, 'range'=>'Meetei Mayek'),
|
||||
|
||||
array('starthex'=> 'AC00', 'endhex'=>'D7FF', 'startdec'=> 44032, 'enddec'=>55295 , 'range'=>'Hangul Syllables', 'cjk'=>true),
|
||||
|
||||
/*
|
||||
array('starthex'=> 'D800', 'endhex'=>'DB7F', 'startdec'=> 55296, 'enddec'=>56191 , 'range'=>'High Surrogates', 'reserved'=>true),
|
||||
array('starthex'=> 'DB80', 'endhex'=>'DBFF', 'startdec'=> 56192, 'enddec'=>56319 , 'range'=>'High Private Use Surrogates', 'reserved'=>true),
|
||||
array('starthex'=> 'DC00', 'endhex'=>'DFFF', 'startdec'=> 56320, 'enddec'=>57343 , 'range'=>'Low Surrogates', 'reserved'=>true),
|
||||
*/
|
||||
|
||||
array('starthex'=> 'E000', 'endhex'=>'F8FF', 'startdec'=> 57344, 'enddec'=>63743 , 'range'=>'Private Use', 'pua'=>true),
|
||||
|
||||
array('starthex'=> 'F900', 'endhex'=>'FAFF', 'startdec'=> 63744, 'enddec'=>64255 , 'range'=>'CJK Compatibility Ideographs', 'cjk'=>true),
|
||||
array('starthex'=> 'FB00', 'endhex'=>'FB4F', 'startdec'=> 64256, 'enddec'=>64335 , 'range'=>'Alphabetic Presentation Forms'),
|
||||
array('starthex'=> 'FB50', 'endhex'=>'FDFF', 'startdec'=> 64336, 'enddec'=>65023 , 'range'=>'Arabic Presentation Forms-A', 'rtl'=>true),
|
||||
|
||||
array('starthex'=> 'FE00', 'endhex'=>'FE0F', 'startdec'=> 65024, 'enddec'=> 65039, 'range'=>'Variation Selectors'),
|
||||
|
||||
array('starthex'=> 'FE10', 'endhex'=>'FE1F', 'startdec'=> 65040, 'enddec'=> 65055, 'range'=>'Vertical Forms'),
|
||||
array('starthex'=> 'FE20', 'endhex'=>'FE2F', 'startdec'=> 65056, 'enddec'=>65071 , 'range'=>'Combining Half Marks', 'combining'=>true),
|
||||
array('starthex'=> 'FE30', 'endhex'=>'FE4F', 'startdec'=> 65072, 'enddec'=>65103 , 'range'=>'CJK Compatibility Forms', 'cjk'=>true),
|
||||
array('starthex'=> 'FE50', 'endhex'=>'FE6F', 'startdec'=> 65104, 'enddec'=>65135 , 'range'=>'Small Form Variants', 'cjk'=>true),
|
||||
array('starthex'=> 'FE70', 'endhex'=>'FEFE', 'startdec'=> 65136, 'enddec'=>65278 , 'range'=>'Arabic Presentation Forms-B', 'rtl'=>true),
|
||||
array('starthex'=> 'FEFF', 'endhex'=>'FEFF', 'startdec'=> 65279, 'enddec'=>65279 , 'range'=>'Specials'),
|
||||
array('starthex'=> 'FF00', 'endhex'=>'FFEF', 'startdec'=> 65280, 'enddec'=>65519 , 'range'=>'Halfwidth and Fullwidth Forms', 'cjk'=>true),
|
||||
array('starthex'=> 'FFF0', 'endhex'=>'FFFD', 'startdec'=> 65520, 'enddec'=>65533 , 'range'=>'Specials'),
|
||||
|
||||
/* PLANE 1 */
|
||||
|
||||
array('starthex'=> '10000', 'endhex'=>'1007F', 'startdec'=> 65536 , 'enddec'=> 65663, 'range'=>'Linear B Syllabary'),
|
||||
array('starthex'=> '10080', 'endhex'=>'100FF', 'startdec'=> 65664 , 'enddec'=> 65791, 'range'=>'Linear B Ideograms'),
|
||||
array('starthex'=> '10100', 'endhex'=>'1013F', 'startdec'=> 65792 , 'enddec'=> 65855, 'range'=>'Aegean Numbers'),
|
||||
array('starthex'=> '10140', 'endhex'=>'1018F', 'startdec'=> 65856 , 'enddec'=> 65935, 'range'=>'Ancient Greek Numbers'),
|
||||
array('starthex'=> '10190', 'endhex'=>'101CF', 'startdec'=> 65936 , 'enddec'=> 65999, 'range'=>'Ancient Symbols'),
|
||||
array('starthex'=> '101D0', 'endhex'=>'101FF', 'startdec'=> 66000 , 'enddec'=> 66047, 'range'=>'Phaistos Disc'),
|
||||
array('starthex'=> '10280', 'endhex'=>'1029F', 'startdec'=> 66176 , 'enddec'=> 66207, 'range'=>'Lycian'),
|
||||
array('starthex'=> '102A0', 'endhex'=>'102DF', 'startdec'=> 66208 , 'enddec'=> 66271, 'range'=>'Carian'),
|
||||
array('starthex'=> '10300', 'endhex'=>'1032F', 'startdec'=> 66304 , 'enddec'=> 66351, 'range'=>'Old Italic'),
|
||||
array('starthex'=> '10330', 'endhex'=>'1034F', 'startdec'=> 66352 , 'enddec'=> 66383, 'range'=>'Gothic'),
|
||||
array('starthex'=> '10380', 'endhex'=>'1039F', 'startdec'=> 66432 , 'enddec'=> 66463, 'range'=>'Ugaritic'),
|
||||
array('starthex'=> '103A0', 'endhex'=>'103DF', 'startdec'=> 66464 , 'enddec'=> 66527, 'range'=>'Old Persian'),
|
||||
array('starthex'=> '10400', 'endhex'=>'1044F', 'startdec'=> 66560 , 'enddec'=> 66639, 'range'=>'Deseret'),
|
||||
array('starthex'=> '10450', 'endhex'=>'1047F', 'startdec'=> 66640 , 'enddec'=> 66687, 'range'=>'Shavian'),
|
||||
array('starthex'=> '10480', 'endhex'=>'104AF', 'startdec'=> 66688 , 'enddec'=> 66735, 'range'=>'Osmanya'),
|
||||
array('starthex'=> '10800', 'endhex'=>'1083F', 'startdec'=> 67584 , 'enddec'=> 67647, 'range'=>'Cypriot Syllabary'),
|
||||
array('starthex'=> '10900', 'endhex'=>'1091F', 'startdec'=> 67840 , 'enddec'=> 67871, 'range'=>'Phoenician'),
|
||||
array('starthex'=> '10920', 'endhex'=>'1093F', 'startdec'=> 67872 , 'enddec'=> 67903, 'range'=>'Lydian'),
|
||||
array('starthex'=> '10A00', 'endhex'=>'10A5F', 'startdec'=> 68096 , 'enddec'=> 68191, 'range'=>'Kharoshthi'),
|
||||
|
||||
array('starthex'=> '11080', 'endhex'=>'110CF', 'startdec'=> 69760 , 'enddec'=> 69839, 'range'=>'Kaithi'),
|
||||
|
||||
array('starthex'=> '12000', 'endhex'=>'123FF', 'startdec'=> 73728 , 'enddec'=> 74751, 'range'=>'Cuneiform (Sumero-Akkadian)'),
|
||||
array('starthex'=> '12400', 'endhex'=>'1247F', 'startdec'=> 74752 , 'enddec'=> 74879, 'range'=>'Cuneiform Numbers and Punctuation'),
|
||||
|
||||
array('starthex'=> '13000', 'endhex'=>'1342F', 'startdec'=> 77824 , 'enddec'=> 78895, 'range'=>'Egyptian Hieroglyphs'),
|
||||
|
||||
array('starthex'=> '1D000', 'endhex'=>'1D0FF', 'startdec'=> 118784 , 'enddec'=> 119039, 'range'=>'Byzantine Musical Symbols'),
|
||||
array('starthex'=> '1D100', 'endhex'=>'1D1FF', 'startdec'=> 119040 , 'enddec'=> 119295, 'range'=>'Musical Symbols'),
|
||||
array('starthex'=> '1D200', 'endhex'=>'1D24F', 'startdec'=> 119296 , 'enddec'=> 119375, 'range'=>'Ancient Greek Musical Notation'),
|
||||
array('starthex'=> '1D300', 'endhex'=>'1D35F', 'startdec'=> 119552 , 'enddec'=> 119647, 'range'=>'Tai Xuan Jing Symbols'),
|
||||
array('starthex'=> '1D360', 'endhex'=>'1D37F', 'startdec'=> 119648 , 'enddec'=> 119679, 'range'=>'Counting Rod Numerals'),
|
||||
array('starthex'=> '1D400', 'endhex'=>'1D7FF', 'startdec'=> 119808 , 'enddec'=> 120831, 'range'=>'Mathematical Alphanumeric Symbols'),
|
||||
array('starthex'=> '1F000', 'endhex'=>'1F02F', 'startdec'=> 126976 , 'enddec'=> 127023, 'range'=>'Mahjong Tiles'),
|
||||
array('starthex'=> '1F030', 'endhex'=>'1F09F', 'startdec'=> 127024 , 'enddec'=> 127135, 'range'=>'Domino Tiles'),
|
||||
|
||||
/* PLANE 2 */
|
||||
|
||||
array('starthex'=> '20000', 'endhex'=>'2A6DF', 'startdec'=> 131072 , 'enddec'=> 173791, 'range'=>'CJK Unified Ideographs Extension B'),
|
||||
array('starthex'=> '2A700', 'endhex'=>'2B734', 'startdec'=> 173824 , 'enddec'=> 177972, 'range'=>'CJK Unified Ideographs Extension C'),
|
||||
array('starthex'=> '2F800', 'endhex'=>'2FA1F', 'startdec'=> 194560 , 'enddec'=> 195103, 'range'=>'CJK Compatibility Ideographs Supplement'),
|
||||
|
||||
);
|
||||
|
||||
?>
|
72
system/vendors/mpdf/utils/font_collections.php
vendored
Normal file
72
system/vendors/mpdf/utils/font_collections.php
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/* This script prints out details of any TrueType collection font files
|
||||
in your font directory. Files ending wih .otc are examined.
|
||||
Point your browser to
|
||||
http://your.domain/your_path_to _mpdf/utils/font_collections.php
|
||||
By default this will examine the folder /ttfonts/ (or the default font
|
||||
directory defined by _MPDF_TTFONTPATH.
|
||||
You can optionally define an alternative folder to examine by setting
|
||||
the variable below (must be a relative path, or filesystem path):
|
||||
*/
|
||||
|
||||
|
||||
$checkdir = '';
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
ini_set("memory_limit","256M");
|
||||
|
||||
|
||||
define('_MPDF_PATH','../');
|
||||
|
||||
include("../mpdf.php");
|
||||
$mpdf=new mPDF('');
|
||||
if ($checkdir) {
|
||||
$ttfdir = $checkdir;
|
||||
}
|
||||
else { $ttfdir = _MPDF_TTFONTPATH; }
|
||||
|
||||
|
||||
|
||||
$mqr=ini_get("magic_quotes_runtime");
|
||||
if ($mqr) { set_magic_quotes_runtime(0); }
|
||||
if (!class_exists('TTFontFile_Analysis', false)) { include(_MPDF_PATH .'classes/ttfontsuni_analysis.php'); }
|
||||
$ttf = new TTFontFile_Analysis();
|
||||
|
||||
$ff = scandir($ttfdir);
|
||||
|
||||
echo '<h3>Font collection files found in '.$ttfdir.' directory</h3>';
|
||||
foreach($ff AS $f) {
|
||||
$ret = array();
|
||||
if (strtolower(substr($f,-4,4))=='.ttc' || strtolower(substr($f,-4,4))=='.ttcf') { // Mac ttcf
|
||||
$ttf->getTTCFonts($ttfdir.$f);
|
||||
$nf = $ttf->numTTCFonts;
|
||||
echo '<p>Font collection file ('.$f.') contains the following fonts:</p>';
|
||||
for ($i=1; $i<=$nf; $i++) {
|
||||
$ret = $ttf->extractCoreInfo($ttfdir.$f, $i);
|
||||
$tfname = $ret[0];
|
||||
$bold = $ret[1];
|
||||
$italic = $ret[2];
|
||||
$fname = strtolower($tfname );
|
||||
$fname = preg_replace('/[ ()]/','',$fname );
|
||||
$style = '';
|
||||
if ($bold) { $style .= 'Bold'; }
|
||||
if ($italic) { $style .= 'Italic'; }
|
||||
if (!$style) { $style = 'Regular'; }
|
||||
|
||||
|
||||
echo '<div>['.$i.'] '.$tfname.' ('.$fname.') '.$style.'</div>';
|
||||
|
||||
}
|
||||
echo '<hr />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
252
system/vendors/mpdf/utils/font_coverage.php
vendored
Normal file
252
system/vendors/mpdf/utils/font_coverage.php
vendored
Normal file
@ -0,0 +1,252 @@
|
||||
<?php
|
||||
|
||||
/* This script prints out the Unicode coverage of all TrueType font files
|
||||
in your font directory.
|
||||
Point your browser to
|
||||
http://your.domain/your_path_to _mpdf/utils/font_coverage.php
|
||||
By default this will examine the folder /ttfonts/ (or the default font
|
||||
directory defined by _MPDF_TTFONTPATH.
|
||||
You can optionally define an alternative folder to examine by setting
|
||||
the variable below (must be a relative path, or filesystem path):
|
||||
*/
|
||||
|
||||
|
||||
$checkdir = '';
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
set_time_limit(600);
|
||||
ini_set("memory_limit","256M");
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
include("../mpdf.php");
|
||||
|
||||
$mpdf=new mPDF('','A4-L','','',10,10,10,10);
|
||||
$mpdf->SetDisplayMode('fullpage');
|
||||
$mpdf->useSubstitutions = true;
|
||||
$mpdf->debug = true;
|
||||
$mpdf->simpleTables = true;
|
||||
if ($checkdir) {
|
||||
$ttfdir = $checkdir;
|
||||
}
|
||||
else { $ttfdir = _MPDF_TTFONTPATH; }
|
||||
|
||||
|
||||
|
||||
$mqr=ini_get("magic_quotes_runtime");
|
||||
if ($mqr) { set_magic_quotes_runtime(0); }
|
||||
if (!class_exists('TTFontFile_Analysis', false)) { include(_MPDF_PATH .'classes/ttfontsuni_analysis.php'); }
|
||||
|
||||
//==============================================================
|
||||
$smp = true;
|
||||
$maxt = 131071;
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
$unifile = file('UnicodeData.txt');
|
||||
$unichars = array();
|
||||
foreach($unifile AS $line) {
|
||||
if (preg_match('/<control>/',$line,$m)) {
|
||||
$rangename = '';
|
||||
continue;
|
||||
}
|
||||
else if (preg_match('/^([12]{0,1}[0-9A-Za-z]{4});<(.*?), Last>/',$line,$m)) {
|
||||
if ($rangename && $rangename == $m[2]) {
|
||||
$endrange = hexdec($m[1]);
|
||||
for ($i=$startrange;$i<=$endrange; $i++) {
|
||||
$unichars[$i] = $i;
|
||||
}
|
||||
}
|
||||
$rangename = '';
|
||||
}
|
||||
else if (preg_match('/^([12]{0,1}[0-9A-Za-z]{4});<(.*?), First>/',$line,$m)) {
|
||||
$startrange = hexdec($m[1]);
|
||||
$rangename = $m[2];
|
||||
}
|
||||
else if (preg_match('/^([12]{0,1}[0-9A-Za-z]{4});/',$line,$m)) {
|
||||
$unichars[hexdec($m[1])] = hexdec($m[1]);
|
||||
$rangename = '';
|
||||
}
|
||||
}
|
||||
|
||||
// loads array $unicode_ranges
|
||||
include('UnicodeRanges.php');
|
||||
//==============================================================
|
||||
$html = '<html><head><style>td { border: 0.1mm solid #555555; }
|
||||
body { font-weight: normal; font-family: helvetica;font-size:8pt; }
|
||||
td { font-family: helvetica;font-size:8pt; vertical-align: top;}
|
||||
</style></head><body>';
|
||||
|
||||
//==============================================================
|
||||
$ff = scandir($ttfdir);
|
||||
$tempfontdata = array();
|
||||
foreach($ff AS $f) {
|
||||
$ttf = new TTFontFile_Analysis();
|
||||
$ret = array();
|
||||
$isTTC = false;
|
||||
if (strtolower(substr($f,-4,4))=='.ttf' || strtolower(substr($f,-4,4))=='.otf') {
|
||||
$ret[] = $ttf->extractCoreInfo($ttfdir.$f);
|
||||
}
|
||||
for ($i=0; $i<count($ret); $i++) {
|
||||
if (is_array($ret[$i])) {
|
||||
$tfname = $ret[$i][0];
|
||||
$bold = $ret[$i][1];
|
||||
$italic = $ret[$i][2];
|
||||
$fname = strtolower($tfname );
|
||||
$fname = preg_replace('/[ ()]/','',$fname );
|
||||
//$tempfonttrans[$tfname] = $fname;
|
||||
$style = '';
|
||||
if ($bold) { $style .= 'B'; }
|
||||
if ($italic) { $style .= 'I'; }
|
||||
if (!$style) {
|
||||
$tempfontdata[$fname]['file'] = $f;
|
||||
if ($isTTC) {
|
||||
$tempfontdata[$fname]['TTCfontID'] = $ret[$i][4];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($ttf);
|
||||
|
||||
}
|
||||
|
||||
$fullcovers = array();
|
||||
$nearlycovers = array();
|
||||
ksort($tempfontdata);
|
||||
$ningroup = 14;
|
||||
$nofgroups = ceil(count($unicode_ranges)/$ningroup);
|
||||
|
||||
//==============================================================
|
||||
|
||||
|
||||
for ($urgp = 0; $urgp < $nofgroups; $urgp++) {
|
||||
|
||||
|
||||
$html .= '<table cellpadding="2" cellspacing="0" style="page-break-inside:avoid; text-align:center; border-collapse: collapse; ">';
|
||||
$html .= '<thead><tr><td></td>';
|
||||
|
||||
foreach($unicode_ranges AS $urk => $ur) {
|
||||
if ($urk >= ($urgp*$ningroup) && $urk < (($urgp+1)*$ningroup)) {
|
||||
$rangekey = $urk;
|
||||
$range = $ur['range'];
|
||||
$rangestart = $ur['starthex'];
|
||||
$rangeend = $ur['endhex'];
|
||||
$html .= '<td style="font-family:helvetica;font-size:8pt;font-weight:bold;">'.strtoupper($range).' (U+'.$rangestart .'-U+'.$rangeend.')</td>';
|
||||
}
|
||||
}
|
||||
$html .= '</tr></thead>';
|
||||
|
||||
|
||||
foreach ($tempfontdata AS $fname => $v) {
|
||||
$cw = '';
|
||||
if (file_exists((_MPDF_TTFONTDATAPATH.$fname.'.cw.dat'))) { $cw = file_get_contents(_MPDF_TTFONTDATAPATH.$fname.'.cw.dat'); }
|
||||
else {
|
||||
$mpdf->fontdata[$fname]['R'] = $tempfontdata[$fname]['file'];
|
||||
$mpdf->AddFont($fname);
|
||||
$cw = file_get_contents(_MPDF_TTFONTDATAPATH.$fname.'.cw.dat');
|
||||
}
|
||||
if (!$cw) {
|
||||
continue;
|
||||
die("Font data not available for $fname");
|
||||
}
|
||||
|
||||
$counter=0;
|
||||
$max = $maxt;
|
||||
|
||||
// create HTML content
|
||||
$html .= '<tr>';
|
||||
$html .= '<td>'.$fname.'</td>';
|
||||
|
||||
foreach($unicode_ranges AS $urk => $ur) {
|
||||
if ($urk >= ($urgp*$ningroup) && $urk < (($urgp+1)*$ningroup)) {
|
||||
if ($ur['pua'] || $ur['reserved'] || $ur['control']) {
|
||||
$html .= '<td style="background-color: #000000;"></td>';
|
||||
}
|
||||
else {
|
||||
$rangekey = $urk;
|
||||
$range = $ur['range'];
|
||||
$rangestart = $ur['starthex'];
|
||||
$rangeend = $ur['endhex'];
|
||||
$rangestartdec = $ur['startdec'];
|
||||
$rangeenddec = $ur['enddec'];
|
||||
$uniinrange = 0;
|
||||
$fontinrange = 0;
|
||||
for ($i=$rangestartdec; $i<=$rangeenddec; $i++) {
|
||||
//if (isset($cw[$i])) { $fontinrange++; }
|
||||
if ($mpdf->_charDefined($cw, $i)) { $fontinrange++; }
|
||||
if (isset($unichars[$i])) { $uniinrange++; }
|
||||
}
|
||||
if ($uniinrange) {
|
||||
if ($fontinrange) {
|
||||
$pc = ($fontinrange/$uniinrange);
|
||||
$str = '('.$fontinrange.'/'.$uniinrange.')';
|
||||
if ($pc==1) {
|
||||
$fullcovers[$urk][] = $fname;
|
||||
$html .= '<td style="background-color: #00FF00;"></td>';
|
||||
}
|
||||
else if ($pc>1) {
|
||||
$fullcovers[$urk][] = $fname;
|
||||
$html .= '<td style="background-color: #00FF00;">'.$str.'</td>';
|
||||
}
|
||||
else if ($pc>=0.9) {
|
||||
$html .= '<td style="background-color: #AAFFAA;">'.$str.'</td>';
|
||||
$nearlycovers[$urk][] = $fname;
|
||||
}
|
||||
else if ($pc>0.75) { $html .= '<td style="background-color: #00FFAA;">'.$str.'</td>'; }
|
||||
else if ($pc>0.5) { $html .= '<td style="background-color: #AAAAFF;">'.$str.'</td>'; }
|
||||
else if ($pc>0.25) { $html .= '<td style="background-color: #FFFFAA;">'.$str.'</td>'; }
|
||||
else { $html .= '<td style="background-color: #FFAAAA;">'.$str.'</td>'; }
|
||||
}
|
||||
else { $html .= '<td style="background-color: #555555;">(0/0)</td>'; }
|
||||
}
|
||||
else { $html .= '<td style="background-color: #000000;"></td>'; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$html .= '</tr>';
|
||||
|
||||
}
|
||||
//==============================================================
|
||||
$html .= '</table><pagebreak />';
|
||||
}
|
||||
|
||||
$html .= '<h4>Fonts with full coverage of Unicode Ranges</h4>';
|
||||
$html .= '<table>';
|
||||
//$html .= '<tr><td></td><td></td></tr>';
|
||||
foreach($unicode_ranges AS $urk => $ur) {
|
||||
if ($ur['pua'] || $ur['reserved'] || $ur['control']) { continue; }
|
||||
$rangekey = $urk;
|
||||
$range = $ur['range'];
|
||||
$rangestart = $ur['starthex'];
|
||||
$rangeend = $ur['endhex'];
|
||||
$ext = $ext2 = '';
|
||||
if ($ur['combining']) { $ext = 'background-color:#DDDDFF;'; $ext2 = '<br /><span style="color:#AA0000">Special positioning required</span>'; }
|
||||
if ($ur['vertical']) { $ext = 'background-color:#FFDDDD;'; $ext2 = '<br /><span style="color:#AA0000">Vertical positioning required</span>'; }
|
||||
if ($ur['special']) { $ext = 'background-color:#FFDDDD;'; $ext2 = '<br /><span style="color:#AA0000">Special processing required</span>'; }
|
||||
|
||||
|
||||
$html .= '<tr><td style="font-family:helvetica;font-size:8pt;font-weight:bold;'.$ext.'">'.strtoupper($range).' (U+'.$rangestart .'-U+'.$rangeend.')'.$ext2.'</td>';
|
||||
$arr = $fullcovers[$urk];
|
||||
$narr = $nearlycovers[$urk];
|
||||
if (is_array($arr)) { $html .= '<td>'. implode(', ',$arr). '</td></tr>'; }
|
||||
else if (is_array($narr)) { $html .= '<td style="background-color: #AAAAAA;">'. implode(', ',$narr). ' (>90%)</td></tr>'; }
|
||||
else { $html .= '<td style="background-color: #555555;"> </td></tr>'; }
|
||||
}
|
||||
$html.= '</table>';
|
||||
|
||||
|
||||
//==============================================================
|
||||
echo $html;
|
||||
|
||||
exit;
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
|
||||
|
||||
?>
|
235
system/vendors/mpdf/utils/font_dump.php
vendored
Normal file
235
system/vendors/mpdf/utils/font_dump.php
vendored
Normal file
@ -0,0 +1,235 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This script prints out all characters in a TrueType font file
|
||||
to a PDF document. Point your browser to
|
||||
http://your.domain/your_path_to _mpdf/utils/font_dump.php
|
||||
The font file must be located in /ttfonts/ (or the default font
|
||||
directory defined by _MPDF_TTFONTPATH.
|
||||
By default this will examine the font dejavusanscondensed.
|
||||
You can optionally define an alternative font file to examine by setting
|
||||
the variable below (must be a relative path, or filesystem path):
|
||||
*/
|
||||
|
||||
|
||||
$font = 'dejavusanscondensed'; // Use internal mPDF font-name
|
||||
|
||||
$min = 0x0020; // Minimum Unicode value to show
|
||||
$max = 0x2FFFF; // Maximum Unicode value to show
|
||||
|
||||
$showmissing = false; // Show all missing unicode blocks / characters
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
set_time_limit(600);
|
||||
ini_set("memory_limit","512M");
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
include("../mpdf.php");
|
||||
|
||||
$mpdf=new mPDF('');
|
||||
|
||||
$mpdf->SetDisplayMode('fullpage');
|
||||
|
||||
$mpdf->useSubstitutions = true;
|
||||
$mpdf->simpleTables = true;
|
||||
// force fonts to be embedded whole i.e. NOT susbet
|
||||
$mpdf->percentSubset = 0;
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
|
||||
// This generates a .mtx.php file if not already generated
|
||||
$mpdf->WriteHTML('<style>td { border: 0.1mm solid #555555; } body { font-weight: normal; }</style>');
|
||||
$mpdf->WriteHTML('<h3 style="font-family:'.$font.'">'.strtoupper($font).'</h3>'); // Separate Paragraphs defined by font
|
||||
$html = '';
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
$unifile = file('UnicodeData.txt');
|
||||
$unichars = array();
|
||||
|
||||
foreach($unifile AS $line) {
|
||||
if ($smp && preg_match('/^(1[0-9A-Za-z]{4});/',$line,$m)) {
|
||||
$unichars[hexdec($m[1])] = hexdec($m[1]);
|
||||
}
|
||||
else if (preg_match('/^([0-9A-Za-z]{4});/',$line,$m)) {
|
||||
$unichars[hexdec($m[1])] = hexdec($m[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// loads array $unicode_ranges
|
||||
include('UnicodeRanges.php');
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
|
||||
|
||||
|
||||
$cw = file_get_contents(_MPDF_TTFONTDATAPATH.$font.'.cw.dat');
|
||||
if (!$cw) { die("Error - Must be able to read font metrics file: "._MPDF_TTFONTDATAPATH.$font.'.cw.dat'); }
|
||||
$counter=0;
|
||||
|
||||
|
||||
include(_MPDF_TTFONTDATAPATH.$font.'.mtx.php');
|
||||
|
||||
if ($smp) {
|
||||
$max = min($max,131071);
|
||||
}
|
||||
else {
|
||||
$max = min($max,65535);
|
||||
}
|
||||
|
||||
|
||||
$justfinishedblank = false;
|
||||
$justfinishedblankinvalid = false;
|
||||
|
||||
foreach($unicode_ranges AS $urk => $ur) {
|
||||
if (0 >= $ur['startdec'] && 0 <= $ur['enddec']) {
|
||||
$rangekey = $urk;
|
||||
$range = $ur['range'];
|
||||
$rangestart = $ur['starthex'];
|
||||
$rangeend = $ur['endhex'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$lastrange = $range ;
|
||||
// create HTML content
|
||||
$html .= '<table cellpadding="2" cellspacing="0" style="font-family:'.$font.';text-align:center; border-collapse: collapse; ">';
|
||||
$html .= '<tr><td colspan="18" style="font-family:dejavusanscondensed;font-weight:bold">'.strtoupper($font).'</td></tr>';
|
||||
$html .= '<tr><td colspan="18" style="font-family:dejavusanscondensed;font-size:8pt;font-weight:bold">'.strtoupper($range).' (U+'.$rangestart .'-U+'.$rangeend.')</td></tr>';
|
||||
$html .= '<tr><td></td>';
|
||||
|
||||
$html .= '<td></td>';
|
||||
for ($i = 0; $i < 16; $i++) {
|
||||
$html .= '<td><b>-'.sprintf('%X', $i).'</b></td>';
|
||||
}
|
||||
|
||||
|
||||
// print each character
|
||||
for ($i = $min; $i <= $max; ++$i) {
|
||||
if (($i > 0) AND (($i % 16) == 0)) {
|
||||
$notthisline = true;
|
||||
while($notthisline) {
|
||||
for ($j = 0; $j < 16; $j++) {
|
||||
if ($mpdf->_charDefined($cw, ($i + $j))) {
|
||||
//if (isset($cw[($i+$j)])) {
|
||||
$notthisline = false;
|
||||
}
|
||||
}
|
||||
if ($notthisline) {
|
||||
if ($showmissing) {
|
||||
$range = '';
|
||||
foreach($unicode_ranges AS $urk => $ur) {
|
||||
if ($i >= $ur['startdec'] && $i <= $ur['enddec']) {
|
||||
$rangekey = $urk;
|
||||
$range = $ur['range'];
|
||||
$rangestart = $ur['starthex'];
|
||||
$rangeend = $ur['endhex'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$anyvalid = false;
|
||||
for ($j = 0; $j < 16; $j++) {
|
||||
if (isset($unichars[$i+$j])) { $anyvalid = true; break; }
|
||||
}
|
||||
if ($range && $range == $lastrange) {
|
||||
if (!$anyvalid) {
|
||||
if (!$justfinishedblankinvalid) {
|
||||
$html .= '<tr><td colspan="18" style="background-color:#555555; font-size: 4pt;"> </td></tr>';
|
||||
}
|
||||
$justfinishedblankinvalid = true;
|
||||
}
|
||||
else if (!$justfinishedblank ) {
|
||||
$html .= '<tr><td colspan="18" style="background-color:#FFAAAA; font-size: 4pt;"> </td></tr>';
|
||||
$justfinishedblank = true;
|
||||
}
|
||||
}
|
||||
else if($range) {
|
||||
$html .= '</tr></table><br />';
|
||||
$mpdf->WriteHTML($html); $html = '';
|
||||
$html .= '<table cellpadding="2" cellspacing="0" style="font-family:'.$font.';text-align:center; border-collapse: collapse; ">';
|
||||
$html .= '<tr><td colspan="18" style="font-family:dejavusanscondensed;font-size:8pt;font-weight:bold">'.strtoupper($range).' (U+'.$rangestart.'-U+'.$rangeend.')</td></tr>';
|
||||
$html .= '<tr><td></td>';
|
||||
$html .= '<td></td>';
|
||||
for ($k = 0; $k < 16; $k++) {
|
||||
$html .= '<td><b>-'.sprintf('%X', $k).'</b></td>';
|
||||
}
|
||||
$justfinishedblank = false;
|
||||
$justfinishedblankinvalid = false;
|
||||
}
|
||||
$lastrange = $range ;
|
||||
}
|
||||
$i +=16;
|
||||
if ($i > $max) { break 2; }
|
||||
}
|
||||
}
|
||||
foreach($unicode_ranges AS $urk => $ur) {
|
||||
if ($i >= $ur['startdec'] && $i <= $ur['enddec']) {
|
||||
$rangekey = $urk;
|
||||
$range = $ur['range'];
|
||||
$rangestart = $ur['starthex'];
|
||||
$rangeend = $ur['endhex'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($i > 0 && ($i % 16) == 0 && ($range != $lastrange)) {
|
||||
$html .= '</tr></table><br />';
|
||||
$mpdf->WriteHTML($html); $html = '';
|
||||
$html .= '<table cellpadding="2" cellspacing="0" style="font-family:'.$font.';text-align:center; border-collapse: collapse; ">';
|
||||
$html .= '<tr><td colspan="18" style="font-family:dejavusanscondensed;font-size:8pt;font-weight:bold">'.strtoupper($range).' (U+'.$rangestart.'-U+'.$rangeend.')</td></tr>';
|
||||
$html .= '<tr><td></td>';
|
||||
$html .= '<td></td>';
|
||||
for ($k = 0; $k < 16; $k++) {
|
||||
$html .= '<td><b>-'.sprintf('%X', $k).'</b></td>';
|
||||
}
|
||||
}
|
||||
$lastrange = $range ;
|
||||
$justfinishedblank = false;
|
||||
$justfinishedblankinvalid = false;
|
||||
$html .= '</tr><tr><td><i>'.(floor($i / 16)*16).'</i></td>';
|
||||
$html .= '<td><b>'.sprintf('%03X', floor($i / 16)).'-</b></td>';
|
||||
}
|
||||
|
||||
// Add dotted circle to any character (mark) with width=0
|
||||
if ($mpdf->_charDefined($cw, $i) && _getCharWidth($cw, $i)==0) { $html .= '<td>◌&#'.$i.';</td>'; $counter++; }
|
||||
else {
|
||||
if ($mpdf->_charDefined($cw, $i)) { $html .= '<td>&#'.$i.';</td>'; $counter++; }
|
||||
else if (isset($unichars[$i])) { $html .= '<td style="background-color: #FFAAAA;"></td>'; }
|
||||
else { $html .= '<td style="background-color: #555555;"></td>'; }
|
||||
}
|
||||
}
|
||||
|
||||
if (($i % 16) > 0) {
|
||||
for ($j = ($i % 16); $j < 16; ++$j) { $html .= '<td style="background-color: #555555;"></td>'; }
|
||||
}
|
||||
$html .= '</tr></table><br />';
|
||||
//==============================================================
|
||||
function _getCharWidth(&$cw, $u, $isdef=true) {
|
||||
if ($u==0) { $w = false; }
|
||||
else { $w = (ord($cw[$u*2]) << 8) + ord($cw[$u*2+1]); }
|
||||
if ($w == 65535) { return 0; }
|
||||
else if ($w) { return $w; }
|
||||
else if ($isdef) { return false; }
|
||||
else { return 0; }
|
||||
}
|
||||
//==============================================================
|
||||
$mpdf->WriteHTML($html); // Separate Paragraphs defined by font
|
||||
|
||||
$mpdf->Output();
|
||||
exit;
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
|
||||
|
||||
?>
|
237
system/vendors/mpdf/utils/font_dump_OTL.php
vendored
Normal file
237
system/vendors/mpdf/utils/font_dump_OTL.php
vendored
Normal file
@ -0,0 +1,237 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
$family = 'khmeros';
|
||||
//////////////////////////////////
|
||||
$style = ''; // '','B','I','BI'; // At present only works for Regular style
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
$script = '';
|
||||
$lang = '';
|
||||
if (isset($_REQUEST['script'])) { $script = $_REQUEST['script']; }
|
||||
if (isset($_REQUEST['lang'])) { $lang = $_REQUEST['lang']; }
|
||||
|
||||
if ($script && strlen($script )<4) { $script = str_pad($script , 4, ' '); }
|
||||
if ($lang && strlen($lang)<4) { $lang = str_pad($lang, 4, ' '); }
|
||||
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
set_time_limit(1200);
|
||||
ini_set("memory_limit","512M");
|
||||
|
||||
//==============================================================
|
||||
$overrideTTFFontRestriction = true;
|
||||
//==============================================================
|
||||
include("../mpdf.php");
|
||||
|
||||
$mpdf=new mPDF('');
|
||||
|
||||
$mpdf->simpleTables = true;
|
||||
|
||||
//==============================================================
|
||||
// This generates a .mtx.php file if not already generated
|
||||
$mpdf->SetFont($family,$style);
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
$ff = array();
|
||||
$ffs = '';
|
||||
if ($lang && $script) {
|
||||
$GSUBFeatures = $mpdf->CurrentFont['GSUBFeatures'][$script][$lang];
|
||||
if (is_array($GSUBFeatures)) {
|
||||
foreach($GSUBFeatures AS $tag=>$v) {
|
||||
$ff[] = '"'.$tag.'" 0';
|
||||
}
|
||||
}
|
||||
$GPOSFeatures = $mpdf->CurrentFont['GPOSFeatures'][$script][$lang];
|
||||
if (is_array($GPOSFeatures )) {
|
||||
foreach($GPOSFeatures AS $tag=>$v) {
|
||||
$ff[] = '"'.$tag.'" 0';
|
||||
}
|
||||
}
|
||||
$ffs = implode(', ',$ff);
|
||||
}
|
||||
//==============================================================
|
||||
|
||||
$html = '
|
||||
<style>
|
||||
body {
|
||||
font-family: DejaVuSansCondensed;
|
||||
font-weight: normal;
|
||||
font-size: 11pt;
|
||||
font-feature-settings: '.$ffs.';
|
||||
}
|
||||
h5 {
|
||||
font-size: 1rem;
|
||||
color: #000066;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
.glyphs {
|
||||
font-family: '.$family.';
|
||||
}
|
||||
.subtable {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
h5.level2 {
|
||||
font-size: 0.85rem;
|
||||
color: #6666AA;
|
||||
}
|
||||
.lookuptype {
|
||||
font-size: 0.7rem;
|
||||
color: #888888;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.lookuptypesub {
|
||||
font-size: 0.7rem;
|
||||
color: #888888;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
span.unicode {
|
||||
color: #888888;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
span.changed {
|
||||
font-family: '.$family.';
|
||||
font-size: 1.5rem;
|
||||
color: #FF4444;
|
||||
font-feature-settings: '.$ffs.';
|
||||
}
|
||||
span.unchanged {
|
||||
font-family: '.$family.';
|
||||
font-size: 1.5rem;
|
||||
color: #4444FF;
|
||||
font-feature-settings: '.$ffs.';
|
||||
}
|
||||
span.backtrack {
|
||||
font-family: '.$family.';
|
||||
font-size: 1.5rem;
|
||||
color: #66aa66;
|
||||
font-feature-settings: '.$ffs.';
|
||||
}
|
||||
span.lookahead {
|
||||
font-family: '.$family.';
|
||||
font-size: 1.5rem;
|
||||
color: #66aa66;
|
||||
font-feature-settings: '.$ffs.';
|
||||
}
|
||||
span.inputother {
|
||||
font-family: '.$family.';
|
||||
font-size: 1.5rem;
|
||||
color: #006688;
|
||||
font-feature-settings: '.$ffs.';
|
||||
}
|
||||
div.context {
|
||||
font-size: 0.7rem;
|
||||
color: #888888;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
div.sequenceIndex {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
div.rule {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
.ignore {
|
||||
color: #888888;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
div.level2 {
|
||||
margin-left: 5em;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<h1 style="text-align:center;">'.strtoupper($family.$style).'</h1>
|
||||
';
|
||||
|
||||
if ($lang && $script) {
|
||||
$html .= '<h2 style="text-align:center;">'.$script.' '.$lang.'</h2>';
|
||||
}
|
||||
$mpdf->WriteHTML($html);
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
$mpdf->debugfonts = false;
|
||||
|
||||
$family = strtolower($family);
|
||||
$style=strtoupper($style);
|
||||
if($style=='IB') $style='BI';
|
||||
$fontkey = $family.$style;
|
||||
$stylekey = $style;
|
||||
if (!$style) { $stylekey = 'R'; }
|
||||
|
||||
//==============================================================
|
||||
$mpdf->overrideOTLsettings[$fontkey]['script'] = $script;
|
||||
$mpdf->overrideOTLsettings[$fontkey]['lang'] = $lang;
|
||||
//==============================================================
|
||||
|
||||
|
||||
//include(_MPDF_TTFONTDATAPATH.$fontkey.'.mtx.php');
|
||||
|
||||
$ttffile = '';
|
||||
if (defined('_MPDF_SYSTEM_TTFONTS')) {
|
||||
$ttffile = _MPDF_SYSTEM_TTFONTS.$mpdf->fontdata[$family][$stylekey];
|
||||
if (!file_exists($ttffile)) { $ttffile = ''; }
|
||||
}
|
||||
if (!$ttffile) {
|
||||
$ttffile = _MPDF_TTFONTPATH.$mpdf->fontdata[$family][$stylekey];
|
||||
if (!file_exists($ttffile)) { die("mPDF Error - cannot find TTF TrueType font file - ".$ttffile); }
|
||||
}
|
||||
$ttfstat = stat($ttffile);
|
||||
|
||||
if (isset($mpdf->fontdata[$family]['TTCfontID'][$stylekey])) { $TTCfontID = $mpdf->fontdata[$family]['TTCfontID'][$stylekey]; }
|
||||
else { $TTCfontID = 0; }
|
||||
|
||||
|
||||
$BMPonly = false;
|
||||
if (in_array($family,$mpdf->BMPonly)) { $BMPonly = true; }
|
||||
$useOTL = $mpdf->fontdata[$family]['useOTL'];
|
||||
include(_MPDF_PATH .'classes/otl_dump.php');
|
||||
$ttf = new OTLdump($mpdf);
|
||||
|
||||
$mpdf->OTLscript = $script;
|
||||
$mpdf->OTLlang = $lang;
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
if($lang && $script) {
|
||||
|
||||
$ttf->getMetrics($ttffile, $fontkey, $TTCfontID, $mpdf->debugfonts, $BMPonly, true, $useOTL, 'detail');
|
||||
}
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
else { // IF lang and script not defined
|
||||
|
||||
$ttf->getMetrics($ttffile, $fontkey, $TTCfontID, $mpdf->debugfonts, $BMPonly, true, $useOTL, 'summary');
|
||||
|
||||
}
|
||||
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
|
||||
$mpdf->Output();
|
||||
exit;
|
||||
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
//==============================================================
|
||||
|
||||
|
||||
?>
|
214
system/vendors/mpdf/utils/font_names.php
vendored
Normal file
214
system/vendors/mpdf/utils/font_names.php
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
<?php
|
||||
|
||||
/* This script examines your font directory.
|
||||
Point your browser to
|
||||
http://your.domain/your_path_to _mpdf/utils/font_names.php
|
||||
By default this will examine the folder /ttfonts/ (or the default font
|
||||
directory defined by _MPDF_TTFONTPATH.
|
||||
You can optionally define an alternative folder to examine by setting
|
||||
the variable checkdir below (must be a relative path, or filesystem path).
|
||||
You can optionally output just the font samples as a PDF file by setting $pdf=true.
|
||||
*/
|
||||
|
||||
|
||||
$checkdir = '';
|
||||
|
||||
$pdf = false;
|
||||
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
ini_set("memory_limit","256M");
|
||||
|
||||
define('_MPDF_PATH','../');
|
||||
|
||||
include("../mpdf.php");
|
||||
$mpdf=new mPDF('s');
|
||||
$mpdf->useSubstitutions = true;
|
||||
if ($checkdir) {
|
||||
$ttfdir = $checkdir;
|
||||
}
|
||||
else { $ttfdir = _MPDF_TTFONTPATH; }
|
||||
|
||||
$mqr=ini_get("magic_quotes_runtime");
|
||||
if ($mqr) { set_magic_quotes_runtime(0); }
|
||||
if (!class_exists('TTFontFile_Analysis', false)) { include(_MPDF_PATH .'classes/ttfontsuni_analysis.php'); }
|
||||
$ttf = new TTFontFile_Analysis();
|
||||
|
||||
$tempfontdata = array();
|
||||
$tempsansfonts = array();
|
||||
$tempseriffonts = array();
|
||||
$tempmonofonts = array();
|
||||
$tempfonttrans = array();
|
||||
|
||||
$ff = scandir($ttfdir);
|
||||
|
||||
foreach($ff AS $f) {
|
||||
$ret = array();
|
||||
$isTTC = false;
|
||||
if (strtolower(substr($f,-4,4))=='.ttc' || strtolower(substr($f,-5,5))=='.ttcf') { // Mac ttcf
|
||||
$isTTC = true;
|
||||
$ttf->getTTCFonts($ttfdir.$f);
|
||||
$nf = $ttf->numTTCFonts;
|
||||
for ($i=1; $i<=$nf; $i++) {
|
||||
$ret[] = $ttf->extractCoreInfo($ttfdir.$f, $i);
|
||||
}
|
||||
}
|
||||
else if (strtolower(substr($f,-4,4))=='.ttf' || strtolower(substr($f,-4,4))=='.otf' ) {
|
||||
$ret[] = $ttf->extractCoreInfo($ttfdir.$f);
|
||||
}
|
||||
for ($i=0; $i<count($ret); $i++) {
|
||||
if (!is_array($ret[$i])) {
|
||||
if (!$pdf) echo $ret[$i].'<br />';
|
||||
}
|
||||
else {
|
||||
$tfname = $ret[$i][0];
|
||||
$bold = $ret[$i][1];
|
||||
$italic = $ret[$i][2];
|
||||
$fname = strtolower($tfname );
|
||||
$fname = preg_replace('/[ ()]/','',$fname );
|
||||
$tempfonttrans[$tfname] = $fname;
|
||||
$style = '';
|
||||
if ($bold) { $style .= 'B'; }
|
||||
if ($italic) { $style .= 'I'; }
|
||||
if (!$style) { $style = 'R'; }
|
||||
$tempfontdata[$fname][$style] = $f;
|
||||
if ($isTTC) {
|
||||
$tempfontdata[$fname]['TTCfontID'][$style] = $ret[$i][4];
|
||||
}
|
||||
//if ($ret[$i][5]) { $tempfontdata[$fname]['rtl'] = true; }
|
||||
//if ($ret[$i][7]) { $tempfontdata[$fname]['cjk'] = true; }
|
||||
if ($ret[$i][8]) { $tempfontdata[$fname]['sip'] = true; }
|
||||
if ($ret[$i][9]) { $tempfontdata[$fname]['smp'] = true; }
|
||||
if ($ret[$i][10]) { $tempfontdata[$fname]['puaag'] = true; }
|
||||
if ($ret[$i][11]) { $tempfontdata[$fname]['pua'] = true; }
|
||||
if ($ret[$i][12]) { $tempfontdata[$fname]['unAGlyphs'] = true; }
|
||||
$ftype = $ret[$i][3]; // mono, sans or serif
|
||||
if ($ftype=='sans') { $tempsansfonts[] = $fname; }
|
||||
else if ($ftype=='serif') { $tempseriffonts[] = $fname; }
|
||||
else if ($ftype=='mono') { $tempmonofonts[] = $fname; }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$tempsansfonts = array_unique($tempsansfonts);
|
||||
$tempseriffonts = array_unique($tempseriffonts );
|
||||
$tempmonofonts = array_unique($tempmonofonts );
|
||||
$tempfonttrans = array_unique($tempfonttrans);
|
||||
|
||||
if (!$pdf) {
|
||||
echo '<h3>Information</h3>';
|
||||
}
|
||||
|
||||
foreach ($tempfontdata AS $fname => $v) {
|
||||
if (!isset($tempfontdata[$fname]['R']) || !$tempfontdata[$fname]['R']) {
|
||||
if (!$pdf) echo 'WARNING - Font file for '.$fname.' may be an italic cursive script, or extra-bold etc.<br />';
|
||||
if (isset($tempfontdata[$fname]['I']) && $tempfontdata[$fname]['I']) {
|
||||
$tempfontdata[$fname]['R'] = $tempfontdata[$fname]['I'];
|
||||
}
|
||||
else if (isset($tempfontdata[$fname]['B']) && $tempfontdata[$fname]['B']) {
|
||||
$tempfontdata[$fname]['R'] = $tempfontdata[$fname]['B'];
|
||||
}
|
||||
else if (isset($tempfontdata[$fname]['BI']) && $tempfontdata[$fname]['BI']) {
|
||||
$tempfontdata[$fname]['R'] = $tempfontdata[$fname]['BI'];
|
||||
}
|
||||
}
|
||||
if (isset($tempfontdata[$fname]['smp']) && $tempfontdata[$fname]['smp']) {
|
||||
if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Plane 1 SMP<br />';
|
||||
$tempfontdata[$fname]['smp'] = false;
|
||||
}
|
||||
// if (isset($tempfontdata[$fname]['pua']) && $tempfontdata[$fname]['pua']) {
|
||||
// if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Private Use Area (U+E000-U+F8FF)<br />';
|
||||
// }
|
||||
if (isset($tempfontdata[$fname]['unAGlyphs']) && $tempfontdata[$fname]['unAGlyphs']) {
|
||||
if (!$pdf) echo 'INFO - Font file '.$fname.' contains non-indexed Arabic Glyphs "unAGlyphs" (which can be mapped to U+F500-U+F7FF)<br />';
|
||||
if (isset($tempfontdata[$fname]['puaag']) && $tempfontdata[$fname]['puaag']) {
|
||||
if (!$pdf) echo 'WARNING - Font file '.$fname.' already includes mapped characters in the part of Unicode Private Use Area which mPDF uses for mapping non-indexed Arabic Glyphs "unAGlyphs" (U+F500-U+F7FF)<br />';
|
||||
}
|
||||
}
|
||||
if (isset($tempfontdata[$fname]['sip']) && $tempfontdata[$fname]['sip']) {
|
||||
if (!$pdf) echo 'INFO - Font file '.$fname.' contains characters in Unicode Plane 2 SIP<br />';
|
||||
if (preg_match('/^(.*)-extb/',$fname, $fm)) {
|
||||
if (isset($tempfontdata[($fm[1])]) && $tempfontdata[($fm[1])]) {
|
||||
$tempfontdata[($fm[1])]['sip-ext'] = $fname;
|
||||
if (!$pdf) echo 'INFO - Font file '.$fname.' has been defined as a CJK ext-B for '.($fm[1]).'<br />';
|
||||
}
|
||||
else if (isset($tempfontdata[($fm[1].'-exta')]) && $tempfontdata[($fm[1].'-exta')]) {
|
||||
$tempfontdata[($fm[1].'-exta')]['sip-ext'] = $fname;
|
||||
if (!$pdf) echo 'INFO - Font file '.$fname.' has been defined as a CJK ext-B for '.($fm[1].'-exta').'<br />';
|
||||
}
|
||||
}
|
||||
// else { unset($tempfontdata[$fname]['sip']); }
|
||||
}
|
||||
unset($tempfontdata[$fname]['sip']);
|
||||
unset($tempfontdata[$fname]['smp']);
|
||||
unset($tempfontdata[$fname]['pua']);
|
||||
unset($tempfontdata[$fname]['puaag']);
|
||||
unset($tempfontdata[$fname]['unAGlyphs']);
|
||||
}
|
||||
|
||||
$mpdf->fontdata = array_merge($tempfontdata ,$mpdf->fontdata);
|
||||
|
||||
$mpdf->available_unifonts = array();
|
||||
foreach ($mpdf->fontdata AS $f => $fs) {
|
||||
if (isset($fs['R']) && $fs['R']) { $mpdf->available_unifonts[] = $f; }
|
||||
if (isset($fs['B']) && $fs['B']) { $mpdf->available_unifonts[] = $f.'B'; }
|
||||
if (isset($fs['I']) && $fs['I']) { $mpdf->available_unifonts[] = $f.'I'; }
|
||||
if (isset($fs['BI']) && $fs['BI']) { $mpdf->available_unifonts[] = $f.'BI'; }
|
||||
}
|
||||
|
||||
$mpdf->default_available_fonts = $mpdf->available_unifonts;
|
||||
|
||||
if (!$pdf) {
|
||||
echo '<hr />';
|
||||
echo '<h3>Font names as parsed by mPDF</h3>';
|
||||
}
|
||||
|
||||
ksort($tempfonttrans);
|
||||
$html = '';
|
||||
foreach($tempfonttrans AS $on=>$mn) {
|
||||
if (!file_exists($ttfdir.$mpdf->fontdata[$mn]['R'])) { continue; }
|
||||
$ond = '"'.$on.'"';
|
||||
$html .= '<p style="font-family:'.$on.';">'.$ond.' font is available as '.$mn;
|
||||
if (isset($mpdf->fontdata[$mn]['sip-ext']) && $mpdf->fontdata[$mn]['sip-ext']) {
|
||||
$html .= '; CJK ExtB: '.$mpdf->fontdata[$mn]['sip-ext'];
|
||||
}
|
||||
$html .= '</p>';
|
||||
}
|
||||
|
||||
if ($pdf) {
|
||||
$mpdf->WriteHTML($html);
|
||||
$mpdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
foreach($tempfonttrans AS $on=>$mn) {
|
||||
$ond = '"'.$on.'"';
|
||||
echo '<div style="font-family:\''.$on.'\';">'.$ond.' font is available as '.$mn;
|
||||
if (isset($mpdf->fontdata[$mn]['sip-ext']) && $mpdf->fontdata[$mn]['sip-ext']) {
|
||||
echo '; CJK ExtB: '.$mpdf->fontdata[$mn]['sip-ext'];
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '<hr />';
|
||||
|
||||
echo '<h3>Sample config_fonts.php file</h3>';
|
||||
echo '<div>Remember to edit the following arrays to place your preferred default first in order:</div>';
|
||||
|
||||
echo '<pre>';
|
||||
|
||||
ksort($tempfontdata);
|
||||
echo '$this->fontdata = '.var_export($tempfontdata,true).";\n";
|
||||
|
||||
sort($tempsansfonts);
|
||||
echo '$this->sans_fonts = array(\''.implode("', '", $tempsansfonts)."');\n";
|
||||
sort($tempseriffonts);
|
||||
echo '$this->serif_fonts = array(\''.implode("', '", $tempseriffonts)."');\n";
|
||||
sort($tempmonofonts);
|
||||
echo '$this->mono_fonts = array(\''.implode("', '", $tempmonofonts)."');\n";
|
||||
echo '</pre>';
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
525
system/vendors/mpdf/utils/image_details.php
vendored
Normal file
525
system/vendors/mpdf/utils/image_details.php
vendored
Normal file
@ -0,0 +1,525 @@
|
||||
<?php
|
||||
|
||||
$orig_srcpath='../tests/tiger.png'; // as specified in your file (could be full URL)
|
||||
$file = 'http://127.0.0.1/MPDF1.com/common/mpdf/tests/tiger.png'; // Full URL
|
||||
$fileIsLocal = true; // is the file in the same domain?
|
||||
|
||||
//======================================================================
|
||||
|
||||
$ppUx = 0;
|
||||
$type = '';
|
||||
$data = '';
|
||||
|
||||
echo 'File: ' .$orig_srcpath . '<br />';
|
||||
echo 'Full File URL: ' .$file . '<br />';
|
||||
if ($orig_srcpath && $fileIsLocal && $check = @fopen($orig_srcpath,"rb")) {
|
||||
fclose($check);
|
||||
$file=$orig_srcpath;
|
||||
$data = file_get_contents($file);
|
||||
$type = _imageTypeFromString($data);
|
||||
echo 'File accessed using fopen on $orig_srcpath' . '<br />';
|
||||
}
|
||||
if (!$data && $check = @fopen($file,"rb")) {
|
||||
fclose($check);
|
||||
$data = file_get_contents($file);
|
||||
$type = _imageTypeFromString($data);
|
||||
echo 'File accessed using fopen on $file' . '<br />';
|
||||
}
|
||||
if ((!$data || !$type) && !ini_get('allow_url_fopen') ) { // only worth trying if remote file and !ini_get('allow_url_fopen')
|
||||
file_get_contents_by_socket($file, $data); // needs full url?? even on local (never needed for local)
|
||||
if ($data) { $type = _imageTypeFromString($data); }
|
||||
echo 'File accessed using socket ' . '<br />';
|
||||
}
|
||||
if ((!$data || !$type) && !ini_get('allow_url_fopen') && function_exists("curl_init")) {
|
||||
file_get_contents_by_curl($file, $data); // needs full url?? even on local (never needed for local)
|
||||
if ($data) { $type = _imageTypeFromString($data); }
|
||||
echo 'File accessed using cURL ' . '<br />';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!$data) { echo 'Could not access image file' . '<br />'; exit; }
|
||||
|
||||
echo 'Image type determined: ' .strtoupper($type) . '<br />';
|
||||
|
||||
// JPEG
|
||||
if ($type == 'jpeg' || $type == 'jpg') {
|
||||
$hdr = _jpgHeaderFromString($data);
|
||||
if (!$hdr) { echo 'Error parsing JPG header' . '<br />'; exit; }
|
||||
$a = _jpgDataFromHeader($hdr);
|
||||
$channels = intval($a[4]);
|
||||
echo 'Width: ' . $a[0]. '<br />';
|
||||
echo 'Height: ' . $a[1]. '<br />';
|
||||
echo 'Colorspace: ' . $a[2]. '<br />';
|
||||
echo 'BPC (bits per channel): ' . $a[3]. '<br />';
|
||||
echo 'Channels: ' . $channels. '<br />';
|
||||
|
||||
$j = strpos($data,'JFIF');
|
||||
if ($j) {
|
||||
//Read resolution
|
||||
$unitSp=ord(substr($data,($j+7),1));
|
||||
if ($unitSp > 0) {
|
||||
$ppUx=_twobytes2int(substr($data,($j+8),2)); // horizontal pixels per meter, usually set to zero
|
||||
if ($unitSp == 2) { // = dots per cm (if == 1 set as dpi)
|
||||
$ppUx=round($ppUx/10 *25.4);
|
||||
}
|
||||
}
|
||||
echo 'Resolution ppUx: ' . $ppUx. '<br />';
|
||||
}
|
||||
else echo 'JFIF not found in header' . '<br />';
|
||||
|
||||
|
||||
// mPDF 6 ICC profile
|
||||
$offset = 0;
|
||||
$icc = array();
|
||||
while (($pos = strpos($data, "ICC_PROFILE\0", $offset)) !== false) {
|
||||
// get ICC sequence length
|
||||
$length = _twobytes2int(substr($data, ($pos - 2),2)) - 16;
|
||||
$sn = max(1, ord($data[($pos + 12)]));
|
||||
$nom = max(1, ord($data[($pos + 13)]));
|
||||
$icc[($sn - 1)] = substr($data, ($pos + 14), $length);
|
||||
$offset = ($pos + 14 + $length);
|
||||
}
|
||||
// order and compact ICC segments
|
||||
if (count($icc) > 0) {
|
||||
echo 'ICC profile present' . '<br />';
|
||||
ksort($icc);
|
||||
$icc = implode('', $icc);
|
||||
if (substr($icc, 36, 4) != 'acsp') {
|
||||
// invalid ICC profile
|
||||
echo 'ICC profile INVALID (no acsp flag)' . '<br />';
|
||||
}
|
||||
$input = substr($icc, 16, 4);
|
||||
$output = substr($icc, 20, 4);
|
||||
echo 'ICC profile Input: ' . $input. '<br />';
|
||||
echo 'ICC profile Output: ' . $output. '<br />';
|
||||
// Ignore Color profiles for conversion to other colorspaces e.g. CMYK/Lab
|
||||
if ($input != 'RGB ' || $output != 'XYZ ') { echo 'ICC profile ignored by mPDF' . '<br />'; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// PNG
|
||||
else if ($type == 'png') {
|
||||
//Check signature
|
||||
if(substr($data,0,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) {
|
||||
echo 'Error parsing PNG identifier<br />'; exit;
|
||||
}
|
||||
//Read header chunk
|
||||
if(substr($data,12,4)!='IHDR') {
|
||||
echo 'Incorrect PNG file (no IHDR block found)<br />'; exit;
|
||||
}
|
||||
|
||||
$w=_fourbytes2int(substr($data,16,4));
|
||||
$h=_fourbytes2int(substr($data,20,4));
|
||||
$bpc=ord(substr($data,24,1));
|
||||
$errpng = false;
|
||||
$pngalpha = false;
|
||||
$channels = 0;
|
||||
|
||||
echo 'Width: ' .$w . '<br />';
|
||||
echo 'Height: ' .$h . '<br />';
|
||||
echo 'BPC (bits per channel): ' .$bpc . '<br />';
|
||||
|
||||
$ct=ord(substr($data,25,1));
|
||||
if($ct==0) { $colspace='DeviceGray'; $channels = 1; }
|
||||
elseif($ct==2) { $colspace='DeviceRGB'; $channels = 3; }
|
||||
elseif($ct==3) { $colspace='Indexed'; $channels = 1; }
|
||||
elseif($ct==4) { $colspace='DeviceGray'; $channels = 1; $errpng = 'alpha channel'; $pngalpha = true; }
|
||||
else { $colspace='DeviceRGB'; $channels = 3; $errpng = 'alpha channel'; $pngalpha = true; }
|
||||
|
||||
echo 'Colorspace: ' . $colspace. '<br />';
|
||||
echo 'Channels: ' . $channels. '<br />';
|
||||
if ($pngalpha) echo 'Alpha channel detected'. '<br />';
|
||||
|
||||
if ($ct < 4 && strpos($data,'tRNS')!==false) { echo 'Transparency detected'. '<br />'; $errpng = 'transparency'; $pngalpha = true;}
|
||||
|
||||
if ($ct == 3 && strpos($data,'iCCP')!==false) { echo 'Indexed plus ICC'. '<br />'; $errpng = 'indexed plus ICC'; }
|
||||
|
||||
if(ord(substr($data,26,1))!=0) { echo 'compression method not set to zero<br />'; $errpng = 'compression method'; } // only 0 should be specified
|
||||
if(ord(substr($data,27,1))!=0) { echo 'filter method not set to zero<br />'; $errpng = 'filter method'; } // only 0 should be specified
|
||||
if(ord(substr($data,28,1))!=0) { echo 'interlaced file not set to zero<br />'; $errpng = 'interlaced file'; }
|
||||
|
||||
$j = strpos($data,'pHYs');
|
||||
if ($j) {
|
||||
//Read resolution
|
||||
$unitSp=ord(substr($data,($j+12),1));
|
||||
if ($unitSp == 1) {
|
||||
$ppUx=_fourbytes2int(substr($data,($j+4),4)); // horizontal pixels per meter, usually set to zero
|
||||
$ppUx=round($ppUx/1000 *25.4);
|
||||
}
|
||||
echo 'Resolution ppUx: ' . $ppUx. '<br />';
|
||||
}
|
||||
|
||||
// mPDF 6 Gamma correction
|
||||
$gamma_correction = 0;
|
||||
$gAMA = 0;
|
||||
$j = strpos($data,'gAMA');
|
||||
if ($j && strpos($data,'sRGB')===false) { // sRGB colorspace - overrides gAMA
|
||||
$gAMA=_fourbytes2int(substr($data,($j+4),4)); // Gamma value times 100000
|
||||
$gAMA /= 100000;
|
||||
|
||||
}
|
||||
|
||||
if ($gAMA) { $gamma_correction = 1/$gAMA; }
|
||||
|
||||
// Don't need to apply gamma correction if == default i.e. 2.2
|
||||
if ($gamma_correction > 2.15 && $gamma_correction < 2.25) { $gamma_correction = 0; }
|
||||
|
||||
if ($gamma_correction) { echo 'Gamma correction detected'. '<br />'; }
|
||||
|
||||
// NOT supported at present
|
||||
if (strpos($data,'sRGB')!==false) echo 'sRGB colorspace - NOT supported at present'. '<br />';
|
||||
if (strpos($data,'cHRM')!==false) echo 'Chromaticity and Whitepoint - NOT supported at present'. '<br />';
|
||||
|
||||
if (($errpng || $pngalpha || $gamma_correction)) {
|
||||
if (function_exists('gd_info')) { $gd = gd_info(); }
|
||||
else {$gd = array(); }
|
||||
if (!isset($gd['PNG Support'])) { echo 'GD library required for PNG image ('.$errpng.')'. '<br />';}
|
||||
$im = imagecreatefromstring($data);
|
||||
|
||||
if (!$im) { echo 'Error creating GD image from PNG file ('.$errpng.')'. '<br />';}
|
||||
$w = imagesx($im);
|
||||
$h = imagesy($im);
|
||||
if ($im) {
|
||||
|
||||
// Alpha channel set (including using tRNS for Paletted images)
|
||||
if ($pngalpha) {
|
||||
echo 'Alpha channel will be used by mPDF (including when tRNS present in Paletted images)<br />';
|
||||
if ($colspace=='Indexed') { echo '...Generating Alpha channel values from tRNS (Indexed)<br />'; }
|
||||
else if ($ct===0 || $ct==2) { echo '...Generating Alpha channel values from tRNS (non-Indexed)<br />'; }
|
||||
else { echo '...Extracting Alpha channel<br />'; }
|
||||
|
||||
|
||||
}
|
||||
else { // No alpha/transparency set (but cannot read directly because e.g. bit-depth != 8, interlaced etc)
|
||||
echo 'No alpha/transparency set (but cannot read directly because e.g. bit-depth != 8, interlaced etc)<br />';
|
||||
|
||||
// ICC profile
|
||||
$icc = false;
|
||||
$p = strpos($data,'iCCP');
|
||||
if ($p && $colspace=="Indexed") {
|
||||
$p += 4;
|
||||
$n=_fourbytes2int(substr($data,($p-8),4));
|
||||
$nullsep = strpos(substr($data,$p,80), chr(0));
|
||||
$icc = substr($data, ($p+$nullsep+2), ($n-($nullsep+2)) );
|
||||
// Test if file is gzcompressed
|
||||
if (ord(substr($str, 0, 1)) == 0x1f && ord(substr($str, 1, 1)) == 0x8b) {
|
||||
$icc = @gzuncompress($icc); // Ignored if fails
|
||||
}
|
||||
if ($icc) {
|
||||
echo 'ICC profile present' . '<br />';
|
||||
if (substr($icc, 36, 4) != 'acsp') { echo 'ICC profile INVALID (no acsp flag)' . '<br />'; $icc = false; } // invalid ICC profile
|
||||
else {
|
||||
$input = substr($icc, 16, 4);
|
||||
$output = substr($icc, 20, 4);
|
||||
echo 'ICC profile Input: ' . $input. '<br />';
|
||||
echo 'ICC profile Output: ' . $output. '<br />';
|
||||
// Ignore Color profiles for conversion to other colorspaces e.g. CMYK/Lab
|
||||
if ($input != 'RGB ' || $output != 'XYZ ') { $icc = false; echo 'ICC profile ignored by mPDF' . '<br />'; }
|
||||
}
|
||||
}
|
||||
// Convert to RGB colorspace so can use ICC Profile
|
||||
if ($icc) { echo 'ICC profile and Indexed colorspace both present - need to Convert to RGB colorspace so can use ICC Profile<br />'; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
echo 'PNG Image parsed on second pass' . '<br />';
|
||||
|
||||
// SECOND PASS
|
||||
imagealphablending($im, false);
|
||||
imagesavealpha($im, false);
|
||||
imageinterlace($im, false);
|
||||
ob_start();
|
||||
$check = @imagepng($im);
|
||||
if (!$check) { echo 'Error creating temporary image object whilst using GD library to parse PNG image' . '<br />'; }
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
if (!$data) { echo 'Error parsing temporary file image object created with GD library to parse PNG image' . '<br />'; }
|
||||
imagedestroy($im);
|
||||
|
||||
|
||||
//Check signature
|
||||
if(substr($data,0,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) {
|
||||
echo 'Error parsing PNG identifier<br />'; exit;
|
||||
}
|
||||
//Read header chunk
|
||||
if(substr($data,12,4)!='IHDR') {
|
||||
echo 'Incorrect PNG file (no IHDR block found)<br />'; exit;
|
||||
}
|
||||
|
||||
$w=_fourbytes2int(substr($data,16,4));
|
||||
$h=_fourbytes2int(substr($data,20,4));
|
||||
$bpc=ord(substr($data,24,1));
|
||||
$errpng = false;
|
||||
$pngalpha = false;
|
||||
$channels = 0;
|
||||
|
||||
echo 'Width: ' .$w . '<br />';
|
||||
echo 'Height: ' .$h . '<br />';
|
||||
echo 'BPC (bits per channel): ' .$bpc . '<br />';
|
||||
|
||||
$ct=ord(substr($data,25,1));
|
||||
if($ct==0) { $colspace='DeviceGray'; $channels = 1; }
|
||||
elseif($ct==2) { $colspace='DeviceRGB'; $channels = 3; }
|
||||
elseif($ct==3) { $colspace='Indexed'; $channels = 1; }
|
||||
elseif($ct==4) { $colspace='DeviceGray'; $channels = 1; $errpng = 'alpha channel'; $pngalpha = true; }
|
||||
else { $colspace='DeviceRGB'; $channels = 3; $errpng = 'alpha channel'; $pngalpha = true; }
|
||||
|
||||
echo 'Colorspace: ' . $colspace. '<br />';
|
||||
echo 'Channels: ' . $channels. '<br />';
|
||||
if ($pngalpha) echo 'Alpha channel detected'. '<br />';
|
||||
|
||||
if ($ct < 4 && strpos($data,'tRNS')!==false) { echo 'Transparency detected'. '<br />'; $errpng = 'transparency'; $pngalpha = true;}
|
||||
|
||||
if ($ct == 3 && strpos($data,'iCCP')!==false) { echo 'Indexed plus ICC'. '<br />'; $errpng = 'indexed plus ICC'; }
|
||||
|
||||
if(ord(substr($data,26,1))!=0) { echo 'compression method not set to zero<br />'; $errpng = 'compression method'; } // only 0 should be specified
|
||||
if(ord(substr($data,27,1))!=0) { echo 'filter method not set to zero<br />'; $errpng = 'filter method'; } // only 0 should be specified
|
||||
if(ord(substr($data,28,1))!=0) { echo 'interlaced file not set to zero<br />'; $errpng = 'interlaced file'; }
|
||||
|
||||
$j = strpos($data,'pHYs');
|
||||
if ($j) {
|
||||
//Read resolution
|
||||
$unitSp=ord(substr($data,($j+12),1));
|
||||
if ($unitSp == 1) {
|
||||
$ppUx=_fourbytes2int(substr($data,($j+4),4)); // horizontal pixels per meter, usually set to zero
|
||||
$ppUx=round($ppUx/1000 *25.4);
|
||||
}
|
||||
echo 'Resolution ppUx: ' . $ppUx. '<br />';
|
||||
}
|
||||
|
||||
//Gamma correction
|
||||
$gamma_correction = 0;
|
||||
$gAMA = 0;
|
||||
$j = strpos($data,'gAMA');
|
||||
if ($j && strpos($data,'sRGB')===false) { // sRGB colorspace - overrides gAMA
|
||||
$gAMA=_fourbytes2int(substr($data,($j+4),4)); // Gamma value times 100000
|
||||
$gAMA /= 100000;
|
||||
|
||||
}
|
||||
|
||||
if ($gAMA) { $gamma_correction = 1/$gAMA; }
|
||||
|
||||
// Don't need to apply gamma correction if == default i.e. 2.2
|
||||
if ($gamma_correction > 2.15 && $gamma_correction < 2.25) { $gamma_correction = 0; }
|
||||
|
||||
if ($gamma_correction) { echo 'Gamma correction detected'. '<br />'; }
|
||||
|
||||
// NOT supported at present
|
||||
if (strpos($data,'sRGB')!==false) echo 'sRGB colorspace - NOT supported at present'. '<br />';
|
||||
if (strpos($data,'cHRM')!==false) echo 'Chromaticity and Whitepoint - NOT supported at present'. '<br />';
|
||||
|
||||
}
|
||||
|
||||
else { // PNG image with no need to convert alpha channels, bpc <> 8 etc.
|
||||
//Scan chunks looking for palette, transparency and image data
|
||||
$pal='';
|
||||
$trns='';
|
||||
$pngdata='';
|
||||
$icc = false;
|
||||
$p = 33;
|
||||
do {
|
||||
$n=_fourbytes2int(substr($data,$p,4)); $p += 4;
|
||||
$type=substr($data,$p,4); $p += 4;
|
||||
if ($type=='PLTE') {
|
||||
//Read palette
|
||||
$pal=substr($data,$p,$n); $p += $n;
|
||||
$p += 4;
|
||||
}
|
||||
else if($type=='tRNS') {
|
||||
//Read transparency info
|
||||
$t=substr($data,$p,$n); $p += $n;
|
||||
if ($ct==0) $trns=array(ord(substr($t,1,1)));
|
||||
else if ($ct==2) $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));
|
||||
else {
|
||||
$pos=strpos($t,chr(0));
|
||||
if(is_int($pos)) $trns=array($pos);
|
||||
}
|
||||
$p += 4;
|
||||
}
|
||||
else if ($type=='IDAT') {
|
||||
$pngdata.=substr($data,$p,$n); $p += $n;
|
||||
$p += 4;
|
||||
}
|
||||
else if ($type=='iCCP') {
|
||||
$nullsep = strpos(substr($data,$p,80), chr(0));
|
||||
$icc = substr($data, ($p+$nullsep+2), ($n-($nullsep+2)) );
|
||||
// Test if file is gzcompressed
|
||||
if (ord(substr($str, 0, 1)) == 0x1f && ord(substr($str, 1, 1)) == 0x8b) {
|
||||
$icc = @gzuncompress($icc); // Ignored if fails
|
||||
}
|
||||
if ($icc) {
|
||||
echo 'ICC profile present' . '<br />';
|
||||
if (substr($icc, 36, 4) != 'acsp') { echo 'ICC profile INVALID (no acsp flag)' . '<br />'; $icc = false; } // invalid ICC profile
|
||||
else {
|
||||
$input = substr($icc, 16, 4);
|
||||
$output = substr($icc, 20, 4);
|
||||
echo 'ICC profile Input: ' . $input. '<br />';
|
||||
echo 'ICC profile Output: ' . $output. '<br />';
|
||||
// Ignore Color profiles for conversion to other colorspaces e.g. CMYK/Lab
|
||||
if ($input != 'RGB ' || $output != 'XYZ ') { $icc = false; echo 'ICC profile ignored by mPDF' . '<br />'; }
|
||||
}
|
||||
}
|
||||
$p += $n;
|
||||
$p += 4;
|
||||
}
|
||||
|
||||
|
||||
else if($type=='IEND') { break; }
|
||||
else if (preg_match('/[a-zA-Z]{4}/',$type)) { $p += $n+4; }
|
||||
else { echo 'Error parsing PNG image data<br />'; }
|
||||
}
|
||||
while($n);
|
||||
if (!$pngdata) { echo 'Error parsing PNG image data - no IDAT data found<br />';}
|
||||
if ($colspace=='Indexed' && empty($pal)) { echo 'Error parsing PNG image data - missing colour palette<br />'; }
|
||||
echo 'PNG Image parsed directly' . '<br />';
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// GIF
|
||||
else if ($type == 'gif') {
|
||||
}
|
||||
|
||||
// BMP (Windows Bitmap)
|
||||
else if ($type == 'bmp') {
|
||||
}
|
||||
// WMF
|
||||
else if ($type == 'wmf') {
|
||||
}
|
||||
// UNKNOWN TYPE - try GD imagecreatefromstring
|
||||
else {
|
||||
if (function_exists('gd_info')) { $gd = gd_info(); }
|
||||
else {$gd = array(); }
|
||||
if (isset($gd['PNG Support']) && $gd['PNG Support']) {
|
||||
$im = @imagecreatefromstring($data);
|
||||
if ($im) { echo 'Image type not recognised, but image created from file using GD imagecreate' . '<br />'; }
|
||||
else { echo 'Error parsing image file - image type not recognised, and not supported by GD imagecreate' . '<br />'; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
exit;
|
||||
|
||||
//==============================================================
|
||||
|
||||
function _fourbytes2int($s) {
|
||||
//Read a 4-byte integer from string
|
||||
return (ord($s[0])<<24) + (ord($s[1])<<16) + (ord($s[2])<<8) + ord($s[3]);
|
||||
}
|
||||
|
||||
function _twobytes2int($s) { // equivalent to _get_ushort
|
||||
//Read a 2-byte integer from string
|
||||
return (ord(substr($s, 0, 1))<<8) + ord(substr($s, 1, 1));
|
||||
}
|
||||
|
||||
function _jpgHeaderFromString(&$data) {
|
||||
$p = 4;
|
||||
$p += _twobytes2int(substr($data, $p, 2)); // Length of initial marker block
|
||||
$marker = substr($data, $p, 2);
|
||||
while($marker != chr(255).chr(192) && $marker != chr(255).chr(194) && $p<strlen($data)) {
|
||||
// Start of frame marker (FFC0) or (FFC2) mPDF 4.4.004
|
||||
$p += (_twobytes2int(substr($data, $p+2, 2))) + 2; // Length of marker block
|
||||
$marker = substr($data, $p, 2);
|
||||
}
|
||||
if ($marker != chr(255).chr(192) && $marker != chr(255).chr(194)) { return false; }
|
||||
return substr($data, $p+2, 10);
|
||||
}
|
||||
|
||||
function _jpgDataFromHeader($hdr) {
|
||||
$bpc = ord(substr($hdr, 2, 1));
|
||||
if (!$bpc) { $bpc = 8; }
|
||||
$h = _twobytes2int(substr($hdr, 3, 2));
|
||||
$w = _twobytes2int(substr($hdr, 5, 2));
|
||||
$channels = ord(substr($hdr, 7, 1));
|
||||
if ($channels==3) { $colspace='DeviceRGB'; }
|
||||
elseif($channels==4) { $colspace='DeviceCMYK'; }
|
||||
else { $colspace='DeviceGray'; }
|
||||
return array($w, $h, $colspace, $bpc, $channels);
|
||||
}
|
||||
|
||||
function file_get_contents_by_curl($url, &$data) {
|
||||
$timeout = 5;
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_NOBODY, 0);
|
||||
curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , 1 );
|
||||
curl_setopt ( $ch , CURLOPT_CONNECTTIMEOUT , $timeout );
|
||||
$data = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
|
||||
function file_get_contents_by_socket($url, &$data) {
|
||||
// mPDF 5.7.3
|
||||
$timeout = 1;
|
||||
$p = parse_url($url);
|
||||
$file = $p['path'];
|
||||
if ($p['scheme']=='https') {
|
||||
$prefix = 'ssl://';
|
||||
$port = ($p['port'] ? $p['port'] : 443);
|
||||
}
|
||||
else {
|
||||
$prefix = '';
|
||||
$port = ($p['port'] ? $p['port'] : 80);
|
||||
}
|
||||
if ($p['query']) { $file .= '?'.$p['query']; }
|
||||
if(!($fh = @fsockopen($prefix.$p['host'], $port, $errno, $errstr, $timeout))) { return false; }
|
||||
|
||||
$getstring =
|
||||
"GET ".$file." HTTP/1.0 \r\n" .
|
||||
"Host: ".$p['host']." \r\n" .
|
||||
"Connection: close\r\n\r\n";
|
||||
fwrite($fh, $getstring);
|
||||
// Get rid of HTTP header
|
||||
$s = fgets($fh, 1024);
|
||||
if (!$s) { return false; }
|
||||
$httpheader .= $s;
|
||||
while (!feof($fh)) {
|
||||
$s = fgets($fh, 1024);
|
||||
if ( $s == "\r\n" ) { break; }
|
||||
}
|
||||
$data = '';
|
||||
while (!feof($fh)) {
|
||||
$data .= fgets($fh, 1024);
|
||||
}
|
||||
fclose($fh);
|
||||
}
|
||||
|
||||
//==============================================================
|
||||
|
||||
function _imageTypeFromString(&$data) {
|
||||
$type = '';
|
||||
if (substr($data, 6, 4)== 'JFIF' || substr($data, 6, 4)== 'Exif' || substr($data, 0, 2)== chr(255).chr(216)) { // 0xFF 0xD8
|
||||
$type = 'jpeg';
|
||||
}
|
||||
else if (substr($data, 0, 6)== "GIF87a" || substr($data, 0, 6)== "GIF89a") {
|
||||
$type = 'gif';
|
||||
}
|
||||
else if (substr($data, 0, 8)== chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) {
|
||||
$type = 'png';
|
||||
}
|
||||
/*-- IMAGES-WMF --*/
|
||||
else if (substr($data, 0, 4)== chr(215).chr(205).chr(198).chr(154)) {
|
||||
$type = 'wmf';
|
||||
}
|
||||
/*-- END IMAGES-WMF --*/
|
||||
else if (preg_match('/<svg.*<\/svg>/is',$data)) {
|
||||
$type = 'svg';
|
||||
}
|
||||
// BMP images
|
||||
else if (substr($data, 0, 2)== "BM") {
|
||||
$type = 'bmp';
|
||||
}
|
||||
return $type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
29
system/vendors/mpdf/utils/index.php
vendored
Normal file
29
system/vendors/mpdf/utils/index.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body bgcolor=#FFFFFF text=#001C66>
|
||||
|
||||
<h2>mPDF Font Utility scripts for Version 5.0</h2>
|
||||
<p>
|
||||
<a href="font_dump.php">Dump all characters from a font (font_dump.php)</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="font_names.php">Show a list of all font names available (font_names.php)</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="font_collections.php">Show fonts in Collections .ttc (font_collections.php)</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="font_coverage.php">Show coverage of characters from all fonts (font_coverage.php)</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="font_dump_OTL.php">Show OTL features from a font (font_dump_OTL.php)</a>
|
||||
</p>
|
||||
|
||||
<p>Edit the scripts to change the font folder if you wish - this is set by default to /ttfonts/</p>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user