Commit graph

6 commits

Author SHA1 Message Date
Daniel Eklöf
ee682abac8
mypy: no need to declare None as return type for __init__ 2025-12-26 14:13:14 +01:00
Daniel Eklöf
bbebe0f330
scripts: mypy fixes 2025-12-26 13:13:01 +01:00
Daniel Eklöf
085c60a334
scripts: generate-emoji-variation-sequences: don't assume single codepoint sequences
Right now (Unicode 15.1), all valid variation sequences consist of a
single Unicode codepoint (followed by either VS-15 or VS-16).

Don't assume this is the case.

We don't actually handle longer sequences. But now we at least catch
such escapes, and error out.
2024-06-26 18:33:23 +02:00
Daniel Eklöf
aed9c392eb
scripts: generate-emoji-variation-sequences: compact the C struct
Lookups in this table is not performance critical at all.

Thus, let's compact it to bring down the binary size of foot.

This brings the size of each entry down from 9 bytes to 6, bringing
the size of the whole thing down from 1647 bytes to 1098 bytes, saving
us 549 bytes.
2024-06-26 18:32:10 +02:00
Daniel Eklöf
ecb1ca61af
scripts: generate-emoji-variation-sequences: don't assume input is sorted 2024-06-25 08:23:27 +02:00
Daniel Eklöf
9665661445
vt: only apply VS-15/16 to valid sequences
At compile time, build a lookup table from the Unicode data file
'emoji-variation-sequences.txt'.

At run-time, when we detect a VS-15/16 sequence, do a lookup in this
table, and enforce the variation selector iff the sequence is valid.

Closes #1742
2024-06-25 08:20:21 +02:00