I have tried to do it in JS (PIXI), but GD ignores the alignment, and it seems that SFML text (native platform) has no alignment option, so the only way to do it is manually set the object position.
Each time you modify the text string, you have to update its position (X is the static x position, for “right” align it’s the right side):
To align left, just set the position:
Do = X to the position of TextObject
To align center:
Do = X - TextObject.Width()/2 to the position of TextObject
And to align right:
Do = X - TextObject.Width() to the position of TextObject
Sorry, as you can notice I’m very “ignorant” on this topic, the commas are different? Maybe mirrored? Then AFAIK you’ll have to find a custom font that has such symbols as default ones, so no need to generate a full alignment system… because there is not one in GD