FontLoader: Text directional featrue #31683
Draft
+144
−50
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.
Description
To enhance FontLoader's feature to allow user set the text directional to support more languages.
Since some languages are written Right to Left or vertically,
FontLoader & TextGeometry
would be lovely to support to show different text direction.I would love to implement directional feature for
FontLoader & TextGemoetry
.However, I am not familiarize with multi-language and 3D fonts, would like to confirm this is a right approach for
FontLoader
. Please feel free to leave comments.Solution
chars Array
, text can be display from Right to Left.font.ascender
, Chinese or Japanese char distance in vertically can be calculate correctly.Demo page: raw.githack.com/Rikahei/three.js/fontLoader_direction/examples/webgl_loader_ttf.html
Here is some example for language showing Right to Left and Top to Bottom:
Hebrew, right to left, word:

אני לא יודע
Chinese, Top to bottom, word:

週休@七日
Japanese, top to bottom, word:

鬼狩り!?
Known issue
『, 』
, is not display correctly withTop to Bottom
but required to rotate the marks.Reference