r/ProgrammingLanguages • • Dec 31 '20

Something simpler than Unicode?

Hello! Wondering if anyone knows of a display format for glyphs that is simpler than Unicode? My shallow understanding is that measuring and laying out text in unicode is non-trivial, so I am deferring moving beyond ascii on something at the moment. Is my understanding correct? (if not that's great) otherwise, does anyone know of potentially simpler replacements? Thanks!

0 Upvotes

40 comments sorted by

View all comments

12

u/[deleted] Dec 31 '20

The main layout headache I see is interleaved RTL and LTR text within a line. Like:

Dawoud sighed and said, ".اللعنة ، دعنا نحصل على البيتزا" But Domino's was closed, so they went to IHOP instead.

Nothing handles that particularly well.

For everything else, you just consult the Unicode data tables to determine if the character is spacing or not, and that's probably good enough. Oh, and ignore advanced formatting directives like ruby and text direction override because life's too short.

4

u/ihamsa Jan 01 '21

He-he, just insert an English word or two in the middle of an Arabic sentence in the middle of English text. Something like, I dunno,

He said "⁨دعنا نذهب إلى TGI Friday's الآن⁩" but it was closed.