Package solar.squares.pixelwidth
Class DefaultCharacterWidthFunction
- java.lang.Object
-
- solar.squares.pixelwidth.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
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultCharacterWidthFunctionINSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultCharacterWidthFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatwidthOf(int c, @NotNull net.kyori.adventure.text.format.Style style)Gets the width for the given character(represented by its UTF-16 codepoint).
-
-
-
Field Detail
-
INSTANCE
public static final DefaultCharacterWidthFunction INSTANCE
-
-
Method Detail
-
widthOf
public final float widthOf(int c, @NotNull @NotNull net.kyori.adventure.text.format.Style style)Description copied from interface:CharacterWidthFunctionGets the width for the given character(represented by its UTF-16 codepoint).chars will automatically be converted to codepoints.- Specified by:
widthOfin interfaceCharacterWidthFunction
-
-