hubs icon indicating copy to clipboard operation
hubs copied to clipboard

Korean Characters for Name Tags

Open KWAK1221 opened this issue 3 years ago • 8 comments

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

KWAK1221 avatar May 26 '22 04:05 KWAK1221

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

rawnsley avatar May 26 '22 05:05 rawnsley

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.

wsxiaoys avatar May 26 '22 07:05 wsxiaoys

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?

rawnsley avatar May 26 '22 07:05 rawnsley

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.

wsxiaoys avatar May 26 '22 07:05 wsxiaoys

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

albirrkarim avatar Jun 06 '22 01:06 albirrkarim

Hello, I'll guide this issue.

  1. You must set fontUrl.default in troika-text.js
    • https://github.com/belivvr/hubs/blob/113dfa307e8f75376860ccccb5ca4e9b09e14864/src/components/troika-text.js#L65
  2. Find a-z and add 가-힣 in regexp

then you can use korean name.

juunini avatar Jun 21 '22 08:06 juunini

Hello, I'll guide this issue.

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

    • https://github.com/belivvr/hubs/blob/113dfa307e8f75376860ccccb5ca4e9b09e14864/src/components/troika-text.js#L65
  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.

rawnsley avatar Jun 21 '22 08:06 rawnsley

reticulum config connect-src to add font url

config.toml

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

juunini avatar Jun 22 '22 06:06 juunini