   Why does this font application not work?
  Hello everyone, I was working on a font application to put into a rpg engine, and I can't seem to get it to work. All of the logic seems right, but it doesn't want to come out good.I have a self drawn font, that has 64 total characters in it.I have an array storing where all the characters should  be in that texture.char characters[64] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',   'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',   'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',   'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',   'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',   'o', 'p', 'q', 'r', 's', 't', 'u', 'v',   'w', 'x', 'y', 'z', '.', ',', '/', '\\',   '"', '(', ')', ':', ';', '&', '?', '!'};And then I have my function turning a string into graphics.void StringPrint(char* str){    int stringLength = strlen(str);    int fxpos, fypos;    float xout = -1.0;    for(int loop=0; loop < stringLength; loop--)    {   for(int index = 0; index < 64; index++)   {  fxpos++;  if(index%8 == 0)  { fxpos = 0; fypos++;  }  if(str[0] == characters[index]) break;   }   glTexCoord2f(fxpos / 100, fypos / 100); glVertex2f(xout, 0.0);   glTexCoord2f((fxpos + 1) / 100, fypos / 100); glVertex2f(xout + (1/64), 0.0);   glTexCoord2f((fxpos + 1) / 100, (fypos + 1) / 100); glVertex2f(xout + (1/64), 1/64);   glTexCoord2f(fxpos / 100, (fypos + 1) / 100); glVertex2f(xout, 1 / 64);    }}It looks fine to me, and when I wrote it I thought I was brilliant. That maybe not the case, but can someone help me point out what I've done wrong?Thanks.   
thirst thing:loop-- should be loop++if(str(0)...   should be if(str(loop)...I dont want to be rude but delete the hole code and rewrite/RETHINK itbecause its verry bugy and the "for(index..." loop is just nonsense - mostthe mathematics.Dont be angry, i think you just start to learn, right? If you need some helpsend me a message. Could write a example for you. My eMail: karadok@one.lt[Edited by - Karadok on June 21, 2006 3:44:08 AM];for starters loop should be <= string length so you read the whole string , or simply < string length+1 , which ever you choose.again index <= 64."if(str[0] == characters[index])" here it is , this should be "if(str[loop] == characters[index])", cuase this way your always checking the first letter. loop should be ++ not --.   ;  another flaw is the way you calcualte the size of a char , if you don't make a precise calcualtionof thier sizes or at least you scaling or clipping , you will find the letters jumping on each other and it really wouldn't be pretty.a font engine should use binary flags to represent letters , i know that's a little bit out of your reach , but if your not ready to live up to the standard, you are better off using somebody's else font engine.   ;  The mathematics are completly wrong and thei are in the FOR loop that costs time!CodeConfusion: You are wrong about the loop<=Strlength. The first characteris at position zero! It would read one more position - the zero termination ofthe string. It would be one more cicle for nothing. Better is 'loop<Strlenth' and after the "for(int loop=..."  loop  "fypos+=something;  fxpos=0;" ! Sorry, but this code is a mess at all! Delete and write a new one.The hole funktion is unlogik and doesn`t work.   