forked from phpclicks/mpdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_cp.php
153 lines (134 loc) · 3.76 KB
/
config_cp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
function GetLangOpts($llcc, $adobeCJK) {
if (strlen($llcc) == 5) {
$lang = substr(strtolower($llcc),0,2);
$country = substr(strtoupper($llcc),3,2);
}
else { $lang = strtolower($llcc); $country = ''; }
$unifonts = "";
$coreSuitable = false;
switch($lang){
CASE "en":
CASE "ca":
CASE "cy":
CASE "da":
CASE "de":
CASE "es":
CASE "eu":
CASE "fr":
CASE "ga":
CASE "fi":
CASE "is":
CASE "it":
CASE "nl":
CASE "no":
CASE "pt":
CASE "sv":
// Edit this value to define how mPDF behaves when using new mPDF('-x')
// If set to TRUE, mPDF will use Adobe core fonts only when it recognises the languages above
$coreSuitable = true; break;
// RTL Languages
CASE "he":
CASE "yi":
$unifonts = "dejavusans,dejavusansB,dejavusansI,dejavusansBI"; break;
// Arabic
CASE "ar":
$unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
CASE "fa":
$unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
CASE "ps":
$unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
CASE "ur":
$unifonts = "xbriyaz,xbriyazB,xbriyazI,xbriyazBI,xbzar,xbzarB,xbzarI,xbzarBI"; break;
// Sindhi (can be Arabic or Devanagari)
CASE "sd":
if ($country == "IN") { $unifonts = "ind_hi_1_001"; }
// else if ($country == "PK") { $unifonts = ""; }
// else { $unifonts = ""; }
break;
// INDIC
// Assamese
CASE "as": $unifonts = "ind_bn_1_001"; break;
// Bengali
CASE "bn": $unifonts = "ind_bn_1_001"; break;
// Gujarati
CASE "gu": $unifonts = "ind_gu_1_001"; break;
// Hindi (Devanagari)
CASE "hi": $unifonts = "ind_hi_1_001"; break;
// Kannada
CASE "kn": $unifonts = "ind_kn_1_001"; break;
// Kashmiri
CASE "ks": $unifonts = "ind_hi_1_001"; break;
// Malayalam
CASE "ml": $unifonts = "ind_ml_1_001"; break;
// Nepali (Devanagari)
CASE "ne": $unifonts = "ind_hi_1_001"; break;
// Oriya
CASE "or": $unifonts = "ind_or_1_001"; break;
// Punjabi (Gurmukhi)
CASE "pa": $unifonts = "ind_pa_1_001"; break;
// Tamil
CASE "ta": $unifonts = "ind_ta_1_001"; break;
// Telegu
CASE "te": $unifonts = "ind_te_1_001"; break;
// THAI
CASE "th": $unifonts = "garuda,garudaB,garudaI,garudaBI,norasi,norasiB,norasiI,norasiBI"; break;
// VIETNAMESE
CASE "vi":
$unifonts = "dejavusanscondensed,dejavusanscondensedB,dejavusanscondensedI,dejavusanscondensedBI,dejavusans,dejavusansB,dejavusansI,dejavusansBI"; break;
// CJK Langauges
CASE "ja":
if ($adobeCJK) {
$unifonts = "sjis,sjisB,sjisI,sjisBI";
}
/* Uncomment these lines if CJK fonts available */
// else {
// $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
// }
break;
CASE "ko":
if ($adobeCJK) {
$unifonts = "uhc,uhcB,uhcI,uhcBI";
}
/* Uncomment these lines if CJK fonts available */
// else {
// $unifonts = "unbatang_0613";
// }
break;
CASE "zh":
if ($country == "HK" || $country == "TW") {
if ($adobeCJK) {
$unifonts = "big5,big5B,big5I,big5BI";
}
/* Uncomment these lines if CJK fonts available */
// else {
// $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
// }
}
else if ($country == "CN") {
if ($adobeCJK) {
$unifonts = "gb,gbB,gbI,gbBI";
}
/* Uncomment these lines if CJK fonts available */
// else {
// $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
// }
}
else {
if ($adobeCJK) {
$unifonts = "gb,gbB,gbI,gbBI";
}
/* Uncomment these lines if CJK fonts available */
// else {
// $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
// }
}
break;
}
$unifonts_arr = array();
if ($unifonts) {
$unifonts_arr = preg_split('/\s*,\s*/',$unifonts);
}
return array($coreSuitable ,$unifonts_arr);
}
?>