Add Custom Fonts to Your Mod Using TTF Files
Preparing Your Font Files
KasugaLib supports external TrueType Font (TTF) files, allowing you to use custom typography in your mod's screens and text rendering without converting to bitmap fonts.
Steps
1. Place your TTF font file in your mod's assets folder under a logical subdirectory (e.g., assets/yourmodid/fonts/)
2. Register the font using KasugaLib's font registry during mod initialization, providing the file path and a unique font identifier
3. KasugaLib automatically loads and caches the TTF file, making it available for use in custom screens and GUI elements
4. Reference your registered font by its identifier when creating text components or custom screen widgets
5. Test font rendering in different GUI contexts to ensure proper display at various scales
This approach eliminates the need for manual font texture sheet creation. Multiple TTF files can be registered for different purposes (headers, body text, etc.), and KasugaLib handles the rendering pipeline automatically.