RubyTextMeshPro is a plugin to add ruby tags to Unity TextMeshPro to support writing Kanji.
- Realtime Ruby text preview.
- Support both TextMeshPro (3D) and TextMeshProUGUI (UI).
-
Install this plugin via Package Manager Git URL:
https://github.com/kiraio-moe/RubyTextMeshPro.git?path=Assets/RubyTextMeshPro
or the classic way with
.unitypackage
from Releases.
If you install using.unitypackage
, don't forget to install TextMeshPro via Package Manager. -
Create new RubyTextMeshPro GameObject of your choice.
-
Start writing the Ruby tag.
You can use<ruby>
or<r>
tag, both tags are valid.<ruby=ice>fire</ruby> <r=ice>fire</r>
It also work with double quotes:
<ruby="ice">fire</ruby> <r="ice">fire</r>
<ruby=かんじ>漢字</ruby>
- RUBY_ALIGNMENT: Display text according to the ruby.
- BASE_ALIGNMENT: Display characters according to the original characters.
This function allows you to have the same gap even if you don't use ruby. Empty this string to skip this feature.
- Removed:
allVCompensationRuby
/allVCompensationRubyLineHeight
: IfrubyLineHeight
is an empty string, it will be theallVCompensationRuby:false
value up to now, and ifrubyLineHeight
is a value, it will be theallVCompensationRubyLineHeight
value.
Read more on Changelogs.
-
TextMeshPro source has not changed. So text alignment is problematic.
-
Do not make the text box smaller than the maximum number of characters in ruby. Display collapse will occur.
-
BASE_ALIGN
setting is left align and the ruby is at the beginning of the line but more than the original character, it will be displayed outside the frame.
BASE_ALIGN
setting is center align and the ruby is at more than the original character, can't displayed center. 'RUBY_ALIGN' used, it may be solved.
BASE_ALIGN
setting is left align and the ruby is at the beginning of the line but more than the original character, Different from number 3 it will be displayed in the frame.
Used font
Rounded M+
References
- https://forum.unity.com/threads/how-to-display-extra-little-characters-above-characters-in-a-text.387772/
- http://baba-s.hatenablog.com/entry/2019/01/10/122500
Thank You!
- TextMeshPro is a very nice plugin. If in the future they add ruby tag very well, we will delete this project.
- Not checked anything other than Japanese.
All contributions are welcomed. Just make sure you follow the project's code style.
Contact: [email protected]
This project is licensed under MIT License