- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / include / inc_ttf_tr2uni.php
blob9603b52258f83b61e94058047563776e7fdf9331
1 <?php
2 #====================================================================================================#
3 # tr2uni v0.1 (Turkish-iso8859-9 encoder to Unicode) #
4 #==================================================================================================== #
5 # Information: #
6 # This is PHP function for covert Turkish encoding string to #
7 # unicode that can use to show Turkish charactor in function ImageTTFText(). #
8 # It Tested and worked with Multilanguage arial.ttf V2.98 #
9 # #
10 # #
11 # Bug Report and Suggestion to: #
12 # Bulent Potur #
13 # bpotur@gmail.com #
14 # #
15 #==================================================================================================== #
16 # Example: #
17 # include_once($root_path.'inc_ttf_tr2uni.php'); #
18 # ImageTTFText ($image, 8, 0, 3, 15, $white, "arial.ttf",tr2uni("$Turkishstring")); #
19 #====================================================================================================#
20 # Version History: #
21 # version 0.1 : First release for Arabic. created on ( 22/01/2004) By Walid Fathalla #
22 # version 0.1.1: First release for Turkish created on ( 01/11/2005) By Bulent Potur #
23 # For Arabic Website: If you thing this module useful to you, please send to #
24 # me back to my email fathalla_w@hotmail.com. #
25 # #
26 #====================================================================================================# #================================================// Turkish character maps//=============================================
27 $tr2unimap = array( // One bit character isolated form
28 '1' => "&#0049;", '2' => "&#0050;", '3' => "&#0051;", '4' => "&#0052;", '5' => "&#0053;", '6' => "&#0054;", '7' => "&#0055;",
29 '8' => "&#0056;", '9' => "&#0057;", '0' => "&#0048;", '/' => "&#0047;", '+' => "&#0043;", '-' => "&#0045;", '?' => "&#0063;",
30 ',' => "&#0044;", '.' => "&#0046;", '?' => "&#0063;", 'A' => "&#0065;", 'B' => "&#0066;", 'C' => "&#0067;", 'Ç' => "&#0199;",
31 'D' => "&#0068;", 'E' => "&#0069;", 'F' => "&#0070;", 'G' => "&#0071;", 'Ð' => "&#0286;", 'H' => "&#0072;", 'I' => "&#0073;",
32 'Ý' => "&#0304;", 'J' => "&#0074;", 'K' => "&#0075;", 'L' => "&#0076;", 'M' => "&#0077;", 'N' => "&#0078;", 'O' => "&#0079;",
33 'Ö' => "&#0214;", 'P' => "&#0080;", 'R' => "&#0082;", 'S' => "&#0083;", 'Þ' => "&#0350;", 'T' => "&#0084;", 'U' => "&#0085;",
34 'Ü' => "&#0220;", 'V' => "&#0086;", 'Y' => "&#0089;", 'Z' => "&#0090;", 'a' => "&#0097;", 'b' => "&#0098;", 'c' => "&#0099;",
35 'ç' => "&#0231;", 'd' => "&#0100;", 'e' => "&#0101;", 'f' => "&#0102;", 'g' => "&#0103;", 'ð' => "&#00287;", 'h' => "&#0104;",
36 'ý' => "&#0305;", 'i' => "&#0105;", 'j' => "&#0106;", 'k' => "&#0107;", 'l' => "&#0108;", 'm' => "&#0109;", 'n' => "&#0110;",
37 'o' => "&#0111;", 'ö' => "&#0246;", 'p' => "&#0112;", 'r' => "&#0114;", 's' => "&#0115;", 'þ' => "&#0351;", 't' => "&#0116;",
38 'u' => "&#0117;", 'ü' => "&#0252;", 'v' => "&#0118;", 'y' => "&#0121;", 'z' => "&#0122;", '$' => "&#00287;", 'Q' => "&#0081;",
39 'â' => "&#0305;", 'w' => "&#0119;", 'W' => "&#0089;", 'x' => "&#0120;", 'X' => "&#0088;", 'q' => "&#0113;", ' ' => "&#0032;");
41 #================================================// end of character maps//=============================================
43 function tr2uni($sti){
44 global $tr2unimap;
47 # Patch by Elpidio 2004-02-06
49 if(strstr($sti,'&#')&&strstr($sti,';')){
50 $buf=explode(';',$sti);
52 # Remove the first element which is empty
54 $sti=implode(';',$buf);
55 return ($sti).';';
56 }else{
58 $sti .= " ";
59 #$temp = $sti;
60 #$sti = strrev($temp);
61 #$sti = ($sti) + " "
62 $temp = $sti;
63 #$sti = strrev($temp);
64 $sti .= " ";
65 $sto=' ';
66 $len=strlen($sti);
68 for ($i=0; $i < $len; $i++){
70 #=========================// for one bit character have 1 form//================
71 $sto .=$tr2unimap[$sti{$i}];
73 return $sto;