918 Commits

Author SHA1 Message Date
Ben Harris
15ff246ea8 Fill out 'cv96' with all the angular cedillas
This collides with the small lower-case 't' of 'cv84' at U+0163 LATIN
SMALL LETTER T WITH CEDILLA, but I think all the combinations work.  I
do currently have both "uni0163.small.angular" and
"uni0163.angular.small" to ensure that you can apply each stylistic
set with the opposing character variant.  Maybe with more careful
interleaving I could get away with only one of those.
2025-01-19 00:49:30 +00:00
Ben Harris
27ba336388 Stop trying to indent XML output
The indentation wasn't always correct, and made the C code ugly.  I've
now found "xmllint --format", which does a better job, so I think it's
quite reasonable to stop trying to do it myself.
2025-01-19 00:49:30 +00:00
Ben Harris
0960e56e0e Expand some comments
Now that we use strings for bitmaps, the comments can be a little less
abbreviated.
2025-01-19 00:49:30 +00:00
Ben Harris
aeb66f043d More large, accented lower-case 'o's for 'cv79'
I thought about just re-using the ".sc" glyph names, but that seemed
wrong.
2025-01-19 00:49:30 +00:00
Ben Harris
da26a18aa0 Extend 'cv74' to other characters based on lower-case 'j'
I didn't do U+0254 LATIN SMALL LETTER DOTLESS J WITH STROKE because the
Unicode standard says it's based on a turned 'f', not 'j'.
2025-01-19 00:49:30 +00:00
Ben Harris
34e4cf780e Extend 'cv84' to most characters based on lower-case 't'
That's 12 additional glyphs, and I thought 't' would be one of the
simpler ones.  Still, it automatically works with 'ss01' and 'ss02' as
well.
2025-01-19 00:49:22 +00:00
Ben Harris
a993909e6f Merge SUFFIXSUB and SUFFIXSUB1 macros 2025-01-15 13:55:06 +00:00
Ben Harris
457163004e Use X-macro trick for emitting lookups for variant capital D
This will mean that adding extra characters to 'cv38' will
automatically add them to 'ss01' and 'ss02' as well.
2025-01-15 13:53:13 +00:00
Ben Harris
e1e56eab43 Remove the global "variable" (macro) from 'cvXX'/'ssXX' generation
I realised that VAR2 can be a parameter to the various CVXX macros
instead.  This makes the existing code a little more complicated, but
will make the code for the three-way choice of capital D less
confusing.

The macro names are getting worse, and will definitely need to be
rationalised at some point, bit the structure is getting better.
2025-01-15 11:18:02 +00:00
Ben Harris
832b518a8d Use a macro to emit <SingleSubst> elements 2025-01-14 23:35:18 +00:00
Ben Harris
b0f67aa3ef Don't emit multiple subtables for 'cv31'
I was accidentally emitting a separate <AlternateSubst> element for
each base character, which worked but was unnecessary.  A single
<AlternateSubst> for the whole lookup will make for a smaller font
file and probably faster lookups as well.
2025-01-14 23:29:48 +00:00
Ben Harris
c36cea4b1e Add some extra variant question-mark glyphs
The inverted and reversed question-mark characters should obviously
change shape along with the normal one, so now they do.  This
conveniently tests the 'cvXX'/'ssXX' interaction without getting
tangled up with small caps as well.

Based on the different shapes of the glyphs in the Unicode code charts,
I've decided that glottal stops should not change their shapes along
with question marks, and should perhaps be different shapes entirely.
2025-01-14 23:21:24 +00:00
Ben Harris
67721b71bc 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.
2025-01-14 23:21:24 +00:00
Ben Harris
237d5f515d Rename two 'cvXX' features based on SAA5054 shapes
The features that generate the variant ocircumflex and ccedilla glyphs
are now treated a being variants of lower-case 'o' and cedilla
respectively.  Unlike the SAA5051/2 variants, we don't yet have
variants of their base glyphs.  Indeed, for the lower-case 'o' we
probably never will, because the variant is "larger accented versions"
so the unaccented version wouldn't change.

I haven't done anything about the weird SAA5054 ugrave because I'm not
sure there's any real design principle behind it.

I've also added a comment explaining the numbering of 'cvXX' features.
2025-01-14 23:21:24 +00:00
Ben Harris
fd06786a45 Add SPDX-License-Identifier to CSS files 2025-01-08 23:35:43 +00:00
Ben Harris
2b1938ed32 Add @character-variant rules to bedstead-faces.css 2025-01-08 23:34:30 +00:00
Ben Harris
669db1f283 Add names for 'cvXX' features 2025-01-08 22:42:31 +00:00
Ben Harris
320de601bc Add cvXX (character variant) lookups
The idea of these is that each one allows for choosing between different
variants of a single character (or set of closely-related characters).
This allows for deciding that you want (for instance) the angular
SAA5054 "ccedilla", but not its weird conjoined "ugrave".

This seems like a good way to handle chips like the SN74S262 where some
samples seem to vary in a single character from others, as well as more
generally for making the variant glyphs easily accessible for purposes
other than precise emulation.

At the moment, each feature only provides alternatives for a single
character, but now that we have a mechanism for it, that might change.
2025-01-08 21:15:53 +00:00
Ben Harris
8a2449c697 Don't emit <LookupType> elements
TTX is quite capable of inferring the lookup type from the type of the
main child element of <Lookup>.  This should allow for specifying
different kinds of lookup using literal XML.
2025-01-08 01:58:21 +00:00
Ben Harris
7658a55c86 Generate ss0X substitutions less cleverly
These substitutions are not generated from the glyphs table, but are
specified statically.  Rather than taking a table and transforming it
into XML with C, we could just put the static XML in a string, which
is much simpler.  To avoid excessive simplicity, the string is
generated by a pile of preprocessor macros.

This causes no change to the output OTFs.
2025-01-08 01:52:55 +00:00
Ben Harris
e6f3f6e1c9 Note source of ugrave.roundjoined in a comment 2025-01-05 10:24:53 +00:00
Ben Harris
1be864fb48 Don't emit AlternateSets that will be overridden
Just in case TTX changes its behaviour in this area in the future.
2025-01-02 00:53:02 +00:00
Ben Harris
ad5c574321 Add a comment explaining the purpose of aalt_overrides 2025-01-02 00:27:50 +00:00
Ben Harris
4e7b163a32 Signal names for SN74S262 pins, from RML 380Z service manual 2025-01-01 23:54:11 +00:00
Ben Harris
1be09350cc Extend compatcheck 'GSUB' checks to handle renamed glyphs
We do this by pulling out the CFF charstring for old and new glyph
names from the new font and seeing if they're the same.
2025-01-01 23:53:51 +00:00
Ben Harris
3b65b970cb Emit AlternateSets for 'aalt' overrides
These are just emitted after the standard AlternateSets, and because
of how TTX works, they end up overriding the standard ones.  This
seems a bit dodgy to me, so I might try to do better later.
2025-01-01 23:18:13 +00:00
Ben Harris
a0e959cd37 Add data for overriding 'aalt' sometimes
Not used yet.
2024-12-30 23:15:54 +00:00
Ben Harris
3a43d22b3d Sort glyph names in compatcheck 2024-12-29 18:50:52 +00:00
Ben Harris
67e3cf9324 New shape for SAA5054 ugrave (now ugrave.roundjoined)
I just got an SAA5054 (date code 8510) and the character it has at 5/13
is different from the one in the datasheet.  The real one lacks the
pixel in the bottom right corner, so it's more like a Ugrave than a
ugrave.  However, it would be weird for a character set to include the
capital but not the lower case, and the corresponding character set in
ETS 300 706: May 1997 (the French option in table 36) is obviously
lower-case.  So I think it's semantically lower-case, whatever it looks
like.

