|
|
|
|
|
by spuzvabob
651 days ago
|
|
For a very similar use case I've developed custom text rendering in browser with support for CJK, Thai, Arabic (including bidirectional text with Arabic text within Latin or vice versa) and bitmap emojis. Tbh all the complex part is handled by: https://github.com/harfbuzz/harfbuzzjs which handles the entire text shaping part (which glyphs to draw and the offset from previous glyph), then all that remains is text layout (linebreaking, kerning, line height, font size etc.) and the actual rendering ofc. Still took about 4 months of full-time work. |
|
People who develop canvas libraries soon learn that they don't get to play with Nice Things like consistency across browser implementations for the standards they've (allegedly) agreed to respect.
[1] - https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics