Interface CharacterWidthFunction

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @Deprecated
    @FunctionalInterface
    public interface CharacterWidthFunction
    Deprecated.
    for removal since 1.1.0, use CharacterWidthFunction instead
    A function that takes a character(represented by its UTF-16 codepoint) and a Style and returns the characters width as an int.

    Should return -1 if the character width is unknown to this function

    Since:
    1.0.0
    • Method Detail

      • widthOf

        @Deprecated
        float widthOf​(int codepoint,
                      net.kyori.adventure.text.format.Style style)
        Deprecated.
        for removal since 1.1.0, use CharacterWidthFunction.widthOf(int, Style) instead
        Gets the width for the given character(represented by its UTF-16 codepoint). chars will automatically be converted to codepoints.
        Since:
        1.0.0