That is, not generating aliases at all, becuase that's simpler and
actually makes the OTF file smaller. Which makes me wonder if all
aliases should be done the same way, leaving FontForge to
automatically factor out common bits.
All the *.sep6 glyphs are now aliases for their proper Unicode 16
names. And the 6-cell mosaic graphics are now in the section for
glyphs from real character generators, because that's what they are.
A character can't both be an alias and have its own bitmap data, so we
may as well overlap them. Wrapping them in a union doesn't require any
changes to the syntax of the glyphs array because C allows for
incomplete bracketing of initialisers. Because the union doesn't have a
name, its members can be accessed as though they're members of the
containing struct, which means that accesses to them don't need to
change.
There is a new flag to mark a glyph as an alias since "alias_of == NULL"
no longer works, and a corresponding change to the ALIAS() macro.
This saves about 20K of bedstead's data segment on a 64-bit system,
which is kind of silly but it's satisfying nonetheless.
FontForge has opinions about what order glyphs in an OpenType font
should appear in, at least some of them being mandated by the OpenType
spec (for instance that .notdef must by glyph 0). When outputting an
OpenType font, FontForge re-orders it in accordance with these opinions.
I expect that this will be a problem if I want to emit a table that
FontForge doesn't understand, since it won't be able to correct the
glyph indexes in that table. Thus I've added code to re-order the
glyphs in Bedstead such that FontForge won't re-order them. This should
mean that bedstead.c can safely use the glyph indexes that it generates
without worrying that FontForge might change them.
I don't think FontForge minds what order unencoded glyphs appear in, but
I've defined them to be in strcmp() order of glyph name so that they're
at least somewhat stable. Before this, they were in the same order as
in the source file.
Bedstead claims to be written in ISO C. ISO C allows "int" to be only
16 bits wide, which is a bit of a problem. In fact, it's not much of
a problem because Bedstead mostly deals in small numbers. The main
exception is Unicode code points, which can exceed 16 bits.
To hopefully fix this, Bedstead now mostly uses "long" for Unicode
code points. The main exception is in the gklph table where that
seems a bit profligate on 64-bit systems so I've used int_least32_t
instead.
The fiddliest bits of this are around uses of printf(), which cares
whether it's being passed an "int" or a "long".
This is untested on an actual 16-bit system, but at least on a 64-bit
system it continues to produce correct results.
Specifically this changes the comments on IPA characters to refer to
them in lower-case even though the official names of these characters
are upper-case. I did this because it was annoying not being able to
tell the case of a letter from its comment.
In addition to their obviously distinctive national characters, the
SAA5051 and SAA5052 also change the shape of some standard characters
compared to the SAA5050. I had spotted some of these, but noticed
several more when using an actual SAA5051 in my Acorn System 3. The
unusual characters are apparently much easier to spot on screen than
in a datasheet.
Now, I think, we actually have the correct characters for each of
these chips. In many cases, they're the same as one another, and in
those cases I've aliased the glyphs.
The final versions of letters should obviously come after the normal
ones. While I'm there, I've also put the variant phi after the ordinary
one.
Thanks to Adam for pointing this out.
Bedstead has actually had external contributions, so it seems reasonably
to set out how I handle them.
This was inspired by Valerie Aurora and by the contributions and credits
policy guide created by members of the RIPE Open Source Working Group.
The small-caps and 'rtlm' lookups now come before the stylistic sets.
This is appropriate because the former make changes to the semantics
of characters and so should take priority over mere stylistic changes.
'palt' comes last because it can only reasonably be applied to the
actual glyphs being rendered.
Almost no new glyphs, because the existing accented caps glyphs are
themselves small. I'm not quite sure which glyphs small caps need to
be visually distinct from, so for now I won't worry about that.
I liked the approach I took with 'rtlm' of putting variant glyphs next
to the standard ones in the glyph array. So I've tried doing the same
with small caps. Each small cap appears at least twice. For ones with
real Unicode code points, the 'c2sc' version is an alias for the native
one. For small caps without Unicode code points, the 'c2sc' version is
the actual small cap glyph. In either case, the 'smcp' version is an
alias for the 'c2sc' one. This is a change from the previous setup,
where the 'c2sc' version was an alias for the 'smcp' one instead. I've
swapped them because the small cap glyph is generally based on the full
cap, so putting them together seems sensible.
As far as I can tell, the "GaspTable" line that I put in the SFD file
has never actually worked. I don't think I want it to anyway: even
when the source pixels line up precisely with the display pixels, it's
still worth having anti-aliasing on the diagonal lines. And of course
none of this would work properly for any width other than the default
one.
So overall, it doesn't work, and if it did I'd want it to stop. So
let's remove it.
These are characters that have the Bidi_Mirroring_Glyph but don't
appear in the OpenType Mirroring Pairs List (OMPL). In a couple of
cases, these are listed by Unicode as "best fit" and I think I should
actually redraw the tildes the other way around.
This implements the Bidi_Mirrored Unicode property for those characters
that don't have a Bidi_Mirroring_Glyph. These are the characters listed
at the end of BidiMirroring-15.1.0.txt. I haven't yet assigned them PUA
code-points. The characters with a Bidi_Mirroring_Glyph that don't
appear in the OpenType Mirroring Pairs List (OMPL) still need aliases
added.
The TeX "unicode-math" package conveniently lists a bunch of characters
that it treats as the kind of large operator that takes limits. Bedstead
has a standard treatment for these, stretching them over the full height
of the character cell. So I've drawn some that are in Plain TeX or
otherwise reasonably easy. One exception is the n-ary square cap and
cup operators because I can't work out how to distinguish them from the
n-ary product and coproduct.