Loading
Docs / Design Guidelines / Typography & Fonts
v1.0.0 JAVA MOD LIBRARY

Typography & Fonts

Multi-font rendering with OreFont (SEVEN, TEN, NOTO_SANS), 4K GPU vector atlas, pair kerning, and text measurement methods.

ore-ui-lib renders three typefaces via the OreFont enum depending on the component’s role:

  • OreFont.SEVEN ("Minecraft Seven v2"): Vanilla pixel font used for UI labels, buttons, inputs, navigation items, tooltips, and body copy.
  • OreFont.TEN ("Minecraft Ten v2"): Bold display typeface used in tabBar titles and cardHeader headings.
  • OreFont.NOTO_SANS ("Noto Sans"): Clean sans-serif used by toast notifications and readable subtitles.

Live Samples

Minecraft Seven (OreFont.SEVEN)

The quick brown fox jumps over 0123456789

Minecraft Ten (OreFont.TEN)

MINECRAFT ORE UI LIB

Noto Sans (OreFont.NOTO_SANS)

World saved successfully

4K GPU Vector Atlas & Kerning

OreFontAtlas rasterizes OreFont.TEN and OreFont.NOTO_SANS from vector outlines at a 128px base size into 4096×4096 dynamic GPU textures with pure white RGB (0x00FFFFFF) + alpha mapping for clean tinting:

  • Pair Kerning: Tightens U/u + I/i (-7.0F) in Minecraft Ten, and adjusts i/f (+6.0F), f/t (+6.0F), and a/r (-3.0F) in Noto Sans.
  • 1px Separation Barrier: Guarantees adjacent visible glyphs never collide after integer pixel rounding (dx >= prevEnd + 1), while spaces retain natural advance.
  • Automatic Fallback: If OreFontManager.isReady() is false, OreUi automatically falls back to the vanilla Font until the async atlas upload completes.

Text & Measurement Methods (OreUi)

MethodDescription
ui.text(String label, int x, int y, int colour)Draws vanilla OreFont.SEVEN text without drop shadow (shadow overload available).
ui.text(OreFont font, String label, int x, int y, int colour)Draws text using the specified OreFont (shadow overload available).
ui.textScaled(String label, int x, int y, int colour, float scale)Draws scaled text around (x, y) (OreFont and shadow overloads available).
ui.textCentered(String label, int cx, int y, int colour)Draws horizontally centered text around cx (OreFont and scale overloads available).
ui.textWidth(String label) / ui.textWidth(OreFont font, String label, float scale)Measures rendered width in integer GUI pixels.
ui.paragraph(String text, int x, int y, int width, int colour)Wraps and renders multi-line text, returning the total height in pixels (paragraphHeight pre-measures).

Example

// Default vanilla font (no shadow)
ui.text("Graphics Quality", x, y, OreTone.TEXT);

// Display heading using Minecraft Ten scaled up
ui.textCenteredScaled(OreFont.TEN, "SETTINGS", centerX, y, OreTone.TEXT, 1.35F);

// Noto Sans label and measurement
int labelW = ui.textWidth(OreFont.NOTO_SANS, "Synced with cloud");
ui.text(OreFont.NOTO_SANS, "Synced with cloud", x, y + 18, OreTone.MUTED);

// Wrapped paragraph returning consumed height
int usedH = ui.paragraph("Changes take effect after restarting.", x, y + 32, 240, OreTone.MUTED);