mkremins / fanciful

Fancy Bukkit message formatting
MIT License
95 stars 82 forks source link

Text alignment #78

Open ghost opened 8 years ago

ghost commented 8 years ago

Is it possible to add a feature allowing for text to be aligned centrally?

mkremins commented 8 years ago

As far as I know this can't be done reliably. Minecraft permits variable-width fonts in texture packs, and the server has no way of getting information about which font the client is currently using.

Something like this could probably be done for the default font, if you're willing to accept breakage on other texture packs. Most likely it'd involve hardcoding the width of each character in the default font, as is done here. I'm unlikely to try implementing this myself, but I'm willing to consider a pull request from anyone who does.