[Tux4kids-commits] r656 - in tuxtype/trunk: data/themes/malayalam src

sreyas-guest at alioth.debian.org sreyas-guest at alioth.debian.org
Tue Aug 19 08:16:56 UTC 2008


Author: sreyas-guest
Date: 2008-08-19 08:16:56 +0000 (Tue, 19 Aug 2008)
New Revision: 656

Modified:
   tuxtype/trunk/data/themes/malayalam/keyboard.lst
   tuxtype/trunk/src/alphabet.c
   tuxtype/trunk/src/practice.c
Log:
Bug in practice fixed

Modified: tuxtype/trunk/data/themes/malayalam/keyboard.lst
===================================================================
--- tuxtype/trunk/data/themes/malayalam/keyboard.lst	2008-08-19 07:52:53 UTC (rev 655)
+++ tuxtype/trunk/data/themes/malayalam/keyboard.lst	2008-08-19 08:16:56 UTC (rev 656)
@@ -1,3 +1,37 @@
+0|ൊ|`
+0|ൌ|q
+0|ോ|a
+0|െ|z
+0|ഒ|~
+0|ഔ
+0|ഓ|A
+0|എ|Z
+1|ൈ|w
+1|േ|s
+1|ം|x
+1|ഐ|W
+1|ഏ|S
+2|ാ|e
+2|്|d
+2|മ|c
+3|ആ|E
+2|അ|D
+2|ണ|C
+3|ീ|r
+3|ി|f
+3|ന|v
+3|ഈ|R
+3|ഇ|F
+4|ൂ|t
+4|ു|g
+4|വ|b
+4|ഊ|T
+4|ഉ|G
+4|ഴ|B
+5|ബ|y
+5|പ|h
+5|ല|n
+5|ഭ|Y
 5|ഫ|H
 5|ള|N
 6|ഹ|u

Modified: tuxtype/trunk/src/alphabet.c
===================================================================
--- tuxtype/trunk/src/alphabet.c	2008-08-19 07:52:53 UTC (rev 655)
+++ tuxtype/trunk/src/alphabet.c	2008-08-19 08:16:56 UTC (rev 656)
@@ -289,7 +289,7 @@
 
   if (i == MAX_UNICODES)
   {
-    fprintf(stderr, "GeteKeypress() - Unicode char '%C' not found in list.\n", uni_char);
+    fprintf(stderr, "GetIndex - Unicode char '%C' not found in list.\n", uni_char);
     return -1;
   }
 

Modified: tuxtype/trunk/src/practice.c
===================================================================
--- tuxtype/trunk/src/practice.c	2008-08-19 07:52:53 UTC (rev 655)
+++ tuxtype/trunk/src/practice.c	2008-08-19 08:16:56 UTC (rev 656)
@@ -669,60 +669,10 @@
     wcsncpy(phrase[0], phr, 80);
   }
 
-  /* FIXME maybe should verify that all chars in phrase are 
-//   /* Need to generate glyphs for all the needed Unicode chars: */
-// 
-//   ResetCharList();
-//   /* 'A' (i.e. 65) always has to go into list because width used for layout */
-//   /* HACK also need chars for "Great!" because of congrats message - this   */
-//   /* obviously is not a general solution. Numerals also needed for timers.  */
-//   {
-//     char* let = "AGreat!0123456789.";
-//     GenCharListFromString(let);
-//   }
-// 
-// 
-//   /* Scan through all the phrases and put needed chars into list: */
-//   for (c = 0; c <= pc; c++)
-//     GenCharListFromString(phrase[c]);
-// 
-//   /* Now render letters for glyphs in list: */
-//   font = LoadFont(settings.theme_font_name, 32 );
-//   if (!font)
-//   {
-//     fprintf(stderr, "get_phrase() - could not load font\n");
-//     return 0;
-//   }
-// 
-//   RenderLetters(font);
-// 
-//   TTF_CloseFont(font);
-//   font = NULL;
-
-
-  //Calculate and record pixel width of phrases
-  {
-    SDL_Surface* let = NULL;
-    for (c = 0; c <= pc; c++)
-    {
-      for(i = 0; i < wcslen(phrase[c]); i++)
-      {
-        let = GetWhiteGlyph((int)phrase[c][i]);
-        if (let)  
-          pw[c]+= let->w - 5;
-        else
-        {
-          fprintf(stderr, "get_phrase() - needed glyph not available\n");
-          return;
-        }
-      }
-    }
-  }
-
   //Find wrapping point
   for (c = 0; c <= pc; c++)
   {
-    if (pw[c] < 598)  // If the phrase is less than 598 pixels wide
+    if (pw[c] < 50)  // If the phrase is less than 598 pixels wide
     {
       if (c == 0)
       {
@@ -738,8 +688,8 @@
       for (i = 0; i < wcslen(phrase[c]); i++)
       {
         /* Should be safe (if no glyph, will have returned above) */
-        z += GetWhiteGlyph((int)phrase[c][i])->w-5;
-        if (wp == 0 && z > 598)
+        z ++;
+        if (wp == 0 && z > 50)
         {
           wp = i - 1;
           break;




More information about the Tux4kids-commits mailing list