
Embers Text API
Use fancy text effects anywhere, including custom fonts!
112.7K
14
Ember's Text API 2.9.0 (NeoForge 1.21.1)
Release3 нед. назад
Список изменений
2.9.0
Added
- MSDF font rendering — Complete rewrite of the SDF font rendering pipeline from single-channel EDT (Euclidean Distance Transform) to Multi-Channel Signed Distance Fields (MSDF). Eliminates stray pixel artifacts and rounded corners that plagued the old approach. Key improvements:
- Analytical Bézier distance computation — Distance to glyph edges is computed directly from vector outlines using Newton-Raphson refinement on quadratic and cubic Bézier curves, replacing the old bitmap→EDT approximation pipeline.
- Multi-channel encoding — Distance information is encoded in three color channels (RGB) with edge coloring, enabling the shader to reconstruct sharp corners that monochrome SDF fundamentally cannot represent.
- Cross-product sign determination — Inside/outside is determined by the cross product of the curve tangent at the closest point, eliminating winding-number ray casting errors.
- Pseudo-distance — Uses perpendicular distance to the tangent line at the closest point instead of true Euclidean distance, preventing "bleeding" around segment endpoints.
- Error correction — Post-generation pass detects and corrects false-color artifacts at edge intersection points.
- Degenerate segment filtering — Tiny segments produced by bold fonts at stroke junctions are filtered out during outline extraction.
- New bundled MSDF fonts — Almendra, Almendra Bold, Cardo, Cardo Bold, Cinzel, Cinzel Bold, Norse, Norse Bold (in addition to existing Metamorphous).
- Font alias system —
FontAliasRegistrymaps short names to full ResourceLocations, so markup can use<font name=cinzel>instead of<font id=emberstextapi:cinzel>. All bundled fonts have aliases registered at mod init. - New MSDF configuration options in font JSON:
px_range(default 8.0) — Pixel range controlling anti-aliasing width. Replaces the deprecatedspreadparameter.angle_threshold(default 3.0 radians) — Corner detection threshold for edge coloring. Lower values detect more corners for sharper reproduction.
- Configurable anvil rename length — New
anvilNameMaxLengthconfig option (default 50) allows servers to increase the character limit when renaming items in an anvil. Three mixins (AnvilMenuMixin,AnvilRenameMixin,AnvilScreenMixin) patch the vanilla hardcoded limit. - Server-side message limits —
ServerMessageLimiterenforces configurable limits on messages sent to clients:maxServerMessageDuration,maxServerActiveMessages,maxQueueSize, andallowedEffects. - Reduce motion support — New
reduceMotionconfig option disables motion-based effects (wave, shake, bounce, etc.) for accessibility.isEffectDisabled()now checks both the explicit disable list and the reduce-motion flag. - SDF debug texture dump — Launch with
-Deta.sdf.debug=trueto dump each MSDF glyph texture as an RGB PNG todebug-sdf/in the game directory. - Emojiful compatibility layer — ETA effects now work alongside Emojiful's emoji rendering. Regular characters get full effects while emoji sprites render normally through Emojiful's pipeline.
EffectApplicatorutility class — Shared effect-application logic extracted fromStringRenderOutputMixin.
Fixed
- SDF text fringe on MC 1.20.1 — Fixed a visible anti-aliasing halo around MSDF-rendered text on all 1.20.1 loaders. MC 1.20.1's blit-to-screen reads framebuffer alpha, so semi-transparent SDF edge fragments caused a fringe artifact. Fixed by defining alpha-preserving blend state (
srcalpha=0, dstalpha=1) in the shader JSON, which is applied insideShaderInstance.apply()immediately before the draw call.
Changed
- Fragment shaders rewritten for MSDF —
rendertype_eta_sdf_text.fshandrendertype_eta_sdf_text_see_through.fshnow sample all three RGB channels and take the median for distance reconstruction, withfwidth-based screen-space anti-aliasing and alpha squaring for edge sharpening. - Font JSON files updated — All bundled font definitions now use
px_rangeandangle_thresholdinstead of the deprecatedspreadfield. Oldspreadvalues are still accepted for backward compatibility (px_range = spread × 2). - Emojiful is no longer declared as incompatible. The previous hard block has been replaced with automatic compatibility mode detection.
Removed
SDFGenerator.java— Old single-channel SDF generator using bitmap→EDT pipeline. Replaced byMSDFGenerator.java.- Bitmap rendering path in
FreeTypeManager—renderGlyphSDF(),computeSDFFromBitmap(), and all EDT code removed. Only outline extraction viaFT_Outline_Decomposeremains. FT_Set_Pixel_SizesandFT_Render_GlyphfromNativeFreeType(1.20.1) — No longer needed since bitmap rendering was eliminated.
Internal
- New class
MSDFGenerator— Analytical distance computation engine with 3-channel MSDF texture generation, error correction, and pseudo-distance support. - New class
EdgeColoring— Chlumsky's simple edge coloring heuristic with corner detection and CYAN/MAGENTA/YELLOW color cycling. SDFConfigrecord extended withpxRangeandangleThresholdfields, backward-compatible constructor mappingspread → pxRange.SDFGlyphInfo.bake()rewired to: extract outline → edge color → generate MSDF → upload 3-channel data.SDFSheetGlyphInfo.upload()now writes independent R, G, B channels to the RGBA atlas instead of duplicating a monochrome value.- MC 1.20.1 SDF shader JSONs now include a
blendsection with alpha-preserving factors;SDFRenderTypes.javauses standardTRANSLUCENT_TRANSPARENCYon both versions. - New SDF pipeline mixins:
FontManagerMixin,FontSetMixin(1.21.1),FontTextureMixin,GlyphRenderTypesMixin,BakedGlyphAccessor. - 40 unit tests across 3 test classes:
MSDFGeneratorTest(20),EdgeColoringTest(13),MSDFGenerationTest(7). - Added
@PseudomixinEmojiCharacterRendererMixinfor Emojiful compatibility withrequire = 0for graceful absence. - Refactored
StringRenderOutputMixinto delegate effect building, application, and character rendering toEffectApplicator.
Файлы
emberstextapi-neoforge-1.21.1-2.9.0.jar(989.53 KiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
2.9.0+neoforge-1.21.1
Загрузчики
NeoForge
Версии игры
1.21.1
Загрузок
253
Дата публикации
3 нед. назад