The BoundingBox attribute is read-only. i.e. you ask a text stimulus what its bounding box is, you can’t set it. Think of it this way: when you create a text stimulus, you can set its height. This height is in the units of the stimulus, which might be pixels, cm, deg, etc. But just like in a Word processor, when you set the size of text (e.g setting it to be 12 points (which is also a height unit), this is a measure applied to the entire font. But a 12 point upper case
O will be quite a lot larger than a lower case
o, let alone a punctuation mark like
We can’t practically set the actual height of each character, and let the font take care of that itself (e.g. O vs o vs g), just within the overall font height setting.
It sounds like you want to know what this actual character size is. The PsychoPy TextStim can tell us this via its bounding box, which gives the actual height and width of the characters drawn, which will differ from one string to another. e.g. create a text stimulus in the normal way and then get its bounding box:
You should find that the value changes if the maximum character size and length of the string changes. e.g.
'hello' should have a larger bounding box (in both x and y directions) than
'eo', even if you specified their height to be the same.