527 Commits

Author SHA1 Message Date
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
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
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
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
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
50d265d5c4 Small caps for new additions 2024-12-08 18:48:30 +00:00
Ben Harris
2b15178fcc A few modified Bs 2024-12-08 18:19:52 +00:00
Ben Harris
da53054c5c Assign a PUA code point to Tbar.c2sc 2024-12-03 18:44:07 +00:00
Ben Harris
a8c4150d5c Merge new characters and minor fixes
Converted to the new string-constant format in the process.
2024-12-03 18:43:48 +00:00
Neil Williamson
05ec415b07 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.
2024-12-03 18:26:23 +00:00
Ben Harris
f7e70aaf5f Correct a printf %lX argument type
Also change another from "long" to "unsigned long" for consistency.
2024-12-03 13:07:01 +00:00
Ben Harris
8070fb1300 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.
2024-11-27 10:51:38 +00:00
Ben Harris
3b71d537b4 Convert ZVBI Private Use codepoints to compatibility aliases
That saves 4K of font file, which is nice.
2024-11-26 22:11:11 +00:00
Ben Harris
cc6bbbd87c 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.
2024-11-26 21:06:51 +00:00
Ben Harris
54dbe30e7f Convert 6-cell ".sep6" glyphs into compatibility aliases 2024-11-26 20:59:47 +00:00
Ben Harris
6ce0438546 Add COMPAT to a bunch more aliases 2024-11-26 20:29:09 +00:00
Ben Harris
0cb087c526 Add a flag to explicitly mark compatibility aliases
Only used on a few characters for now, though.
2024-11-26 14:34:15 +00:00
Ben Harris
a2a863c12b 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.
2024-11-26 02:03:23 +00:00
Ben Harris
8790478527 Actual aliases for old names of separated 4-cell graphics
That saves a few hundred bytes from the OTF.
2024-11-25 22:44:19 +00:00
Ben Harris
8a5da75991 Move *.sep4 glyphs to compatibility aliases
We've now got proper Unicode versions of them.
2024-11-25 22:24:35 +00:00
Neil Williamson
69166f2639 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.
2024-11-25 21:35:35 +00:00
Ben Harris
79a75365ec 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.
2024-11-25 10:35:39 +00:00
Ben Harris
5b16154c0f Update version in which Wdieresis.sc alias was added 2024-11-24 20:17:17 +00:00
Ben Harris
894b5c2d4f 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.
2024-11-24 17:03:50 +00:00
Ben Harris
5a136179a6 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'.
2024-11-23 20:03:36 +00:00
Ben Harris
dbf23d231f 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
2024-11-23 15:04:56 +00:00
Ben Harris
e06dad5579 Note what the various Unicode-range and code-page bits in 'OS/2' mean
I haven't actually checked whether they're right, though.
2024-11-22 14:17:55 +00:00
Ben Harris
c798bea1f3 Comment explaining sFamilyClass 2024-11-22 13:49:06 +00:00
Ben Harris
4e069eec5e Merge line-drawing changes into pre-release trunk 2024-11-21 21:02:49 +00:00
Ben Harris
a252182ee6 Musical stave characters should join to the left 2024-11-21 20:55:51 +00:00
Ben Harris
860f76c16f 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.
2024-11-21 20:55:51 +00:00
Ben Harris
8974fd292c 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.
2024-11-21 20:55:51 +00:00
Ben Harris
664f000a59 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.
2024-11-21 20:55:51 +00:00
Ben Harris
013500fc79 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.
2024-11-21 20:55:51 +00:00
Ben Harris
0a15904d82 Increase version number for a potential pre-release 2024-11-20 20:17:55 +00:00
Ben Harris
769c6f5c3c 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.
2024-11-20 20:06:02 +00:00