# (BGE) How to have a random font for each character in a text object?

I have made three similar, handwritten fonts. I'm trying to figure out a script (assuming this requires scripting) which would not only turn the player's input string into the text object's text - I already have this part - but also randomly select a different font for each character of the string in real time, so that it looks like handwriting, with convincing human errors/variations. But I just don't know what to do, or if it's possible. Help!

You have to add a separate text object for every character of your string.

Put a text object for every font you have on another layer, add a text game property to all of them and name them something meaningful. Then add an empty to the point where you want the text to start. The letters will be spawned there. Lastly execute this script:

import bge
import random

scene = bge.logic.getCurrentScene()
string = "string"
fontList = ["font1", "font2", "font3"]
empty = scene.objects["Empty"]

for character in string:
font = fontList[random.randint(0,2)]