Add support for inline RGB Support | Extension of PR #1064#1070
Closed
KAMKEEL wants to merge 15 commits intoGTNewHorizons:masterfrom
Closed
Add support for inline RGB Support | Extension of PR #1064#1070KAMKEEL wants to merge 15 commits intoGTNewHorizons:masterfrom
KAMKEEL wants to merge 15 commits intoGTNewHorizons:masterfrom
Conversation
update with upstream
…ld calculations, etc
wlhlm
reviewed
Oct 24, 2025
…e Port for Hodgepodge, etc Added Better Utility Handling within ForattedTextMetrics and ColorCodeUtils. Created an optional Strip Color Codes method for Universal Usage.
Author
|
Currently in the process of porting this to another mod entirely. Angelica will be able to utilize the API to support. I will update this PR when the time comes. |
Author
|
Closing for #1104 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please view the original PR the breakdown.
PR #1064
Huge credit to @alppp for creating the base foundation of this.
This is based on PR #1064, which aims to add RGB Support to Angelica. I have modified their existing commits to help create better String Size handling, so other mods with in-line editors do not encounter issues with this new modification.
I've used the PlugEditor (an in-line book editor) mod as my test case for this because it heavily relies on FontRenderer functions such as String Length and Color Code recognition. https://github.com/KAMKEEL/BookEditor/tree/format
Before my new commits, this mod had issues with returning wrongful lengths.
Notable Changes:
9and10, now they have been adjusted to8and9to be in line with how Vanilla Minecraft handles Color Coding lengths.\nin theMixinFontRendererwhich is present in vanilla'sFontRenderer, although it isn't really used as a new-line but, a break for the line length.sizeStringToWidth,getCharWidth, etc clamp to ceiling integers to have better estimation of length during bold lettering. Fixes floating point cut-offs.sizeStringToWidthback toIntegerso access_transformers or reflections that use thesizeStringToWidthno longer crash because they expect anIntegerand not aString