tancredi/fantasticon

support for unicode codepoints greater than 0xffff

eposjk opened this issue ยท 1 comments

When I tried to generate a font overriding the "๐Ÿ‘ฅ" symbol (codepoint: 128101), fantasticon seems to change the codepoint to 61697.
The problem seems to be

const unicode = String.fromCharCode(codepoints[id]);

According to https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode
String.fromCharCode() only supports 16-bit codepoints. ES2015 offers a similar function String.fromCodePoint() which does not have that restriction.

When I replace it locally, it seems to work.

Hello, I have the same issue.

I am currently trying to create a font for Hentaigana (U+1B000 - U+1B0FF). It would be very convenient if I could combine svgs to create the font file, but is currently prevented from doing so due to this.

While analyzing this issue, I found a similar problem in the svgicons2svgfont package, which fantasticon depends on.
nfroidure/svgicons2svgfont#96
Hence it might take a little more than fixing the line that @eposjk has pointed out.
I would be more than happy to help regarding this issue. ๐Ÿ™‚