Skip to content

Add support for inline RGB Support | Extension of PR #1064#1070

Closed
KAMKEEL wants to merge 15 commits intoGTNewHorizons:masterfrom
KAMKEEL:color-code
Closed

Add support for inline RGB Support | Extension of PR #1064#1070
KAMKEEL wants to merge 15 commits intoGTNewHorizons:masterfrom
KAMKEEL:color-code

Conversation

@KAMKEEL
Copy link

@KAMKEEL KAMKEEL commented Oct 24, 2025

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:

  • Better Handling of Draw String for RBG Color Coding Lengths. Previous the lengths were incorrectly set to 9 and 10, now they have been adjusted to 8 and 9 to be in line with how Vanilla Minecraft handles Color Coding lengths.
  • Support for \n in the MixinFontRenderer which is present in vanilla's FontRenderer, although it isn't really used as a new-line but, a break for the line length.
  • Made the Mixins for the sizeStringToWidth, getCharWidth, etc clamp to ceiling integers to have better estimation of length during bold lettering. Fixes floating point cut-offs.
  • Modified the Callback Info of sizeStringToWidth back to Integer so access_transformers or reflections that use the sizeStringToWidth no longer crash because they expect an Integer and not a String
  • Every new color resets the formatting (Italics, Bold, Strikethrough) similar to Vanilla-logic and handling of coloring.
  • Added missing Glyph Spacing

KAMKEEL and others added 5 commits October 24, 2025 03:34
…e Port for Hodgepodge, etc

Added Better Utility Handling within ForattedTextMetrics and ColorCodeUtils. Created an optional Strip Color Codes method for Universal Usage.
@KAMKEEL
Copy link
Author

KAMKEEL commented Oct 30, 2025

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.

@KAMKEEL
Copy link
Author

KAMKEEL commented Nov 7, 2025

Closing for #1104

@KAMKEEL KAMKEEL closed this Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants