question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unicode character split issue in function createPaths(src/extras/core/Font.js)

See original GitHub issue
Description of the problem

While creating paths for common string text, the current function createPaths( text, size, divisions, data ) works fine, but not for those characters whose unicode is > U+FFFF due to below split function: var chars = String( text ).split( '' ); For example, character “𝄞” (U+1D11E) is split into 2 parts, so it won’t be able to referred correctly while looking up from the font glyphs.

I guess there’re pretty less requirements as mine, maybe the impact is almost zero. But still better to handle properly for those kind of scenarios. 😃

Thanks.

Three.js version
  • Dev
  • r92
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, May 10, 2018

@mooncaker816 If you are happy with the current implementation of your PR, I would prefer this way. It’s just easier to read than introducing a new regex.

1reaction
Mugen87commented, May 5, 2018

@gero3 Can you please explain the regex a bit? 😇

Read more comments on GitHub >

github_iconTop Results From Across the Web

String Split With Unicode - javascript
As explained in JavaScript has a Unicode problem, in ES6 you can do this quite easily by using the new ... spread operator....
Read more >
What every JavaScript developer should know about ...
Unicode provides a unique number for every character, no matter what the ... The whole set of Unicode code points is split into...
Read more >
JavaScript has a Unicode problem
Internally, JavaScript represents astral symbols as surrogate pairs, and it exposes the separate surrogate halves as separate “characters”.
Read more >
String.prototype.split() - JavaScript - MDN Web Docs
The split() method takes a pattern and divides a String into an ordered list of substrings by searching for the pattern, ...
Read more >
text.UnicodeCharTokenizer
Tokenizes a tensor of UTF-8 strings on Unicode character boundaries. ... detokenize; split; split_with_offsets; tokenize; tokenize_with_offsets ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found