Better HN
topnewbestaskshowjobs
Log inSign up

dy108

1 karma · joined Jan 30, 2024 (2y ago) · 5 submissions

Submissions

comment 2y ago · link · parent

The reason for textual range is maintaining textual selection / editing interactions and 1:1 character<->value matching, so by deleting one character you delete one value.

It is almost same as your suggested representation, just do `String.fromCharCode(values.map(v => v + 0x100))` or manually as `&#x1XX;&#x1XX;&#x1XX;` in HTML.

comment 2y ago · link · parent

The problem replacing digits like 99,98,100 etc with ligatures of corresponding height is that it would lose 1:1 matching of value to character, so textual selection / operations would be screwed.

comment 2y ago · link · parent

Not just simpleness but also performance profit, since the premise is fonts are the most optimized rendering stack everywhere.

Btw that one-liner function is helper, you don't have to install it it, just do `String.fromCharCode(0x100 + value)` to render character.