Skip to content

Instantly share code, notes, and snippets.

View aerulion's full-sized avatar
🖥️
Coding

aerulion aerulion

🖥️
Coding
View GitHub Profile
@aerulion
aerulion / BitmapGlyphInfo.java
Last active July 7, 2023 20:35
A collection of all Minecraft bitmap font glyphs and their pixel width when using the default resource pack. This information can be used to send centered text to the player. Some glyphs are represented as surrogate pairs, in which case the high surrogate has a width of -1 to simplify the width calculation (since every char is spaced 1 pixel apa…
import it.unimi.dsi.fastutil.chars.Char2ObjectMap;
import it.unimi.dsi.fastutil.chars.Char2ObjectOpenHashMap;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* A collection of all available bitmap glyph infos containing the default character width.
*/
@SuppressWarnings("unused")