
TextBuildertextno longer requiresMutableTextinstead ofTextBitmapGlyph- Fixed
imagereading glyphWidthandglyphHeightnow bases on provider ascent- Added
formatter()function which returnsTextFormatterwith glyph
TextResourceCan requested using
FontResourceManager#requestText, requests text with vanilla font but custom ascenttext = manager.requestText(-20); // Font identifier: pfut:text/default_-20- Fixed
Hotfix
FontResourceManagerFully rewrited, for creation requires only mod id, use this class to create
FontResourceFontResourceWorks like previous version of
FontResourceManagerFontSpaceUtilsFor resource pack smaller size, all spaces from each mod will be in one file,
pfu:spaces, by default it empty, to request space userequestAdvance,requestAdvancesorrequestRange, to get spaceMutableTextuseFontSpaceUtils.spaceMapExamples
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); } }TextBuilderLike
StringBuilderbut for text, example:Text text = new TextBuilder() .space(-8) .glyph(guiGlyph) .text(Text.literal("test text")) .build();Changes
Formatter hotfix, use now
TextFormatter#valueinsteadTextFormatter#textChanges
Moved
space,spaceBefore,spaceAfter,offsettoTextFormatter, seeBitmapGlyph#formatter.If requesting
0space, returns emptyMutableText.TextFormatterInstead of returning
MutableTextafter calling each function, it setstext, example:formatter.spaceBefore(-128).spaceBefore(-64).offset(32).text.Hotfix
BitmapGlyphUtility class for better
BitmapFontProviderusage, containsimage,width,height,glyphWidthandglyphHeight(latest not-transparent pixels), better offset and space generator.Get it using
FontResourceManager.requestGlyph(path, height, ascent)orFontResourceManager.requestGlyph(path, ascent).FontResourceManagerrequestBitmapis now deprecated; userequestGlyphinstead.Other changes
- Improved stability.
- Fixed
nullvalues inspaceMap.
First release

