Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. <html>
  2.  
  3. <head>
  4.         <meta charset="utf-8">
  5.         <title>Heliothryx Localization Tool: Text Converter</title>
  6.  
  7.         <script type="text/javascript">
  8.  
  9.         /*
  10.  
  11.         Russian (Cyrilic) match:
  12.  
  13.         Б b
  14.         Г g
  15.         Д d
  16.         Ж j
  17.         З o
  18.         И i
  19.         Й ^
  20.         Л l
  21.         П n
  22.         Ф f
  23.         Ц c
  24.         Ч - (4)
  25.         Ш h
  26.         Щ m
  27.         Ъ [
  28.         Ы \\
  29.         Ь ]
  30.         Э e
  31.         Ю k
  32.         Я a
  33.  
  34.         */
  35.  
  36.                 function convert() {
  37.        
  38.                         ar = new Array;
  39.                
  40.                         ar["A"] = "A";
  41.                         ar["B"] = "B";
  42.                         ar["C"] = "C";
  43.                         ar["D"] = "D";
  44.                         ar["E"] = "E";
  45.                         ar["F"] = "F";
  46.                         ar["G"] = "G";
  47.                         ar["H"] = "H";
  48.                         ar["I"] = "I";
  49.                         ar["J"] = "J";
  50.                         ar["K"] = "K";
  51.                         ar["L"] = "L";
  52.                         ar["M"] = "M";
  53.                         ar["N"] = "N";
  54.                         ar["O"] = "0";
  55.                         ar["P"] = "P";
  56.                         ar["Q"] = "Q";
  57.                         ar["R"] = "R";
  58.                         ar["S"] = "5";
  59.                         ar["T"] = "T";
  60.                         ar["U"] = "U";
  61.                         ar["V"] = "V";
  62.                         ar["W"] = "W";
  63.                         ar["X"] = "X";
  64.                         ar["Y"] = "Y";
  65.                         ar["Z"] = "Z";
  66.                
  67.                         ar[" "] = " ";
  68.  
  69.                         ar["0"] = "0";
  70.                         ar["1"] = "1";
  71.                         ar["2"] = "2";
  72.                         ar["3"] = "3";
  73.                         ar["4"] = "4";
  74.                         ar["5"] = "5";
  75.                         ar["6"] = "6";
  76.                         ar["7"] = "7";
  77.                         ar["8"] = "8";
  78.                         ar["9"] = "9";
  79.  
  80.                         ar[":"] = ":";
  81.                         ar[";"] = ";";
  82.                         ar["<"] = "<";
  83.                         ar["-"] = "=";
  84.                         ar[">"] = ">";
  85.                         ar["?"] = "?";
  86.                         ar["/"] = "@";
  87.                         ar["_"] = "_"; // comma (,)
  88.                         ar["`"] = "`"; // dot (.)
  89.                
  90.                
  91.  
  92.                         // CYRILIC             
  93.                         ar["А"] = "A";
  94.                         ar["Б"] = "b";
  95.                         ar["В"] = "B";
  96.                         ar["Г"] = "g";
  97.                         ar["Д"] = "d";
  98.                         ar["Е"] = "E";
  99.                         ar["Ё"] = "E";
  100.                         ar["Ж"] = "j";
  101.                         ar["З"] = "3";
  102.                         ar["И"] = "i";
  103.                         ar["Й"] = "^";
  104.                         ar["К"] = "K";
  105.                         ar["Л"] = "l";
  106.                         ar["М"] = "M";
  107.                         ar["Н"] = "H";
  108.                         ar["О"] = "0";
  109.                         ar["П"] = "n";
  110.                         ar["Р"] = "P";
  111.                         ar["С"] = "C";
  112.                         ar["Т"] = "T";
  113.                         ar["У"] = "Y";
  114.                         ar["Ф"] = "f";
  115.                         ar["Х"] = "X";
  116.                         ar["Ц"] = "c";
  117.                         ar["Ч"] = "4";
  118.                         ar["Ш"] = "h";
  119.                         ar["Щ"] = "m";
  120.                         ar["Ъ"] = "[";
  121.                         ar["Ы"] = "\\\\";
  122.                         ar["Ь"] = "]";
  123.                         ar["Э"] = "e";
  124.                         ar["Ю"] = "k";
  125.                         ar["Я"] = "a";
  126.                
  127.                         ar["("] = "<";
  128.                         ar[")"] = ">";
  129.                         ar[","] = "_";
  130.                         ar["."] = "`";
  131.                
  132.                
  133.                         s = document.getElementById("inp").value;
  134.                
  135.                         s = s.toUpperCase();
  136.                
  137.                         s2 = '';
  138.                         error = '';
  139.                
  140.                         for (i in s) {
  141.                                 if (ar[s[i]] != undefined) {
  142.                                         s2 += ar[s[i]];
  143.                                 }
  144.                                 else {
  145.                                         s2 += "`";
  146.                                         error = 1;
  147.                                 };
  148.                         };
  149.                
  150.                         document.getElementById("outp").value = s2;
  151.                
  152.                         document.getElementById("outp2").innerHTML = error ? '(disallowed symbols has been replaced with dot)' : '';
  153.        
  154.        
  155.                 };
  156.  
  157.         </script>
  158.  
  159. </head>
  160.  
  161. <body>
  162.  
  163. <h1>Heliothryx Localization Tool: Text Converter</h1>
  164.  
  165. <img align="right" src="font.png" style="margin-right: 1em; margin-bottom: 1em;">
  166.  
  167.  
  168. <p>This is procedural font. To minimize program size, only necessary characters are implemented:</p>
  169.  
  170. <p>
  171. <ul>
  172.         <li>Numbers;</li>
  173.         <li>Latin characters from A to Z;</li>
  174.         <li>Cyrilic (Russian) characters which can't be replaced by matching Latin characters or numeric symbols;</li>
  175.         <li>Some punctuation.</li>
  176. </ul>
  177. </p>
  178.  
  179. <p>Actually this is part of ASCII table starting from '0' (0x30). </p>
  180.  
  181. <p>Note that not all latin characters are in fact implemented, for example, 'S' can be successfully replaced by number 5, so other symbol are placed in place of 'S'. Some punctuation symbols are also replaced, for example, dot (.) in ASCII table have 0x2E code which is outside our range, so it is implemented in place of useless grave accent symbol (`). </p>
  182.  
  183. <p>To make process of writing string constants easier, this tool has been made. Write any text to first field, hit Enter and take string that you can use in your code. If you try to use unsupported characters, they will be replaced by dot and you will get warning. </p>
  184.  
  185.  
  186. <div style="clear: both;">&nbsp;</div>
  187.  
  188. <form>
  189.  
  190.         <div style="border: 1px solid #99CCAA; padding: 8px; background-color: #CCFFDD; display: table;">
  191.                 <input size=40 id="inp"> <input type="submit" value="Convert (Enter)" onclick="convert(); return false;"> <br>
  192.                 <input size=40 id="outp"> <span style="color: red; font-weight: bold;" id="outp2"></span>
  193.         </div>
  194.  
  195. </form>
  196.  
  197. <small>Developed by: Roman Shuvalov</small>
  198.  
  199. </body>
  200.  
  201. </html>
  202.