I'll have to see if I can adapt it for use with text rather than just numbers, but here's a set of functions someone wrote for me to let me use 3x5 number sprites rather than regular text for keeping score:
# Prints numbers to scoreboard
def PrintNumber(number,totalDigits,x,y):
scoreString=str(number)
digits=len(scoreString)
xPos=x
yPos=y
zerosToAdd=totalDigits-digits
for i in range(totalDigits):
if i < zerosToAdd:
PrintDigit(0,xPos,yPos)
else:
PrintDigit(int(scoreString[i-zerosToAdd]),xPos,yPos)
xPos += 4
# Locates sprite data for numbers
def PrintDigit(num,x,y):
thumby.display.blit(n[num],x,y,3,5)
Perhaps it wouldn't run as well if it had to sort through letters in addition to numbers, but it seems to work well for keeping score, at the very least.