Glimmr Drawing Commands

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Resources


    Section - Calculating the rendered length of a string

    To decide what number is the length of (STR - indexed text) set in (TYPF - a font):
        let len be 0;
        repeat with N running from 1 to the number of characters in STR:
            let V be the character code of position N of STR;
            if there is a char of V in the font table of TYPF:
                choose row with a char of V in the font table of TYPF;
            otherwise:
                choose row with a char of 32 in the font table of TYPF;
            increase len by the advance entry;
        decide on len.