As for the thing I was intending to check, yes the accent does join onto
the letter.
2024-12-29 18:50:52 +00:00
Ben Harris
670c0b0dd5 Add @font-feature-values to bedstead-faces.css
This means that users of this stylesheet can use declarations like
"font-variant: styleset(saa5051)" to request a particular stylistic set.
The separated graphics sets, 'ss14' and 'ss16', are not covered by this
because new applications should use the proper Unicode code points for
separated graphics instead.
2024-12-29 18:50:52 +00:00
Ben Harris
1ed20fb032 Use new generic glyph names in rom.ps
Output confirmed to be unchanged
2024-12-29 18:50:52 +00:00
Ben Harris
04f2387455 Put feature tag in a comment in each <Lookup> in TTX
Now that the ssXX features don't have fixed suffixes it's useful to
have something to say which is which.
2024-12-29 18:50:52 +00:00
Ben Harris
81c554424a Check OS/2.achVendID in compatcheck
My GNU Emacs configuration ended up using this to select its default
font, so it should remain constant within a major version.
2024-12-29 18:50:52 +00:00
Ben Harris
698683b7fa Add name checking to compatcheck
This tries to ensure that sensible ways of specifying a font by name
continue to work across an upgrade.
2024-12-29 18:50:52 +00:00
Ben Harris
9c1ad469f5 compatcheck: actually exit with failure if a check fails 2024-12-29 18:50:52 +00:00
Ben Harris
c5f74d681f Add a comment explaining what compatcheck does 2024-12-29 18:50:52 +00:00
Ben Harris
cdafa5da9e SN74S262/3 pinout
The XM11 application note mentions "two chip enables", which can only
be pins 14 and 15.
2024-12-29 18:50:11 +00:00
Ben Harris
1b620c9cef More descriptive names for variant characters
This means yet more compatibility aliases, but I think it's the right
way to go.
2024-12-29 18:50:11 +00:00
Ben Harris
177e7552a4 Redesign how stylistic sets for particular chips work
The old approach was that each stylistic set had a distinct glyph-name
suffix, the same way that small caps or right-to-left mirrored glyphs
did. This meant that when several chips used the same alternative
glyph, there needed to be a separate alias for each chip.  This was
slightly awkward for just the SAA5051 and SAA5052, but I'd like to add
coverage for the SN74S262 and SN74S263, and those share some of the
same glyphs as well.

So now those stylistic sets have an explicit list of which variant
glyphs they include, and my plan is that each variant glyph will have
a single canonical name.  They'll still have to keep the existing
names for compatibility.  Indeed, for now that's what they're using
because that makes checking the output easier.

No change to the resulting font, though the lookups do end up in a
different order in the TTX file.
2024-12-29 18:50:11 +00:00
Ben Harris
fa50e22c98 Swap scripts and suffix members of struct gsub_feature
Every feature must have a scripts list, but "suffix" is only one way
you might select lookups to generate.  Putting it at the end makes it
easier to leave it out.  Indeed, our existing 'aalt' lookup omits it.

This causes no change to the generated fonts.
2024-12-29 18:50:11 +00:00
Ben Harris
602db761c2 Remove ASCII dependency
ISO C doesn't guarantee that the execution character set is ASCII, or
anything like it.  Bedstead tries to require only ISO C, but it used
strcmp() to sort glyph names and so the output depended on the sort
order of characters.  Moreover, the code for finding variants of
characters required that '.' have a lower value than any other
character that appeared in glyph names.

To avoid this dependency, we now have a table that assigns values to
each character that can appear in glyph names, and a strcmp-compatible
function that compares two strings after mapping through that table.
This means that our sort order is explicitly specified in the code,
and also provides a convenient place to catch unusual characters in
glyph names.

This change has no effect on the output TTX files (at least on an ASCII
system).  All remaining uses of strcmp() are testing solely for
equality.
2024-12-29 18:50:11 +00:00
Ben Harris
9b82a0f264 Correct the size of the parameter to glyph_footprint() 2024-12-16 22:27:24 +00:00
Ben Harris
f68916e9ef Fix the length of an accidentally variable-length array 2024-12-16 22:22:01 +00:00
Ben Harris
d9380d5835 Range-check argument to --bdfgen 2024-12-16 21:49:16 +00:00
Ben Harris
61967c8094 Change parameters of moveto() and lineto() to signed
The corresponding members of struct vec are signed, as are most of the
arguments passed to the functions, so it's silly that the parameters
themselves are unsigned.  This takes the number of warnings under
clang -Weverything down from 126 to 30.

This doesn't cause any change to the output TTX files.
2024-12-16 21:40:36 +00:00
Ben Harris
8ff354a9fd Remove an unnecessary shadowing variable 2024-12-16 21:31:21 +00:00
Ben Harris
32e6fd7599 Add a few missing "static" keywords 2024-12-16 21:26:35 +00:00
Ben Harris
5b758ec94c compatcheck: detect vanished code points from fonts 2024-12-14 16:43:06 +00:00
Ben Harris
ba81f7454c Add a script to check backward compatibility 2024-12-14 16:06:18 +00:00
Ben Harris
f16df5983c Some notes on TIFAX 2024-12-11 22:34:53 +00:00