609 Commits

Author SHA1 Message Date
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
Ben Harris
39d7e7fbdc 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.
2024-11-20 14:25:46 +00:00
Ben Harris
9a1a2e4966 Fix vertical stem hints on bold condensed fonts
The weight needed to be adjusted to allow for the change in width.
2024-11-19 23:40:54 +00:00
Ben Harris
534a4a311a 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.
2024-11-19 23:40:00 +00:00
Ben Harris
d4d05a4a73 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...
2024-11-19 23:40:00 +00:00
Ben Harris
3434aa062f Quell a few compiler warnings 2024-11-19 23:40:00 +00:00
Ben Harris
05decf272d Remove glyph footprint comment from XML output
It was only there for debugging and isn't generally helpful.
2024-11-19 23:40:00 +00:00
Ben Harris
5e46500fb8 Emit cntrmask operators 2024-11-19 23:40:00 +00:00
Ben Harris
cf28bd71ef Counter-mask support in select_hints()
It detects evenly-spaced runs of at least three stems, which is a
surprisingly fiddly thing to code.
2024-11-18 23:29:57 +00:00
Ben Harris
52c2ad5e93 Use self-explanatory constants to specify alignment zones
This adds ALEFHEIGHT for the height of Hebrew letters.
2024-11-18 14:13:15 +00:00
Ben Harris
f273f0e98e 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.
2024-11-18 14:09:43 +00:00
Ben Harris
b74582bccc 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.
2024-11-17 14:03:47 +00:00
Ben Harris
347dcfd579 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.
2024-11-17 13:43:08 +00:00
Ben Harris
15b8a9a584 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.
2024-11-17 10:11:23 +00:00
Ben Harris
86f186342a 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
2024-11-17 09:36:54 +00:00
Ben Harris
f234538428 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.
2024-11-16 23:39:30 +00:00
Ben Harris
1ad04e13fa Some infrastructure towards edge hints
There are places to record them now, but they're ignored by
select_hints() and emit_hints().
2024-11-16 23:33:30 +00:00
Ben Harris
30d226f30f 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.
2024-11-16 18:58:41 +00:00
Ben Harris
1459c8cf93 Change version number so pre-release fonts are distinguishable 2024-11-16 14:41:43 +00:00