Language

Polymer Font Utils

Polymer Font Utils

Modrinth

API for generating font files

1.7k downloads 3 followers updated 18mo ago
latest v0.2.3+1.21.4 Modrinth
Fabric Quilt 1.21.2 – 1.21.4 Library

Polymer Font Utils

API for generating font files. Uses polymer resource pack api.

Example

repositories {
    maven { url "https://api.modrinth.com/maven" }
}

dependencies {
    modImplementation include("maven.modrinth:pfu:0.2.3+1.21.4")
}
public class PolymerFontUtilsTest implements ModInitializer {
    public static FontResourceManager manager;
    public static FontResource resource;
    public static TextResource text;
    public static BitmapGlyph glyph;

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

        manager = FontResourceManager.create("pfut");
        resource = manager.requestFont("test");
        text = manager.requestText(-20); // Font identifier: pfut:text/default_-20
        glyph = resource.requestGlyph("font/icon.png", 128, 32);

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

You can get list of all bitmaps from manager using command /pfu pfut:test

Example

Versions

Beta
0.2.3+1.21.4
fabric, quilt · 1.21.4 · 18mo ago
# `TextBuilder` `text` no longer requires `MutableText` instead of `Text`
958
Beta
0.2.2+1.21.4
fabric, quilt · 1.21.4 · 18mo ago
# `BitmapGlyph` - Fixed `image` reading - `glyphWidth` and `glyphHeight` now bases on provider ascent - Added `formatter()` function which returns…
63
Beta
0.2.1+1.21.4
fabric, quilt · 1.21.4 · 18mo ago
Hotfix
96
Beta
0.2.0+1.21.4
fabric, quilt · 1.21.4 · 18mo ago
# `FontResourceManager` Fully rewrited, for creation requires only mod id, use this class to create `FontResource` # `FontResource` Works like previous…
67
Beta
0.1.5+1.21.2
fabric, quilt · 1.21.2, 1.21.3, 1.21.4 · 19mo ago
# `TextBuilder` Like `StringBuilder` but for text, example: ```java Text text = new TextBuilder() .space(-8) .glyph(guiGlyph) .text(Text.literal("test…
144
Beta
0.1.4+1.21.2
fabric, quilt · 1.21.2, 1.21.3, 1.21.4 · 19mo ago
# Changes Formatter hotfix, use now `TextFormatter#value` instead `TextFormatter#text`
86
Beta
0.1.3+1.21.2
fabric, quilt · 1.21.2, 1.21.3, 1.21.4 · 19mo ago
# Changes Moved `space`, `spaceBefore`, `spaceAfter`, `offset` to `TextFormatter`, see `BitmapGlyph#formatter`. If requesting `0` space, returns empty…
73
Beta
0.1.2+1.21.2
fabric, quilt · 1.21.2, 1.21.3, 1.21.4 · 19mo ago
Hotfix
70
Beta
0.1.1+1.21.2
fabric, quilt · 1.21.2, 1.21.3, 1.21.4 · 19mo ago
# `BitmapGlyph` Utility class for better `BitmapFontProvider` usage, contains `image`, `width`, `height`, `glyphWidth` and `glyphHeight` (latest…
73
Beta
0.1.0+1.21.2
fabric, quilt · 1.21.2, 1.21.3, 1.21.4 · 20mo ago
First release
84

Comments 0

No comments yet. Be the first to share your thoughts.