Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.14k stars 1.41k forks source link

Korean Characters for Name Tags #5462

Open KWAK1221 opened 2 years ago

KWAK1221 commented 2 years ago

Is your feature request related to a problem? Please describe. We're building a metaverse platform using the hubs cloud.Currently, only English is allowed for the nicknames of the users, but we want Korean to be allowed as well. I don't know if I can customize or not to allow Korean.

Describe the solution you'd like I want to use a nickname in Korean.

Describe alternatives you've considered

Additional context

rawnsley commented 2 years ago

A recent change to text rendering makes this much easier to implement, but it requires Reticulum changes, which are outside of the supported Hubs Cloud. See also https://github.com/mozilla/hubs/issues/3934

wsxiaoys commented 2 years ago

I've implemented this in my client earlier this week (https://github.com/mozilla/hubs/pull/5463/files).

The only pitfall is jsonschema version in hubs is stale (no support of RegExp construction with unicode flag), thus causing the schema validation failed when a CJK name is used.

rawnsley commented 2 years ago

I've implemented this in my client earlier this week (https://github.com/mozilla/hubs/pull/5463/files).

The only pitfall is jsonschema version in hubs is stale thus not support RegExp construction with unicode flag, thus causing the schema validation failed when a CJK name is used.

Very nice! Do you have any problems with reticulum rejecting names? Maybe it is only room names that go through a RegEx in the backend.

It's possible we can dump all the RegEx checks now in both client and server. Do they still have a purpose?

wsxiaoys commented 2 years ago

I've implemented this in my client earlier this week (https://github.com/mozilla/hubs/pull/5463/files). The only pitfall is jsonschema version in hubs is stale thus not support RegExp construction with unicode flag, thus causing the schema validation failed when a CJK name is used.

Very nice! Do you have any problems with reticulum rejecting names? Maybe it is only room names that go through a RegEx in the backend.

It's possible we can dump all the RegEx checks now in both client and server. Do they still have a purpose?

We only allowed CJK characters in nickname. haven't tested room name yet.

albirrkarim commented 2 years ago

I've implemented this in my client earlier this week (https://github.com/mozilla/hubs/pull/5463/files).

The only pitfall is jsonschema version in hubs is stale (no support of RegExp construction with unicode flag), thus causing the schema validation failed when a CJK name is used.

Can you share live project URL ? @wsxiaoys

juunini commented 2 years ago

Hello, I'll guide this issue.

  1. You must set fontUrl.default in troika-text.js
  2. Find a-z and add 가-힣 in regexp

then you can use korean name.

rawnsley commented 2 years ago

Hello, I'll guide this issue.

  1. You must set fontUrl.default in troika-text.js

  2. Find a-z and add 가-힣 in regexp

then you can use korean name.

You will also need to add https://cdn.jsdelivr.net to the Extra Content Security Policy connect-src Rules section of your Hubs Cloud server settings.

This works well for supporting ASCII characters and the Korean alphabet, but it doesn't support extended latin characters (Sofía) or Chinese characters (张伟). What we really need is font fallback support.

juunini commented 2 years ago

reticulum config connect-src to add font url

config.toml

[ret."Elixir.RetWeb.Plugs.AddCSP"]
connect_src = "https://cdn.jsdelivr.net"