chiark / gitweb /
Construct 'ssXX' and 'cvXX' lookups using X macros
authorBen Harris <bjh21@bjh21.me.uk>
Tue, 14 Jan 2025 01:05:28 +0000 (01:05 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 14 Jan 2025 23:21:24 +0000 (23:21 +0000)
commit67721b71bcd0361ea86e94eb3c2922e18833f172
tree01e7b686f1093ad6e7c306947321f1917b60fac8
parent237d5f515d77c545e09c35cf7603e82e8aece94d
Construct 'ssXX' and 'cvXX' lookups using X macros

In general, we want each Stylistic Set to be constructed out of a
collection of Character Variants.  At the moment, this is fairly
simple, but if I start putting variants of more characters into these
features (for example, adding questiondown.open to go with
question.open), it will get awkward keeping them in sync.  But the two
kinds of lookup want different XML, so they can't just be copied
as-is.

One approach would be to have a C data structure that gets used to
generate both sets of lookups, but an alternative is to extend the
existing pre-processor magic to use X macros to construct the two
lookups.  This is what I've done.

At the moment, this is just using the existing macros that generate
XML, but driving them from another set of macros, one for each
Character Variant feature.  The Stylistic Sets then invoke all the
macros for the Character Variants they include.

There are a couple of open problems.  One is the (single, so far) case
where there are two variants of a character, namely 'D'.  This should
be dealt with by paramaterising the variant macro, but I've not got
around to that yet.  The other is that the macro names are largely
horrible.
bedstead.c