Class FontSheet

java.lang.Object
com.cake.azimuth.foundation.microfont.FontSheet

public class FontSheet extends Object
Helper of spritesheet based monospace fonts
  • Constructor Details

    • FontSheet

      public FontSheet(net.minecraft.resources.ResourceLocation source, int charW, int charH, int spacing, Map<Character,org.joml.Vector2i> sprites)
  • Method Details

    • render

      public void render(net.minecraft.client.gui.GuiGraphics guiGraphics, String text, int x, int y, int color)
    • getCharHeight

      public int getCharHeight()
    • calculateWidth

      public int calculateWidth(String text)
    • hasGlyph

      public boolean hasGlyph(char c)
      Check if this font sheet has a glyph for the given character. Space characters are always considered renderable (they produce visual gaps).
    • canRender

      public boolean canRender(String text)
      Check if this font sheet can render every character in the given text. Returns true if all characters have sprite mappings (or are spaces). Returns true for empty/null strings.