Esperanto version how to generate special Esperanto chars

posted Feb 21, 2009, 5:53 AM by Salahzar Stenvaag   [ updated Feb 21, 2009, 6:22 AM ]
Made a texture for esperanto chars.



Pythonfu is modified as follows:


def python_xytext(font,color,size,limit):
  """Print the arguments on standard output"""
  python_log_init()
  python_log("font: %s color: <%d,%d,%d> size: %d limit: %d" % ( font, color[0], color[1], color[2], size, limit ))
  chars = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~     "
 
 
  decode=  ["\xC3\x87", "\xC3\xBC", "\xC3\xA9", "\xC3\xA2", "\xC3\xA4", "\xC3\xA0", "\xC3\xA5", "\xC3\xA7", "\xC3\xAA", "\xC3\xAB" ] 
  decode+=["\xC3\xA8", "\xC3\xAF", "\xC3\xAE", "\xC3\xAC", "\xC3\x84", "\xC3\x85", "\xC3\x89", "\xC3\xA6", "\xC3\xAE", "\xE2\x96\xB6" ]
  decode+=["\xC3\xB6", "\xC3\xB2", "\xC3\xBB", "\xC3\xB9", "\xC3\xBF", "\xC3\x96", "\xC3\x9C", "\xC2\xA2", "\xC2\xA3", "\xC2\xA5"]
  decode+=["\xC3\x82", "\xC2\xA9", "\xC3\xA1", "\xC3\xAD", "\xC3\xB3", "\xC3\xBA", "\xC3\xB1", "\xC3\x91", "\xC2\xAA", "\xC2\xBA"]
  decode+=["\xC2\xBF", "\xC3\x94", "\xC2\xAC", "\xC2\xBD", "\xC2\xBC", "\xC2\xA1", "\xC2\xAB", "\xC2\xBB", "\xCE\xB1", "\xC3\x9F"]
  decode+=["\xCE\x93", "\xCF\x80", "\xCE\xA3", "\xCF\x83", "\xC2\xB5", "\xCF\x84", "\xCE\xA6", "\xCE\x98", "\xCE\xA9", "\xCE\xB4"]
  decode+=["\xC5\xAC", "\xC5\xAD", "\xCE\xB5", "\xE2\x88\xA9", "\xE2\x89\xA1", "\xC2\xB1", "\xE2\x89\xA5", "\xE2\x89\xA4", "\xE2\x8C\xA0",

"\xE2\x8C\xA1"]
  
  decode+=["\xC4\x88", "\xC4\x89", "\xC4\x9C", "\xC4\x9D", "\xC4\xA4", "\xC4\xA5", "\xC4\xB4", "\xC4\xB5", "\xC5\x9C", "\xC5\x9D" ];
 


lsl Script  modified as follows: (note I start with XyText 1.2 version (http://www.lslwiki.net/lslwiki/wakka.php?wakka=LibraryXyText12)

key gFontTexture="1f490434-2c70-d56e-97a7-52c613a0c814"; // Esperanto font (italic)

....

ResetCharIndex() { ’

     gCharIndex  = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`";
     gCharIndex += "abcdefghijklmnopqrstuvwxyz{|}~\n\n\n\n\n";

     // special UTF-8 chars for European languages
     // these 80 chars correspond to the following chars in CP850 codepage: (some are not viewable in editor)
    
     //           Ç          ü         é         â         ä         à        å         ç          ê        ë
     decode= [ "%C3%87", "%C3%BC", "%C3%A9", "%C3%A2", "%C3%A4", "%C3%A0", "%C3%A5", "%C3%A7", "%C3%AA", "%C3%AB",
     //           è         ï          î         ì         Ä         Å         É         æ         Æ    BLACK RIGHT-POINTING TRIANGLE
               "%C3%A8", "%C3%AF", "%C3%AE", "%C3%AC", "%C3%84", "%C3%85", "%C3%89", "%C3%A6", "%C3%AE", "%E2%96%B6",
     //           ö         ò          û         ù         ÿ         Ö         Ü         ¢         £         ¥
               "%C3%B6", "%C3%B2", "%C3%BB", "%C3%B9", "%C3%BF", "%C3%96", "%C3%9C", "%C2%A2", "%C2%A3", "%C2%A5",
     //           A^    copyright     á         í         ó         ú         ñ         Ñ         ª          º"
               "%C3%82", "%C2%A9", "%C3%A1", "%C3%AD", "%C3%B3", "%C3%BA", "%C3%B1", "%C3%91", "%C2%AA", "%C2%BA",
     //            ¿        O^         ¬        ½         ¼          ¡         «        »       alfa          ß"
               "%C2%BF", "%C3%94", "%C2%AC", "%C2%BD", "%C2%BC", "%C2%A1", "%C2%AB", "%C2%BB", "%CE%B1", "%C3%9F",
     //           gamma      pi      bigsigma  smsigma    mu  
               "%CE%93", "%CF%80", "%CE%A3", "%CF%83", "%C2%B5" ];
              
     //                              tau       BIGfi      theta       omega   delta  
     decode=(decode=[])+decode+ [ "%CF%84", "%CE%A6", "%CE%98", "%CE%A9", "%CE%B4",
     //         Uu          uu       EPS         INTERS        3bars        +-         <=           >=        INTEGRUP   INTEGRDOWN
               "%C5%AC", "%C5%AD", "%CE%B5", "%E2%88%A9", "%E2%89%A1", "%C2%B1", "%E2%89%A5", "%E2%89%A4", "%E2%8C%A0", "%E2%8C%A1",
     //           C^        c^        G^         g^       H^         h^        J^        j^       S^        s^
               "%C4%88", "%C4%89", "%C4%9C", "%C4%9D", "%C4%A4", "%C4%A5", "%C4%B4", "%C4%B5", "%C5%9C", "%C5%9D" ];
 
    
}

vector GetGridOffset(integer index) {
   // Calculate the offset needed to display this character.
   integer Row = index / 10 - 1;
   integer Col = index % 10;

   // Return the offset in the texture.
   //return <-0.45 + 0.1 * Col, 0.45 - 0.1 * Row, 0.0>;

   return <-0.445 + 0.1 * Col, 0.418 - 0.05 * Row, 0.0>;
}


ShowChars(vector grid_offset1, vector grid_offset2, vector grid_offset3, vector grid_offset4, vector grid_offset5) {
   // Set the primitive textures directly.
  
   // <-0.256, 0, 0>
   // <0, 0, 0>
   // <0.130, 0, 0>
   // <0, 0, 0>
   // <-0.74, 0, 0>
  
     llSetPrimitiveParams( [
        PRIM_TEXTURE, FACE_1, (string)gFontTexture, <0.15, 0.05, 0>, grid_offset1 + <0.037, 0, 0>, 0.0,
        PRIM_TEXTURE, FACE_2, (string)gFontTexture, <0.06, 0.05, 0>, grid_offset2, 0.0,
        PRIM_TEXTURE, FACE_3, (string)gFontTexture, <-0.84, 0.05, 0>, grid_offset3 - <0.275, 0, 0>, 0.0,
        PRIM_TEXTURE, FACE_4, (string)gFontTexture, <0.06, 0.05, 0>, grid_offset4, 0.0,
        PRIM_TEXTURE, FACE_5, (string)gFontTexture, <0.15, 0.05, 0>, grid_offset5 - <0.037, 0, 0>, 0.0
        ]);

}

Comments