Skip to content

Commit 8166268

Browse files
authored
Update README.md
Update README about new standard style ruby tags.
1 parent e7c38f9 commit 8166268

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

README.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,42 @@ Obsolete : `RubyTextMeshPro.UnditedText` / `RubyTextMeshProUGUI.UnditedText` : W
5757

5858
## Realtime Ruby Text
5959

60-
You can use `<ruby=ice>fire</ruby>` tag or `<r=ice>fire</r>` tag. Both are the same.
61-
62-
It can also work with double quotes.
63-
64-
`<ruby="ice">fire</ruby>` tag or `<r="ice">fire</r>` tag.
60+
Ruby tags allow you to annotate text with small "ruby" characters (e.g., for pronunciation or additional information). Various styles of ruby tags are supported, providing flexibility and backward compatibility.
61+
62+
### Supported Ruby Tag Formats
63+
64+
1. **Legacy Ruby Tag Styles**:
65+
These styles have been supported since earlier versions and are fully compatible.
66+
- `<ruby=ice>fire</ruby>`: Annotates "fire" with "ice".
67+
- `<r=ice>fire</r>`: Equivalent to the above.
68+
- These tags also support double quotes:
69+
- `<ruby="ice">fire</ruby>`
70+
- `<r="ice">fire</r>`
71+
72+
2. **Standard Ruby Tag Styles (from v1.3.0)**:
73+
Starting from **v1.3.0**, the standard ruby tag format is supported. This enables additional features, such as the ability to use rich text formatting within ruby annotations.
74+
- `<ruby>fire<rt>ice</rt></ruby>`: Annotates "fire" with "ice".
75+
- `<r>fire<rt>ice</rt></r>`: Equivalent to the standard style.
76+
- `<r>fire<rt><color="blue">ice</color></rt></r>`: Enables rich text formatting (e.g., coloring "ice" in blue).
77+
78+
---
79+
80+
### Examples
81+
82+
| Input Syntax | Rendered Output |
83+
|--------------------------------------------------|-------------------------------------------|
84+
| `<ruby=ice>fire</ruby>` | <ruby>fire<rt>ice</rt></ruby> |
85+
| `<r=ice>fire</r>` | <ruby>fire<rt>ice</rt></ruby> |
86+
| `<ruby="ice">fire</ruby>` | <ruby>fire<rt>ice</rt></ruby> |
87+
| `<ruby>fire<rt>ice</rt></ruby>` | <ruby>fire<rt>ice</rt></ruby> |
88+
| `<r>fire<rt>ice</rt></r>` | <ruby>fire<rt>ice</rt></ruby> |
89+
90+
---
91+
92+
> [!TIP]
93+
> - **Rich Text Support**: The standard ruby tag style (`<ruby><rt>`) allows for advanced formatting such as color, bold, or italic within the ruby annotations.
94+
> - **Backward Compatibility**: Legacy styles such as `<ruby="ice">` and `<r="ice">` are fully supported alongside the new standard ruby tag style.
95+
> - **Standard Syntax Recommendation**: It is recommended to use the standard ruby tag style (`<ruby><rt>`) for new projects to take full advantage of the rich text features.
6596
6697
# How To Use
6798

0 commit comments

Comments
 (0)