Skip to content

Add [ruby] BBCode tag to RichTextLabel#119460

Open
Zemeio wants to merge 1 commit into
godotengine:masterfrom
Zemeio:feat-ruby-tag
Open

Add [ruby] BBCode tag to RichTextLabel#119460
Zemeio wants to merge 1 commit into
godotengine:masterfrom
Zemeio:feat-ruby-tag

Conversation

@Zemeio
Copy link
Copy Markdown

@Zemeio Zemeio commented May 14, 2026

Description

This PR introduces the [ruby] BBCode tag to RichTextLabel. This tag supports phonetic guides (often known as ruby characters or furigana), allowing developers to add small annotative annotations or pronunciation guides above the base text.

Human Verification:

  • All modifications were manually tested, and every line of code was reviewed by a human.
  • Due diligence was exercised to search and verify the codebase. The generated code pattern was modeled after existing commits and existing Godot source code structures, so there should be no risk of licensing issues.

What problem(s) does this PR solve?

Example with bbcode

First line
[color=red][ruby=longer ruby text]base[/ruby][/color] [ruby=にほんご]日本語[/ruby] Some text without ruby
image

Known Limitations

There are currently a few limitations with this implementation:

  1. No Table Support: The ruby text tag cannot be properly used or rendered inside tables.
  2. No Tag Nesting: Applying ruby text on top of existing ruby text does not produce an error, but the resulting layout will be broken.

Example with bbcode

[ruby=ruby][ruby=secondruby]base[/ruby][/ruby]
image
  1. Shared Styling: BBCode tags cannot be applied independently to just the ruby text or just the base text. For example, you cannot apply a color tag only to the base text without it also affecting the ruby text, and vice versa.

AI Usage Disclosure

This PR was created with the assistance of an AI tool, overseen by a human author. Specifically, the AI assisted with the following tasks:

  • Downloading, building, and running the Godot engine from source.
  • Drafting initial portions of the code.
  • Adding the respective documentation and test cases.
  • Helping review and format the PR description and commit messages.

@Zemeio Zemeio requested review from a team as code owners May 14, 2026 13:12
@KoBeWi KoBeWi added this to the 4.x milestone May 14, 2026
@AThousandShips
Copy link
Copy Markdown
Member

Adding the respective documentation and test cases.

Please do not use LLMs or similar tools to write documentation, if you need help with the wording please ask, the quality and wording of documentation is important

This commit introduces the [ruby] BBCode tag to support phonetic guides (ruby characters/furigana) in RichTextLabel text. It updates the layout rendering logic to properly handle inline ruby text styling and positioning, adds documentation, and includes test coverage for tables and standard text flow.

Disclosure: this PR was made with the assistance of AI and authored by me (a human).
@Zemeio
Copy link
Copy Markdown
Author

Zemeio commented May 14, 2026

Adding the respective documentation and test cases.

Please do not use LLMs or similar tools to write documentation, if you need help with the wording please ask, the quality and wording of documentation is important

Thank you for the comment, I will refrain from doing that in the future. To be clear, I did review the documentation and tried to match the other documentation in terms of content and wording, but since this is my first contributions, please be patient if I get some things wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a [ruby] tag for Furigana in RichTextLabel

3 participants