Icon Fonts - Syntax error in unicode escape sequence
-
I'm using an icon font (material symbols).
This triggers the error
"\u" + "e5c3"
But this doesn't"\ue5c3"
If I use a double slash,
\\
with the first example then the error goes away, but the font isn't draw correctly.Any suggestions?
-
From the web:
\u is used in JavaScript and similar languages for Unicode escape sequences, but it must be followed immediately by a valid four-digit hexadecimal code (e.g., \u1234).
-
@Dan-Korneff That's what I'm doing, but when I create such a string through concatenation JUCE gets unhappy.
-
@d-healey
If generating dynamically, use String.fromCharCode with parseInt.Is there an equivalent in HISE?
-
@Dan-Korneff Oh interesting, I'll give it a try
-
I tried using parseInt and String.getIntValue, but no joy. We don't have a .fromCharCode function as far as I can tell.
-
@d-healey JUCE 6 doesn't fully support Unicode. There's a great free, ASC icon font, Modern Pictograms, that works well with HISE.
-
@clevername27 said in Icon Fonts - Syntax error in unicode escape sequence:
JUCE 6 doesn't fully support Unicode.
I don't think JUCE 8 does either, at least not with fonts. But this particular situation is supported.
The Modern Pictograms look nice but seems their license makes it unusable for my projects.
-
@d-healey I own a commercial license for the font that I'm not using - you're welcome to it.
-
@clevername27 Thanks, won't help me though, I need to be able to distribute it with my source code and they don't have a license for that.
-
@d-healey Doh.
-
@d-healey this works if you need concatenation
Console.print("\\" + "u" + "e5c3");
EDIT: I have not tested if the font draws correctly that being said
-
@ustk said in Icon Fonts - Syntax error in unicode escape sequence:
EDIT: I have not tested if the font draws correctly that being said
It gives the same result as
"\\" + "ue5c3"
which I mentioned in the first post. -
@d-healey Yeah just tested and I didn't help going further...