-
-
Notifications
You must be signed in to change notification settings - Fork 4
Custom Fonts
Maximilian Dorn edited this page Sep 5, 2022
·
1 revision
maps
supports custom fonts since 3.4.0.
// Built-in Minecraft font
MapFont font = MapFont.MINECRAFT_FONT;
// Convert Bukkit font
font = MapFont.fromBukkit(MinecraftFont.Font);
// Load Java font
Font javaFont = Font.createFont(Font.TRUETYPE_FONT, new File("MyFont.ttf")).deriveFont(32f);
// Convert Java font into maps font
font = FontConverter.convertAllUnicode(javaFont);
// Draw text
MapGraphics<?, ?> graphics = ...;
graphics.drawText(5, 5, "Hello World", font, ColorCache.rgbToMap(0, 0, 0), 1);
Non-ascii characters, like the Cyrillic characters, are supported (but only if the provided font supports those characters).
Non-standard fonts (cursive, italic, ...) will likely be cut off. I'm not sure why this happens and don't know how to fix it, but I hope this will be addressed in the future.
- Getting started
- Core classes
- Other
- Examples
- Javadocs
- Concepts
- (Outdated)
"Dirty" maps - (Outdated)
The Advanced Content Change Algorithm
- (Outdated)
- Other
- (Outdated)
Memory usage
- (Outdated)