News for hackers. Stuff that matters.
Re:NIR: Nim Intermediate Representation by elcritch on Saturday September 30, 2023 @09:26PM (#37721660)
Not currently but it's on my mind and I'm using utf8 for text with utf-32 for rendering. Good links for screen reader info are welcome!

> If the latter, you're in for a word of pain with screen reader compatibility, internationalization, right-to-left languages, handling of Asian input methods etc.

Custom drawn, and yep it's a pain! Actually emoji's seem the hardest (e.g. smiley face + skin tone).

The windowing library I'm building upon uses the OS'es input method editors (IME). For example MacOS'es functions for composing letters like `é` already works. Hopefully Asian input methods will work via the OS'es IME. Luckily I know a bit of (modern) Hebrew, so I'll can add basic RTL languages soon.

Re:NIR: Nim Intermediate Representation by ddlsmurf on Sunday October 01, 2023 @12:02AM (#37722410)
Why not use something like pango, libschrift, etc ? Text rendering is a hard problem, moreso one cross-platform...
Re:NIR: Nim Intermediate Representation by elcritch on Sunday October 01, 2023 @01:50AM (#37723037)
Is it hard! Font rendering is handled by Pixie and the guys who wrote it made a great NimConf video showing that https://www.youtube.com/watch?v=8acDfUIwLnk

Pixie can render svg and ttf fonts with unicode in addition to drawing the shapes used for boxes and lines (e.g. like pango+cairo). It's SIMD optimized, very fast, and pure Nim so cross platform.

The challenge I mentioned with emojis is text selection and cursor movement when dealing with multi-grapheme characters. :)

edit: see https://youtu.be/8acDfUIwLnk?si=1EAUwUNZqje88J86&t=382 where they discuss how hard Text is

Re:NIR: Nim Intermediate Representation by ddlsmurf on Sunday October 01, 2023 @10:13AM (#37726131)
I didn't know Pixie, thanks !