It doesn't lie, it just returns the information the internals need to draw the mesh and nothing else. It was an internal function that was (probably incorrectly) exposed.
Add this function to tk2dTextMesh return an estimated bounds
/// <summary>
/// Calculates an estimated bounds for the given string if it were rendered
/// using the current settings.
/// </summary>
public Bounds GetEstimatedMeshBoundsForString( string str ) {
tk2dTextGeomGen.GeomData geomData = tk2dTextGeomGen.Data( data, _fontInst, _formattedText );
Vector2 dims = tk2dTextGeomGen.GetMeshDimensionsForString(str, geomData);
float offsetY = tk2dTextGeomGen.GetYAnchorForHeight(dims.y, geomData);
float offsetX = tk2dTextGeomGen.GetXAnchorForWidth(dims.x, geomData);
float lineHeight = (_fontInst.lineHeight + data.lineSpacing) * data.scale.y;
return new Bounds( new Vector3(offsetX + dims.x * 0.5f, offsetY + dims.y * 0.5f + lineHeight, 0), Vector3.Scale(dims, new Vector3(1, -1, 1)) );
}
You'll also need to make GetYAnchorForHeight & XAnchorForWidth public, but that should be it mostly.