I think you need to measure he distance to the camera. Be aware this does work for a single point of the object only due to the perspective distortion. Faces nearer to the camera appear larger than faces of the same size more far away from the camera.
Here is a script that calculates the scale dependent on the distance to the camera. The scale when running the script the first time will be preserved. The Python controller needs to be triggered at each single frame, where the distance to the camera changes. If you are unsure us Always Sensor with True Level Triggering.
The controller applies to the object that should be scaled (your text object).
import bge
owner = bge.logic.getCurrentController().owner
camera = owner.scene.active_camera
distance = owner.getDistanceTo(camera)
try:
originalDistance = owner["originalDistance"]
originalScale = owner["scale"]
owner.localScale = originalScale * distance/originalDistance
except KeyError:
owner["scale"] = owner.localScale.copy()
owner["originalDistance"] = distance
here is a short version by reducing the formulas to the minimum. It might be a bit harder to understand. Basically originalScale/originalDistance is constant and calculated just once.
import bge
owner = bge.logic.getCurrentController().owner
camera = owner.scene.active_camera
distance = owner.getDistanceTo(camera)
try:
owner.localScale = owner["normalizedScale"] * distance
except KeyError:
owner["normalizedScale"] = owner.localScale.copy()/distance