Polymer Font Utils
ModrinthAPI for generating font files
1.7k downloads 3 followers updated 18mo ago
latest v0.2.3+1.21.4 Modrinth
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

Versions
Beta
0.2.2+1.21.4
# `BitmapGlyph`
- Fixed `image` reading
- `glyphWidth` and `glyphHeight` now bases on provider ascent
- Added `formatter()` function which returns…
Beta
0.2.0+1.21.4
# `FontResourceManager`
Fully rewrited, for creation requires only mod id, use this class to create `FontResource`
# `FontResource`
Works like previous…
Beta
0.1.5+1.21.2
# `TextBuilder`
Like `StringBuilder` but for text, example:
```java
Text text = new TextBuilder()
.space(-8)
.glyph(guiGlyph)
.text(Text.literal("test…
Beta
0.1.4+1.21.2
# Changes
Formatter hotfix, use now `TextFormatter#value` instead `TextFormatter#text`
Beta
0.1.3+1.21.2
# Changes
Moved `space`, `spaceBefore`, `spaceAfter`, `offset` to `TextFormatter`, see `BitmapGlyph#formatter`.
If requesting `0` space, returns empty…
Beta
0.1.1+1.21.2
# `BitmapGlyph`
Utility class for better `BitmapFontProvider` usage, contains `image`, `width`, `height`, `glyphWidth` and `glyphHeight` (latest…

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