One way you can do it is by calculating all the letter widths at the start of the game.
To calculate each letter, you'll have to have a text object with a width of 0, and set the text to a letter. Then have a loop that increases the width by one pixel until the text.textheight value decreases, then use the current width for the width of that letter (store it in an array or dictionary).
Do this for each letter or character.
the textheight is the height of the text, so if one line is 20 pixels high, then two lines of text is 40, etc.. So when you have the width of the text object smaller than a letter width, it will cause it to jump to the second line.. So when you increase the width it eventually as room to place the letter on the first line.
Also at the beginning, the textheight will be 0, so it will jump to 40, then 20 for example.. You'd stop adjusting the width when that value decreases.
I think it might pad the letters by a pixel, so you might have to remove 2 or 3 from the found width.. There might be other things to keep in mind too, but this might be a good start point.