Class DefaultCharacterWidthFunction

  • All Implemented Interfaces:
    CharacterWidthFunction

    public class DefaultCharacterWidthFunction
    extends Object
    implements CharacterWidthFunction
    Generated with MinecraftFontPixelWidth.

    Can calculate for all characters found in the default ascii.png file

    This function includes the spacing after each character before the next, this means that the last character will be calculated as one(1) pixel "too long"

    Since:
    1.0.0
    • Constructor Detail

      • DefaultCharacterWidthFunction

        public DefaultCharacterWidthFunction()
    • Method Detail

      • widthOf

        public final float widthOf​(int c,
                                   @NotNull
                                   @NotNull net.kyori.adventure.text.format.Style style)
        Description copied from interface: CharacterWidthFunction
        Gets the width for the given character(represented by its UTF-16 codepoint). chars will automatically be converted to codepoints.
        Specified by:
        widthOf in interface CharacterWidthFunction