Loading your glyphs
Loading a glyph:
public class MyResourcePack {
public static Font.TextureGlyph glyph;
public static void load(Plugin plugin) {
ResourcePack pack = new ResourcePack(plugin, "plugin_id");
Namespace ns = pack.namespace("plugin_id");
Texture texture = ns.texture("glyph/smiley_face");
Font font = ns.font("glyphs");
glyph = font.glyph(texture, height, ascent);
pack.register(false);
}
}
Loading other font providers:
public static Font.OffsetGlyph offset;
public static void load(Plugin plugin) {
ResourcePack pack = new ResourcePack(plugin, "plugin_id");
Namespace ns = pack.namespace("plugin_id");
Texture texture = ns.texture("glyph/smiley_face");
Font font = ns.font("glyphs");
offset = font.offset(offset, unicode)
pack.register(false);
}
You can afterwards use the offset using OffsetGlyph#toMiniMessageString
and OffsetGlyph#toComponent
public static void load(Plugin plugin) {
ResourcePack pack = new ResourcePack(plugin, "plugin_id");
Namespace ns = pack.namespace("plugin_id");
Texture texture = ns.texture("glyph/smiley_face");
Font font = ns.font("my_ttf_font");
font.ttf(file, xShift, yShift, size, oversample)
pack.register(false);
}
Font#ttf
does NOT return anything, it simple loads given font
public static void load(Plugin plugin) {
ResourcePack pack = new ResourcePack(plugin, "plugin_id");
Namespace ns = pack.namespace("plugin_id");
Texture texture = ns.texture("glyph/smiley_face");
Font font = ns.font("my_font");
font.unihex(unihexZipFile, overrides)
pack.register(false);
}
Font#unihex
does NOT return anything, it simple loads given font
public class MyResourcePack {
public static List<Font.TextureGlyph> glyphs;
public static void load(Plugin plugin) {
ResourcePack pack = new ResourcePack(plugin, "plugin_id");
Namespace ns = pack.namespace("plugin_id");
Texture texture = ns.texture("glyph/smiley_face");
Font font = ns.font("glyphs");
glyph = font.glyphs(texture, spriteWidth, spriteHeight, height, ascent);
pack.register(false);
}
}
Font#glyphs
returns all loaded glyphs in ORDER (row-order, left-to-right)
03 October 2025