unicode character split issue in function createPaths(src/extras/core/Font.js)
See original GitHub issueDescription 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:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@gero3 Can you please explain the regex a bit? 😇