Centering MOTD's with Unicode characters

Discussion in 'Spigot Plugin Development' started by Rushmead, Apr 30, 2017.

  1. Hi,

    I am using the code from this post for centering text on the MOTD. It works, but the DefaultFontInfo enum does not contain unicode characters. I've attempted to add my own such as the Circle White Star ✪:

    Code (Text):
    CIRCLE_WHITE_STAR('✪', 13);
    But it doesnt quite work correctly. If someone could provide a version of the enum with more characters or help me to add my own.

    Many Thanks
    Rushmead
     
    #1 Rushmead, Apr 30, 2017
    Last edited: Apr 30, 2017
  2. What?
     
  3. You forgot the hyperlink.
     
    • Funny Funny x 1
  4. Did you try to add UTF-8 encoding to your server ?
     
  5. That's not the problem. The problem is to do with centering the text and knowing the width of the characters
     
  6. If I'm not mistaken, the max. length of a server MOTD is not the same as the max. length of a chat message. Did you use that util and it worked perfectly fine for you? Out of curiosity.