chiark / gitweb /
Ben Harris [Thu, 2 Jan 2025 00:53:02 +0000 (00:53 +0000)]
Don't emit AlternateSets that will be overridden
Just in case TTX changes its behaviour in this area in the future.
Ben Harris [Thu, 2 Jan 2025 00:27:50 +0000 (00:27 +0000)]
Add a comment explaining the purpose of aalt_overrides
Ben Harris [Wed, 1 Jan 2025 23:54:11 +0000 (23:54 +0000)]
Signal names for SN74S262 pins, from RML 380Z service manual
Ben Harris [Wed, 1 Jan 2025 23:53:51 +0000 (23:53 +0000)]
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.
Ben Harris [Wed, 1 Jan 2025 23:18:13 +0000 (23:18 +0000)]
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.
Ben Harris [Mon, 30 Dec 2024 23:15:54 +0000 (23:15 +0000)]
Add data for overriding 'aalt' sometimes
Not used yet.
Ben Harris [Sun, 29 Dec 2024 18:45:47 +0000 (18:45 +0000)]
Sort glyph names in compatcheck
Ben Harris [Fri, 27 Dec 2024 18:56:38 +0000 (18:56 +0000)]
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.
Ben Harris [Fri, 27 Dec 2024 12:08:37 +0000 (12:08 +0000)]
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.
Ben Harris [Fri, 27 Dec 2024 11:58:32 +0000 (11:58 +0000)]
Use new generic glyph names in rom.ps
Output confirmed to be unchanged
Ben Harris [Tue, 24 Dec 2024 00:25:54 +0000 (00:25 +0000)]
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.
Ben Harris [Mon, 23 Dec 2024 23:39:20 +0000 (23:39 +0000)]
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.
Ben Harris [Mon, 23 Dec 2024 23:22:45 +0000 (23:22 +0000)]
Add name checking to compatcheck
This tries to ensure that sensible ways of specifying a font by name
continue to work across an upgrade.
Ben Harris [Mon, 23 Dec 2024 14:32:09 +0000 (14:32 +0000)]
compatcheck: actually exit with failure if a check fails
Ben Harris [Mon, 23 Dec 2024 14:25:42 +0000 (14:25 +0000)]
Add a comment explaining what compatcheck does
Ben Harris [Sun, 22 Dec 2024 00:53:37 +0000 (00:53 +0000)]
SN74S262/3 pinout
The XM11 application note mentions "two chip enables", which can only
be pins 14 and 15.
Ben Harris [Fri, 20 Dec 2024 21:41:29 +0000 (21:41 +0000)]
More descriptive names for variant characters
This means yet more compatibility aliases, but I think it's the right
way to go.
Ben Harris [Fri, 20 Dec 2024 16:42:23 +0000 (16:42 +0000)]
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.
Ben Harris [Thu, 19 Dec 2024 13:46:58 +0000 (13:46 +0000)]
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.
Ben Harris [Tue, 17 Dec 2024 10:58:16 +0000 (10:58 +0000)]
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.
Ben Harris [Mon, 16 Dec 2024 22:27:24 +0000 (22:27 +0000)]
Correct the size of the parameter to glyph_footprint()
Ben Harris [Mon, 16 Dec 2024 22:22:01 +0000 (22:22 +0000)]
Fix the length of an accidentally variable-length array
Ben Harris [Mon, 16 Dec 2024 21:49:16 +0000 (21:49 +0000)]
Range-check argument to --bdfgen
Ben Harris [Mon, 16 Dec 2024 21:40:36 +0000 (21:40 +0000)]
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.
Ben Harris [Mon, 16 Dec 2024 21:31:21 +0000 (21:31 +0000)]
Remove an unnecessary shadowing variable
Ben Harris [Mon, 16 Dec 2024 21:26:35 +0000 (21:26 +0000)]
Add a few missing "static" keywords
Ben Harris [Sat, 14 Dec 2024 16:41:51 +0000 (16:41 +0000)]
compatcheck: detect vanished code points from fonts
Ben Harris [Sat, 14 Dec 2024 16:04:46 +0000 (16:04 +0000)]
Add a script to check backward compatibility
Ben Harris [Wed, 11 Dec 2024 22:34:53 +0000 (22:34 +0000)]
Some notes on TIFAX
Ben Harris [Mon, 9 Dec 2024 21:45:36 +0000 (21:45 +0000)]
Note the existence of HACKING in CONTRIBUTING
Ben Harris [Sun, 8 Dec 2024 18:48:30 +0000 (18:48 +0000)]
Small caps for new additions
Ben Harris [Sun, 8 Dec 2024 18:19:52 +0000 (18:19 +0000)]
A few modified Bs
Ben Harris [Tue, 3 Dec 2024 18:44:07 +0000 (18:44 +0000)]
Assign a PUA code point to Tbar.c2sc
Ben Harris [Tue, 3 Dec 2024 18:38:39 +0000 (18:38 +0000)]
Merge new characters and minor fixes
Converted to the new string-constant format in the process.
Neil Williamson [Mon, 25 Nov 2024 00:14:52 +0000 (00:14 +0000)]
A few additions, mostly to fill out Teletext character sets
[ from email ]
2. Regular unicode characters: a few additions, mostly to fill out
compatibility with Teletext character set ranges that were otherwise
almost-complete (which is basically everything except Arabic at this point)
per this reference page: https://al.zerostem.io/~al/ttcharset/[al.zerostem.io]
Some of the cyrillic additions are a bit dubious, but hopefully close enough
to pass.
Ben Harris [Tue, 3 Dec 2024 13:58:25 +0000 (13:58 +0000)]
Add some warning flags to the C compiler
I've chosen ones under which bedstead.c is currently clean, at least
using the versions of GCC and Clang currently in Debian stable.
Ben Harris [Tue, 3 Dec 2024 13:07:01 +0000 (13:07 +0000)]
Correct a printf %lX argument type
Also change another from "long" to "unsigned long" for consistency.
Ben Harris [Wed, 27 Nov 2024 13:43:42 +0000 (13:43 +0000)]
Set -dNOSAFER when running .bdf.ps programs
Ghostscript 10.03.1 and later disable the "makeimagedevice" operator
when running under -dSAFER. Even --permit-devices='*' isn't enough to
get it back. The release notes say that makeimagedevice has been
removed entirely, but that seems not to be correct.
Ben Harris [Wed, 27 Nov 2024 10:41:17 +0000 (10:41 +0000)]
Stop using %stdout for writing BDF files
Instead, pass the destination filename to the bdf.ps program and have it
open the file itself. This avoids capturing Ghostscript's own
diagnostics in the output file.
Ben Harris [Wed, 27 Nov 2024 10:30:20 +0000 (10:30 +0000)]
Correct a comment in rom.ps
It can make all ROM images now.
Ben Harris [Tue, 26 Nov 2024 22:11:11 +0000 (22:11 +0000)]
Convert ZVBI Private Use codepoints to compatibility aliases
That saves 4K of font file, which is nice.
Ben Harris [Tue, 26 Nov 2024 21:06:51 +0000 (21:06 +0000)]
Correct compatibility mapping of Wdieresis.sc
It will be generated if 'smcp' is applied to Wdieresis, and the
correct result of that is no change, since 'smcp' doesn't affect
capitals.
Ben Harris [Tue, 26 Nov 2024 20:59:47 +0000 (20:59 +0000)]
Convert 6-cell ".sep6" glyphs into compatibility aliases
Ben Harris [Tue, 26 Nov 2024 20:29:09 +0000 (20:29 +0000)]
Add COMPAT to a bunch more aliases
Ben Harris [Tue, 26 Nov 2024 14:34:15 +0000 (14:34 +0000)]
Add a flag to explicitly mark compatibility aliases
Only used on a few characters for now, though.
Ben Harris [Tue, 26 Nov 2024 02:03:23 +0000 (02:03 +0000)]
Mark obsolete characters in the glyph complement
A technique only slightly spoiled by the fact that nothing flags
obsolete characters yet, so it's actually marking every alias instead.
Still, it puts a nice diagonal bar across the affected characters
telling you to use a different one, which looks nice but may
obliterate the character rather _too_ effectively.
Ben Harris [Mon, 25 Nov 2024 22:44:19 +0000 (22:44 +0000)]
Actual aliases for old names of separated 4-cell graphics
That saves a few hundred bytes from the OTF.
Ben Harris [Mon, 25 Nov 2024 22:24:35 +0000 (22:24 +0000)]
Move *.sep4 glyphs to compatibility aliases
We've now got proper Unicode versions of them.
Neil Williamson [Mon, 25 Nov 2024 00:14:52 +0000 (00:14 +0000)]
Correct separated vs contiguous flag in ZVBI compat mappings
[ from email ]
One thing I wanted to query was the ZVBI mosaic graphics codepoints at
0xEE00 to 0xEE7F. The ZVBI code says (in lang.c):
" Table 47 G1 Block Mosaic is not representable
* in Unicode, translated to private code U+EE00 ... U+EE7F.
* (contiguous form has bit 5 set, separate form cleared)."
My reading of this is that the separated forms should therefore sit at
0xEE00-0xEE1F and 0xEE40-0xEE5F, with the contiguous forms at 0xEE20-0xEE3F
and 0xEE60-0xEE7F. This is indeed what the teletext1/2/4 fonts commonly
seen in teletext recoveries do; see for example
https://al.zerostem.io/~al/teletext/bbc1/1996-12-28-0008.1/100.html.
Bedstead maps these the opposite way around, however, and if you swap it in
on the linked page, all the contiguous and separated mosaics will swap
places.
Ben Harris [Mon, 25 Nov 2024 19:40:15 +0000 (19:40 +0000)]
Beginning of notes on HP terminal large letters
Ben Harris [Mon, 25 Nov 2024 10:35:39 +0000 (10:35 +0000)]
Add 4-cell separated graphics at their proper Unicode code points
I hadn't noticed that they're included in the Symbols For Legacy
Computing Supplement as well. Apparently they were part of the Sharp
MZ character set.
Ben Harris [Sun, 24 Nov 2024 20:17:17 +0000 (20:17 +0000)]
Update version in which Wdieresis.sc alias was added
Ben Harris [Sun, 24 Nov 2024 20:15:05 +0000 (20:15 +0000)]
Something I missed from the 3.246 release notes
Too late for the actual release, sadly.
Ben Harris [Sun, 24 Nov 2024 16:23:45 +0000 (16:23 +0000)]
Update version to 3.246
New major version for vendor and foundry IDs and removing Mac Roman
support. Minor version indicates the sixth release of 2024.
Ben Harris [Sat, 23 Nov 2024 20:03:36 +0000 (20:03 +0000)]
Adjust bitmap of supported code pages
I've removed the Turkish code pages because I don't have letters with
breves yet. And I've removed the Latin-2 code pages because I haven't
come up with a good way to distinguish accented upper- and lower-case
'S'.
Ben Harris [Sat, 23 Nov 2024 15:04:56 +0000 (15:04 +0000)]
Remove some Unicode Character Range bits
I don't think Bedstead has enough coverage of these ranges to consider
them to be "functional":
47: Dingbats
62: Alphabetic Presentation Forms
68: Halfwidth and Fullwidth Forms
69: Specials
88: Musical Symbols + Byzantine + Ancient Greek
89: Mathematical Alphanumeric Symbols
Ben Harris [Fri, 22 Nov 2024 14:17:55 +0000 (14:17 +0000)]
Note what the various Unicode-range and code-page bits in 'OS/2' mean
I haven't actually checked whether they're right, though.
Ben Harris [Fri, 22 Nov 2024 13:49:06 +0000 (13:49 +0000)]
Comment explaining sFamilyClass
Ben Harris [Thu, 21 Nov 2024 21:02:34 +0000 (21:02 +0000)]
Merge line-drawing changes into pre-release trunk
Ben Harris [Sun, 27 Oct 2024 11:21:05 +0000 (11:21 +0000)]
Musical stave characters should join to the left
Ben Harris [Sat, 26 Oct 2024 21:42:27 +0000 (22:42 +0100)]
Separate flags for copying left column and top row
Having a way to specify that the half-brackets extend upwards but not
leftwards avoids all the rendering problems they were previously
suffering from. And I've spotted the VT100 scan-line characters,
which should be extended to the left but not upwards. Since the
middle scan-line is unified with a line-drawing character, they really
need to extend leftwards for symmetry, but extending scan-line 1
upwards would be a disaster.
So now there are two flags, JOIN_U and JOIN_L, to specify joining in
each direction. I've renamed the both-directions flag as JOIN,
because it's not just specific to line-drawing any more. I might
eventually want a JOIN_D to suppress hinting of the bottom edge of the
character, but I need to do some testing first.
Ben Harris [Sat, 26 Oct 2024 14:58:01 +0000 (15:58 +0100)]
Turn on line-drawing mode on long brackets etc
It doesn't work quite properly: some characters hit the left side of the
character cell, so I might want to separate the joins-leftward and
joins-upward flags.
Ben Harris [Sat, 26 Oct 2024 11:23:28 +0000 (12:23 +0100)]
Stop bold line-drawing characters overflowing character cell
In XLFD terms, Bedstead is a "character cell" font, where every
character fits entirely within its cell (defined by advance width,
ascent, and descent). Bedstead Bold maintained this because it
thickened into the unused column to the left of each character.
However, combining the new continuous line-drawing with emboldening led
to bold line-drawing characters that extended beyond their character
cell. This led FontForge to make the SPACING property of the BDF file
"M" (for monospace) rather the "C".
This commit simply clips the X co-ordinate of points in a bolded
character at zero. That's safe because line-drawing characters are
guaranteed not to be doing anything diagonal in the left-most column.
This is slightly ugly, in that the bold characters aren't quite so
algorithmically derived from the non-bold ones, but in most cases
there'll be another line-drawing character to the left anyway.
Ben Harris [Sun, 20 Oct 2024 17:10:52 +0000 (18:10 +0100)]
Make line-drawing characters join up
This is done my duplicating the top row of pixels upwards and the left
column leftwards. This is analogous to what MDA and other IBMish
adaptors do to expand eight-pixel wide characters to nine pixels on screen.
Ben Harris [Wed, 20 Nov 2024 20:17:55 +0000 (20:17 +0000)]
Increase version number for a potential pre-release
Ben Harris [Wed, 20 Nov 2024 20:06:02 +0000 (20:06 +0000)]
Turn on the ForceBold flag for bold fonts
As far as I can tell, FreeType ignores it, but I may as well turn it
on in case something pays attention.
Ben Harris [Wed, 20 Nov 2024 14:25:46 +0000 (14:25 +0000)]
Slightly ugly hack to bias middle stems upwards
By default, FreeType 2.12.1 prefers to move the middle stems of
characters like 'B' and 'e' downwards, which is ugly. By applying a
tiny tweak to the "hstem" commands for such stems we can persuade
FreeType to move them upwards instead. This wasn't a problem when we
were using FontForge because FontForge didn't use proper stem hints on
the baseline.
Ben Harris [Tue, 19 Nov 2024 23:38:46 +0000 (23:38 +0000)]
Fix vertical stem hints on bold condensed fonts
The weight needed to be adjusted to allow for the change in width.
Ben Harris [Tue, 19 Nov 2024 23:34:47 +0000 (23:34 +0000)]
Correct bold outlines
The weight-changing code in adjust_weight() depended on the direction
that outlines were drawn in, so when I changed the direction to match
that required by CFF, it started lightening the font when it should have
been boldening it. A lot of swapping "next" and "prev" has corrected
that.
Ben Harris [Tue, 19 Nov 2024 23:27:05 +0000 (23:27 +0000)]
Fix left and right edge hints at non-default widths
The magic numbers -21 and -20 shouldn't be scaled when the width of the
characters changes. The easiest way to fix this is to switch to
calculating the hints in actual font units. Only now of course that
will get bold fonts wrong...
Ben Harris [Tue, 19 Nov 2024 23:02:35 +0000 (23:02 +0000)]
Quell a few compiler warnings
Ben Harris [Tue, 19 Nov 2024 23:00:19 +0000 (23:00 +0000)]
Remove glyph footprint comment from XML output
It was only there for debugging and isn't generally helpful.
Ben Harris [Tue, 19 Nov 2024 16:00:00 +0000 (16:00 +0000)]
An idea about version numbers
Ben Harris [Tue, 19 Nov 2024 22:31:57 +0000 (22:31 +0000)]
Support cntrmask and hintmask operators in editor
Ben Harris [Tue, 19 Nov 2024 22:27:47 +0000 (22:27 +0000)]
Skip XML comments when reading charstrings in editor
Ben Harris [Tue, 19 Nov 2024 21:53:16 +0000 (21:53 +0000)]
Emit cntrmask operators
Ben Harris [Mon, 18 Nov 2024 23:29:57 +0000 (23:29 +0000)]
Counter-mask support in select_hints()
It detects evenly-spaced runs of at least three stems, which is a
surprisingly fiddly thing to code.
Ben Harris [Mon, 18 Nov 2024 14:13:15 +0000 (14:13 +0000)]
Use self-explanatory constants to specify alignment zones
This adds ALEFHEIGHT for the height of Hebrew letters.
Ben Harris [Mon, 18 Nov 2024 13:56:58 +0000 (13:56 +0000)]
Remove lower alignment zone at +1 pixel
I think I added it because a lot of mathematical operators (like '+')
have their bottom edge there. But such operators don't really need
their bottom edges aligned: it's much more important that they should
have their proper shapes and should have their centre lines aligned.
This only slightly improves the rendering of '+' in FreeType 2.12.1:
it's still asymmetric but the asymmetry is in a better direction.
Moreover, some glyphs with descenders like "section" are substantially
improved.
Ben Harris [Sun, 17 Nov 2024 14:03:47 +0000 (14:03 +0000)]
More-or-less functional edge hints
This gets me to the milestone where the new version isn't uniformly
worse than the old one when rendered by FreeType at 10.5 ppem (the
worst size I've found).
The big problem I still have is that letters with three horizontal
stems (like 'B') get their middle stem rounded down in this version
and up in 002.009. I think this is because FontForge generates and
edge hint and not a stem hint at the bottom of the character, which
also makes bottom stems rather fuzzy. This version gives sharper
stems, but the characters all end up looking top-heavy.
Ben Harris [Sun, 17 Nov 2024 13:43:08 +0000 (13:43 +0000)]
Support for edge hints in select_hints()
Which demonstrated plenty of bugs in the code generating them.
Currently edge hints only appear in a helpful comment.
Ben Harris [Sun, 17 Nov 2024 10:11:23 +0000 (10:11 +0000)]
Process pixels in raster order
If we're imitating a CRT character generator, obviously we should
process pixels line-by-line, not column-by-column. But that means
writing "for (y ...)" before "for (x ...)" which isn't the instinctive
way I did it.
So now that's corrected and the Y loops are outside the X loops, which
should make any debugging output easier to follow. This has been
confirmed not to change FreeType rendering at 10.5 ppem.
Ben Harris [Sun, 17 Nov 2024 09:32:14 +0000 (09:32 +0000)]
Reverse (almost) all the paths
Type 1 fonts (and by extension CFF fonts) are required to have their
outer contours go counter-clockwise. Bedstead has always generated
outlines clockwise and depended on FontForge to correct them. Now
they're generated counter-clockwise as is proper, which will be fine
until I decide I want TrueType outlines instead.
This makes no difference to FreeType's rendering at either 20 ppem or
10.5 ppem
Ben Harris [Sat, 16 Nov 2024 23:39:30 +0000 (23:39 +0000)]
Switch hhints loop in emit_hints() so it counts forwards
Now that it only touches the input array once, it's much simpler to do
the y-axis inversion there.
Ben Harris [Sat, 16 Nov 2024 23:33:30 +0000 (23:33 +0000)]
Some infrastructure towards edge hints
There are places to record them now, but they're ignored by
select_hints() and emit_hints().
Ben Harris [Sat, 16 Nov 2024 18:58:41 +0000 (18:58 +0000)]
Separate selecting usable hints from emitting them
Now there's a select_hints() function that decides what hints should
be emitted, and emit_hints() just handles putting those hints into a
charstring. I hope this will make each function reasonably simple.
Importantly, it means that select_hints() can be called twice, once
for horizontal stems and once for vertical ones.
Ben Harris [Sat, 16 Nov 2024 14:41:43 +0000 (14:41 +0000)]
Change version number so pre-release fonts are distinguishable
Ben Harris [Sat, 16 Nov 2024 14:40:47 +0000 (14:40 +0000)]
Correct baseline of BDF fonts
Ben Harris [Sat, 16 Nov 2024 11:35:03 +0000 (11:35 +0000)]
Pass --no-recalc-timestamp to TTX
Without that, it updates the "modified" field in the 'head' table,
which makes builds unreproducible.
Ben Harris [Sat, 16 Nov 2024 11:22:21 +0000 (11:22 +0000)]
Emit OpenType tables in a more logical order
TTX doesn't actually care what order we emit tables in: it will always
put them into the recommended order. So I've made the order something
that works correctly and that doesn't look too silly in TTX's console
output.
Ben Harris [Sat, 16 Nov 2024 11:07:29 +0000 (11:07 +0000)]
Update Web page for new generation procedure
Ben Harris [Sat, 16 Nov 2024 02:00:44 +0000 (02:00 +0000)]
Correct cap height in font headers
Ben Harris [Fri, 15 Nov 2024 20:45:01 +0000 (20:45 +0000)]
Put version number in glyph complement PDF
Now that we've got the version number in a constant, this is
convenient.
Ben Harris [Fri, 15 Nov 2024 00:48:34 +0000 (00:48 +0000)]
Extract version number from C file, not nonexistent SFD
Ben Harris [Tue, 12 Nov 2024 10:53:15 +0000 (10:53 +0000)]
Correct ordering of stem hints
The spec for Type 2 charstrings requires that all hstem hints must
occur before all vstem hints.
Ben Harris [Mon, 11 Nov 2024 23:20:23 +0000 (23:20 +0000)]
Ignore stem hints in editor
Though it would be neat if it could display them.
Ben Harris [Mon, 11 Nov 2024 22:28:40 +0000 (22:28 +0000)]
Add .DELETE_ON_ERROR target to Makefile
That ensures that output files of a rule get properly deleted if the
recipe fails, which is almost always correct.
Ben Harris [Mon, 11 Nov 2024 22:19:54 +0000 (22:19 +0000)]
Make the processing of SOURCE_DATE_EPOCH safe
And explain in excruciating detail why it's safe. It's only actually
safe on systems (like POSIX ones) where time_t is an integer type, but
I think that's good enough for me.
Ben Harris [Sun, 10 Nov 2024 10:49:28 +0000 (10:49 +0000)]
Support SOURCE_DATE_EPOCH
If set, it is used to set the "created" and "modified" fields in the
OpenType 'head' table. This means that builds of Bedstead can be
reproducible.
The current code just casts the "long long" interpretation of the
environment variable into a time_t. This is potentially undefined
behaviour, because time_t might be a signed integer type smaller than
"long long". But I can't find a way to properly range-check it. Even
in POSIX, where time_t is required to be an integer type, there
doesn't seem to be a constant that specifies its range.
Ben Harris [Sat, 9 Nov 2024 23:51:36 +0000 (23:51 +0000)]
Generate stem hints
These are generated from the glyph bitmap by a similar
pattern-matching arrangement that generates the outline. Then, like
emit_path(), there's an emit_hints() that turns them into valid
charstrings. The handling of overlapping hints could be cleverer: at
the moment we emit the leftmost-possible set of hints, but we collect
a histogram of where hints are needed so could instead emit the most
useful. Or even try to do hint substitution.
This makes the Bedstead Web page at 90% zoom much prettier than
before, but it's not as good as the FontForge auto-hinter managed.
Edge hints and counter hints will probably help.