chiark / gitweb /
Output glyphs in an order that FontForge won't change
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 1 Jun 2024 22:18:25 +0000 (23:18 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 18 Aug 2024 12:29:07 +0000 (13:29 +0100)
commitf6a4441d41c4813ba3a10aec7be5fdb391239206
tree4be4c0dbfc6c813fa6b6b74689dec44e54991b9d
parent214c39a92985424dd52770152a8b0dbd2412b7e7
Output glyphs in an order that FontForge won't change

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.c