Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language issue #5615

Open
DYBDDY opened this issue Nov 26, 2024 · 10 comments
Open

Language issue #5615

DYBDDY opened this issue Nov 26, 2024 · 10 comments

Comments

@DYBDDY
Copy link

DYBDDY commented Nov 26, 2024

How do I write in a language other than English? For example, Chinese?

@mrxz
Copy link
Contributor

mrxz commented Nov 26, 2024

The built-in text component and <a-text> primitive uses so-called (M)SDF fonts. These need to be generated with all the characters you plan to use. The default font only supports ASCII characters, so for characters from other writing systems, you'll have to generate your own font. See the following documentation page for details: https://aframe.io/docs/1.6.0/components/text.html#non-ascii-characters

Alternatively you can use the aframe-troika-text library. It uses Troika's text renderer under the hood, which can generate the font on the fly.

@dmarcos
Copy link
Member

dmarcos commented Nov 26, 2024

Should troika be A-Frame default?

@arpu
Copy link
Contributor

arpu commented Nov 26, 2024

maybe something like https://github.com/foxglove/three-text with @mapbox/tiny-sdf could be a first step

@mrxz
Copy link
Contributor

mrxz commented Nov 27, 2024

For my own projects I exclusively use Troika, mostly out of convenience but also because it builds nicely on top of the Three.js material system. I think making it the default in A-Frame isn't a bad idea, I'll try and experiment with it and create a PR.

@dmarcos
Copy link
Member

dmarcos commented Nov 27, 2024

What are the downsides from switching to Troika?

@arpu
Copy link
Contributor

arpu commented Nov 27, 2024

The only downside i can think of, is if aframe switching to WebGPURenderer (webgl2, webgpu) with TLS more glsl shader code needs to port to TSL, but what i read @lojjic have plans to support TLS ( correct me if i am wrong)

@lojjic
Copy link

lojjic commented Nov 27, 2024

Yes TSL support is planned, but no concrete timeframe yet. It would bump up in priority if there were a significant number of people or projects asking for it. 😅

@lojjic
Copy link

lojjic commented Nov 27, 2024

The other downside I can think of is that it's asynchronous, and runs in a worker by default. That could complicate things that expect to be able to use metrics of the text in a synchronous way -- e.g. scaling a background plane to match the text dimensions.

@koktavy
Copy link

koktavy commented Nov 27, 2024

I hadn't even considered TSL in A-Frame, but that integration would encourage me to learn TSL and give me better grounds to advocate for it in the office.

@polytropoi
Copy link

I'd love to see troika as default (I'm all in on it), so it gets tested with aframe changes - I noticed that the troika aframe component does not work and throws this error on the aframe master branch:

troika-three-utils.esm.js:22 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
at b (troika-three-utils.esm.js:22:17)

see https://glitch.com/edit/#!/gusty-childlike-durian

@lojjic I was going to post this as an issue on your github, but wasn't sure about the propriety of posting bugs that only appear on the master branch...

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

No branches or pull requests

7 participants