/* Returns the width in pixels of a string when it is rendered. 
This method can be used to determine whether a string will fit inside a specific area, or if it needs to be broken up into multiple lines to be properly rendered on the screen. */
uint16_t aafontsGetStringWidth(const aafontsFont_t *font, char *str)
/* Returns the width in pixels of a string when it is rendered. 
This method can be used to determine whether a string will fit inside a specific area, or if it needs to be broken up into multiple lines to be properly rendered on the screen. */
uint16_t aafontsGetStringWidth(const aafontsFont_t *font, char *str)
{
  uint16_t width = 0;
  const aafontsCharInfo_t *charInfo;
  uint32_t currChar;
  for (currChar = *str; currChar; currChar = *(++str))
  {
    if ((currChar > font->lastChar) || (currChar < font->firstChar))
    {
      width += font->unknownCharWidth;
    }
    else
    {
      charInfo = &(font->charTable[currChar - font->firstChar]);
      width += charInfo->width;
    }
  }
  return width;
}