4 ms·
> Possibly my favourite thing about the rise of emoji is that they’re not Basic Multilingual Plane When can we have user-defined glyphs/emoji, where SVG is emb
by amelius 8y ago
> Possibly my favourite thing about the rise of emoji is that they’re not Basic Multilingual Plane
When can we have user-defined glyphs/emoji, where SVG is embedded in the unicode string?
- chrismorgan 8y agoYou’d just define two code points that switches into and out of SVG mode. (The second is only necessary for performance, so you can scan quickly without needing any sort of XML parser!)
- ithkuil 8y agoWhat if nested <text> element also containers an inline emosvg? :-)
- chrismorgan 8y agoConcerning the SVG table in OpenType fonts, https://docs.microsoft.com/en-au/typography/opentype/spec/svg#security-considerations-and-other-glyph-rendering-restrictions https://docs.microsoft.com/en-au/typography/opentype/spec/sv... declares: > any SVG <text> and <foreignObject> elements within a glyph description must be ignored and not rendered The same limitations would be applied to this hypothetical SVG mode.
- bmn__ 8y agoYou can have that now, but it doesn't work the way you think. The SVG is embedded in the font, not the string. Demo: https://eosrei.github.io/emojione-color-font/full-demo.html https://eosrei.github.io/emojione-color-font/full-demo.html To create user-defined characters, you can occupy any code point in the reserved areas. https://en.wikipedia.org/wiki/Private_Use_Areas https://en.wikipedia.org/wiki/Private_Use_Areas
- amelius 8y agoThat's nice, but I meant something else. I was thinking: what if users of Whatsapp and other chat services could define their own emoji, as they type, and share them with other users? If a friend sends you a new emoji, you could simply copy it and use it in messages of your own. This functionality doesn't work with fixed codepoints. Of course there's a million way to do this (even with today's Unicode standard), but it would be nice if this kind of functionality would be part of a standard, perhaps even at the level of Unicode.
- zyx321 8y agoThat sounds like a cool idea, but a complete pain to implement. There's been bugs that crash iPhones with combining Arabic, or freeze Android devices by spamming LtR override. There's the Zalgo meme, where you drown out your words in combining diacritics. Layout engines are already struggling to keep up with the standard, even without the ability to render a UINT_MAX x UINT_MAX canvas of infinitely repeating fractal penises.
- chrismorgan 8y agoIt actually wouldn’t be as bad as you might imagine: pick whichever of the SVG-in-font specifications wins, and then all you need to do is apply that subset of SVG to the text, effectively allowing inline definition of the font. Roughly no new attack surface exposed in the text layout and rendering engine, given the existing ability to load untrusted fonts. On further reflection, you would probably want some way to efficiently signal the dimensions of the SVG-mode glyph, so that the text layout engine doesn’t need the SVG parser, and only the renderer does. That would probably add at least one more code point reservation, depending on how you chose to do it. But I’m only saying that it’s actually not that hard to do; I firmly believe it’s a bad idea, and I’m fairly confident it will never happen.