Skip to content

Conversation

Rikahei
Copy link
Contributor

@Rikahei Rikahei commented Aug 19, 2025

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

  1. By simply reverse the chars Array, text can be display from Right to Left.
  2. By using 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: אני לא יודע
Screenshot 2025-08-19 at 15 06 26

Chinese, Top to bottom, word: 週休@七日
Screenshot 2025-08-19 at 2 50 43

Japanese, top to bottom, word: 鬼狩り!?
Screenshot 2025-08-19 at 2 49 42

Known issue

  • Some punctuation marks like Japanese double quotes 『, 』, is not display correctly with Top to Bottom but required to rotate the marks.
  • In Hebrew, vowels cannot supported.

Reference

  1. text-directionality
  2. Robust Vertical Text Layout - Please read "Introduction to Vertical Text"

@Rikahei Rikahei force-pushed the fontLoader_direction branch from 086edaf to c35ddc6 Compare August 20, 2025 16:18
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.

1 participant