nineMinecraft is a joke site.
nineMinecraft is in no way affiliated with Modrinth or 9minecraft. (And frankly, who wants to be affiliated with the latter?)
Polymer Font Utils

Polymer Font Utils

Mod

API for generating font files

Server Library

1,590 downloads
3 followers
Polymer Font Utils has been archived. Polymer Font Utils will not receive any further updates unless the author decides to unarchive the project.
Filter loader...

TextBuilder

text no longer requires MutableText instead of Text

BitmapGlyph

  • Fixed image reading
  • glyphWidth and glyphHeight now bases on provider ascent
  • Added formatter() function which returns TextFormatter with glyph

TextResource

Can requested using FontResourceManager#requestText, requests text with vanilla font but custom ascent

text = manager.requestText(-20); // Font identifier: pfut:text/default_-20

FontResourceManager

Fully rewrited, for creation requires only mod id, use this class to create FontResource

FontResource

Works like previous version of FontResourceManager

FontSpaceUtils

For resource pack smaller size, all spaces from each mod will be in one file, pfu:spaces, by default it empty, to request space use requestAdvance, requestAdvances or requestRange, to get space MutableText use FontSpaceUtils.spaceMap

Examples

public class PolymerFontUtilsTest implements ModInitializer {
    public static FontResourceManager manager;
    public static FontResource resource;
    public static BitmapGlyph glyph;

    @Override
    public void onInitialize() {
        PolymerResourcePackUtils.addModAssets("pfut");

        manager = FontResourceManager.create("pfut");
        resource = manager.requestFont("test"); // Creates font file "assets/pfut/font/test.json"
        glyph = resource.requestGlyph("font/icon.png", 128, 32);

        FontSpaceUtils.requestAdvance(-256);
        FontSpaceUtils.requestAdvances(-128, 1, 3);
        FontSpaceUtils.requestRange(2, 19);
    }
}

TextBuilder

Like StringBuilder but for text, example:

Text text = new TextBuilder()
  .space(-8)
  .glyph(guiGlyph)
  .text(Text.literal("test text"))
  .build();

Changes

Formatter hotfix, use now TextFormatter#value instead TextFormatter#text

Changes

Moved space, spaceBefore, spaceAfter, offset to TextFormatter, see BitmapGlyph#formatter.

If requesting 0 space, returns empty MutableText.

TextFormatter

Instead of returning MutableText after calling each function, it sets text, example: formatter.spaceBefore(-128).spaceBefore(-64).offset(32).text.

BitmapGlyph

Utility class for better BitmapFontProvider usage, contains image, width, height, glyphWidth and glyphHeight (latest not-transparent pixels), better offset and space generator.

Get it using FontResourceManager.requestGlyph(path, height, ascent) or FontResourceManager.requestGlyph(path, ascent).

FontResourceManager

requestBitmap is now deprecated; use requestGlyph instead.

Other changes

  • Improved stability.
  • Fixed null values in spaceMap.

First release

External resources


Project members

Bonfire Studios

Bonfire Studios

Organization

mazik

Developer


Technical information

License
Client side
unsupported
Server side
required
Project ID