629 Commits

Author SHA1 Message Date
Ben Harris
76462c8176 Update version to 3.261
Also polish release notes.
2026-02-07 15:44:14 +00:00
Ben Harris
ebe341b928 Slightly re-organise comments around feature definitions
I was just looking at the code and finding it confusing.  Maybe more
comments will help, but maybe generating XML with enormous piles of
preprocessory is intrinsically confusing.
2026-01-30 00:40:05 +00:00
Ben Harris
e0c668da75 Private-use code points for new glyphs
Old-style numerals at U+F130..U+F139.  Small caps at U+F187..U+F18C.
2026-01-29 23:13:08 +00:00
Ben Harris
562329c1b9 Make a couple more Unicode-related variables unsigned
This deals with some warnings when building with Emscripten.
2026-01-13 22:11:43 +00:00
Ben Harris
d418809b34 Tolerable rendering of variation sequences in glyph complement
I think I probably want a nice way to write "<= 0x10ffff" though.
2026-01-13 21:55:10 +00:00
Ben Harris
331392b073 Horizontal square brackets
I was looking for something completely different in the Unicode
Standard and found a note that U+23B4..U+23B6 can be used in terminal
applications with text printed vertically.  So obviously I had to add
them.

Apparently the same doesn't apply to the other horizontal brackets at
U+23DC..U+32E1, which are purely stretchy mathematical brackets and
not interesting to us.

The odd positioning in the character cell is based on the Unicode code
chart.
2026-01-13 21:55:10 +00:00
Ben Harris
15d1191aeb Emit a format-14 'cmap' subtable for variation sequences
Now I can put <U+0030, U+FE00> in an HTML file and Firefox will pick the
correct glyphs.
2026-01-13 21:55:10 +00:00
Ben Harris
69ac5c6bfd Beginnings of support for Unicode variation selectors
These are treated as particularly odd Unicode code points and packed
into the "unicode" field.  Currently only the encoding side is
implemented, withe the slashed zero, <U+0030, U+FE00>, as a motivating
example.

Generating a format 14 'cmap' subtable and properly formatting the
glyph complement are still to come.
2026-01-13 21:55:10 +00:00
Ben Harris
fa88f696c7 Add support for 'zero' (slashed zero) feature
This re-uses the old Oslash glyph I drew that had the slash entirely
inside the O.  I've seen something similar on simulations of old
character generators, though I'm not sure I've seen any actual character
generators using this shape.
2026-01-13 21:55:10 +00:00
Ben Harris
58496743a8 Switch to unsigned types for holding Unicode code points
We were only using negative numbers for the "no Unicode mapping"
constant, and even there it was mostly cast to unsigned before we used
it (because it needed to sort last).  So just using an unsigned type
throughout seems to be a bit cleaner.  It will also make me less dubious
about packing extra information in when I want to support variation
selectors.
2026-01-13 21:55:10 +00:00
Ben Harris
383a376372 Use a defined constant instead of -1 for "no Unicode mapping"
Partly on the principle that magic numbers should be avoided, but
mostly because I want to change it.
2026-01-13 21:55:10 +00:00
Ben Harris
0d85d45857 Use "unsigned long" when we need an unsigned Unicode type
On 16-bit systems, "unsigned int" won't get us beyond the Basic
Multilingual Plane.
2026-01-13 21:55:10 +00:00
Ben Harris
51ffa3eb33 Replace bare "unsigned" as a type name with "unsigned int"
I noticed some occasions where my attempts at 16-bit cleanliness had
failed because I hadn't noticed that "unsigned" was a species of "int"
and hence potentially only 16 bits.  So now I'm trying to be more
explicit and saying "unsigned int".

Next several of them will need to be replaced with something else.
2026-01-13 21:55:10 +00:00
Ben Harris
20d377ccb6 Correct formatting of a comment 2026-01-13 21:55:10 +00:00
Ben Harris
c43a34aaba Reduce MAXPOINTS a little
whitepixel() now generates at most 16 points per pixel, not 20.
2026-01-13 21:55:10 +00:00
Ben Harris
ce6d060613 Add assertions that we don't overflow the "points" array 2026-01-13 21:55:10 +00:00
Ben Harris
5f955f3c64 Remove a couple of spaces that just annoyed me 2026-01-13 21:55:10 +00:00
Ben Harris
36d6f142e1 Allow space for terminating null in struct glyph.data
GCC 15 gives a warning (-Wunterminated-string-initialization) if you
initialize an unsigned char array from a string constant such that the
terminating null character isn't included.  Bedstead does this in most
rows of the glyphs array, which is quite noisy.  I've chosen to work
around this by making the array one byte larger.  That doesn't
actually affect the size of the struct on systems that align struct
fields, so the major loss is that now we might not get warnings if we
overflow by one byte.

There are several other ways this problem could be solved.  One could
disable the warning entirely, but that would remove a valuable warning
from the rest of the program.  We currently disable two other warnings
for the sake of the glyphs array, but working around them would
require ugly changes on every line of the array.

Probably the ideal approach would be to tag the "data" field with
"[[gnu::nonstring]]".  That would not only suppress the warning but
also enable warnings if the array was ever passed to a function
expecting a null-terminated string.  However, I think Bedstead is
currently written in plain ISO C99, while attributes like that were
only standardised in C23.  I'm not averse to moving to a newer
standard, but C23 is a but _too_ new right now.  I'm also a little
reluctant to rely on the implementation-defined behaviour of
particular compilers, which is why I'm not using "#pragma GCC
diagnostic".
2026-01-13 21:55:10 +00:00
Ben Harris
557685b3d0 Remove "copyright" notice that isn't
I don't think it's appropriate to use 'name' string 0 (copyright
notice) for something that isn't a copyright notice.  Perhaps I should
have something other than a URL that explains Bedstead's copyright
situation, but that field isn't it.
2026-01-13 21:55:10 +00:00
Ben Harris
1b6203ed30 A few more 'name' strings
We now have a manufacturer, vendor URL, licensing URL, and sample text.
I've added an anchor to the Web page so to make the licensing URL more
useful.

Most of these are displayed by Firefox when listing the fonts used on a
page, so they seem like a good idea.
2026-01-13 21:55:10 +00:00
Ben Harris
bc8f7d8de0 Large type M and W vertex components 2025-10-04 16:32:55 +01:00
Ben Harris
a012883493 Remaining large type stem parts
The ones that aren't separately encoded provided a clear indication of
how the numbered stem parts are meant to relate to the named ones, so
there weren't actually many decisions to make.
2025-10-04 16:32:55 +01:00
Ben Harris
4158de0ee1 Lots of diagonal bits of large type pieces
This is essentially all of them apart from the W and M pieces.  There
turn out to be obvious places to have the diagonals cross character-cell
boundaries such that they should all join up.  Whether this gives and
aesthetically tolerable outcome, I'm not so sure.

The W and M pieces are a bit confusing, because they're meant to span
two character cells vertically, but the obvious design doesn't.
2025-10-04 16:32:55 +01:00
Ben Harris
512c4cbf95 Three more HP large type components
These are based on the existing arcs in obvious ways.
2025-10-04 16:32:55 +01:00
Ben Harris
939f395217 Initial HP large type pieces (U+1CE1A onwards)
This batch are the ones that can be implemented using the ordinary
box-drawing characters (and probably should have been unified with
them by Unicode).
2025-10-04 16:32:47 +01:00
Ben Harris
b4a690a5b6 Convert some 8-cell mosaic glyphs into aliases to 6-cell
Because in Bedstead the cell boundaries of 8-cell mosaic glyphs are a
superset of those for 6-cell mosaic glyphs, each of the existing
6-cell glyphs has an identical 8-cell glyph whose middle two rows of
cells are identical.  Thus, these 8-cell glyphs can be aliases for the
corresponding 6-cell glyph.  I've implemented this as a macro called
A() that can be mixed in with the existing O() macros in the section
of the glyphs table that generates U+1CD00..U+1CDE5, aliasing them to
characters in U+1FB00..U+1FB3B.  That makes the table even more
confusing, but at least it's compact.
2025-09-24 22:58:39 +01:00
Ben Harris
eca801e615 Add remaining 8-cell mosaic characters
These are the ones scattered across Unicode and not in the main
U+1CD00..U+1CDE5 block that weren't already present.  They're aliased to
the corresponding 6-cell characters.
2025-09-24 22:09:22 +01:00
Ben Harris
710b96e1f9 Main block of 8-cell mosaics in Symbols for Legacy Computing Supplement
These were mostly generated from UnicodeData.txt with a dodgy Perl
one-liner and an Emacs keyboard macro.  The dodgy one-liner was (wrapped
onto more lines):

grep "BLOCK OCTANT" ~/Downloads/UnicodeData.txt |
perl -pe '/OCTANT-(\d+)/; $i=""; map{vec($i,$_-1,1)=1}split(//,$1);
          $_=sprintf("%02X",ord($i))." $_";'

Now I need to find the characters elsewhere in Unicode that correspond
with the gaps in the table.
2025-09-23 22:53:26 +01:00
Ben Harris
c62b392553 Add support for generating 8-cell mosaic graphics
This follows the pattern of the 6-cell and 4-cell versions, but without
separated mode because Unicode doesn't have that.  This required making
the bitmap data into an unsigned char array to allow for using all eight
bits.

The cell boundaries are chosen so that they line up with existing 6-cell
and 4-cell boundaries.  So we have row heights of [3,2,2,3], which is
maybe less pretty than [3,2,3,2], but is more in keeping with the
existing mosaics.  Indeed, it means that the existing 4-cell and 6-cell
contiguous characters could be expressed in 8-cell terms if I wanted to.
2025-09-23 22:44:19 +01:00
Ben Harris
c53957312f Enlarge radius of box drawings arcs
Before, the diagonal parts were the same as in the capital O.  But that
was already a bit square, and the shapes one would draw with the box
drawing characters will generally be bigger.  So now I've cut a bit more
off the corners.  This means that arcs that join to the right need the
recent change to add JOIN_R in order to join up properly.

With this change, if you try to draw a circle with them, you get an
octagon with side lengths 2, 2.8, 6 instead of 4, 1.4, 8, which I think
is an improvement.
2025-09-22 22:24:09 +01:00
Ben Harris
4ca8a84daa Add JOIN_R and JOIN_D flags, and extend effects of JOIN_*
The new flags mark glyphs that join to the right and downwards.  The
effect of these, and a new effect of JOIN_U and JOIN_L, is to arrange
that getpix() treats pixels beyond the edge of the character cell as
repeating the last row of real pixels.

In practice, this means that a diagonal stroke touching the right or
bottom edge of the cell will now be drawn as though it turns into an
orthogonal stroke across the edge rather than as though it stops.  This
doesn't affect the outline of any existing glyph.

There is a more subtle consequence, which is that joining glyphs no
longer get edge hints on their joining edges.  I think that's an
improvement: such hints might move those edges so that they don't touch
the adjacent character, which would be rather unhelpful.
2025-09-22 22:24:02 +01:00
Ben Harris
d91aaf8186 Move various small caps to dedicated Unicode code points
Specifically, this adds:

U+1D0C LATIN LETTER SMALL CAPITAL L WITH STROKE
U+1D23 LATIN LETTER SMALL CAPITAL EZH
U+1D7B LATIN SMALL CAPITAL LETTER I WITH STROKE
U+1DF04 LATIN LETTER SMALL CAPITAL L WITH BELT
U+1DF10 LATIN LETTER SMALL CAPITAL TURNED K

Three of this had private-use encodings that appeared in earlier
Bedstead releases.  These encodings have been preserved for backward
compatibility.
2025-09-20 23:40:25 +01:00
Ben Harris
bac039f869 Add old-style numerals
I've designed new versions of 0, 1, and 2 that fit within the
x-height.  6 and 8 don't change at all (and are unmapped).  The other
digits are all moved down by two pixels so their top edges are at the
x-height and their bottom edges at the descender height.

This is very simple (and much simpler than my previous attempts), but
seems to be satisfactory.
2025-09-20 23:30:35 +01:00
Ben Harris
efee6ae9d5 U+01B7 LATIN CAPITAL LETTER EZH
It's just the lower-case moved up the baseline, but the small-cap is
new.
2025-09-08 23:16:01 +01:00
Ben Harris
68d1d54520 U+2C6D LATIN CAPITAL LETTER ALPHA
Used by at least one African language that we otherwise support, and
trivially derived from the lower-case.
2025-09-08 22:52:43 +01:00
Ben Harris
b9adf83301 Better UALIAS() macro
Now you _can_ pass an instance of U() as the first two arguments.
2025-09-08 21:49:47 +01:00
Ben Harris
8cb047830b More modifier letters of quotation marks
They're aliases of the normal versions.  I think Hawaiian probably
wants one.  Also converted modifier primes into aliases.
2025-09-07 18:13:50 +01:00
Ben Harris
97b8c443f6 Make all the capital Dcroat and African D into aliases of Eth
This saves a few bytes and avoids some repetition.
2025-09-07 18:04:48 +01:00
Ben Harris
b876f54283 Add a macro, UALIAS(), for aliases with Unicode mappings
ALIAS() is now implemented in terms of UALIAS().
2025-09-07 17:43:54 +01:00
Ben Harris
93dfb2508b U+0194 LATIN CAPITAL LETTER GAMMA
Hyperglot says that completes several more African languages including
Dinka.
2025-09-07 12:24:12 +01:00
Ben Harris
ad4a95dee9 U+019D LATIN CAPITAL LETTER N WITH LEFT HOOK
Hyperglot says this is all we're missing from Bambara, which has 4
million speakers.
2025-09-07 12:12:49 +01:00
Ben Harris
b47a87835d Finally solve the S-hachek problem
I had been trying to find an upper-case that was visibly distinct from
the existing lower-case, but I realised that I could do the same as we
do with accented 'o' and instead make a new lower-case version and
declare the existing glyph to be upper-case.  This seems to work
tolerably and removes the most embarrassing gaps in Bedstead's
repertoire.
2025-09-07 11:48:34 +01:00
Ben Harris
7de0d19e5b U+0197 LATIN CAPITAL LETTER I WITH STROKE
With a small-cap glyph and appropriate mappings.  Hyperglot says that
adds nine more languages.
2025-09-07 11:19:40 +01:00
Ben Harris
08df83095e U+01B1 LATIN CAPITAL LETTER UPSILON
It's just an upside-down Omega.  Hyperglot says that gains us support
for five more languages.  The small-cap is just the already-existing
lower-case.
2025-09-07 11:13:45 +01:00
Ben Harris
8fcb685ee3 Added some useful African capitals
Not cities, but capital versions of some letters we already had in
lower-case for IPA.  Specifically:

U+0186 LATIN CAPITAL LETTER OPEN O
U+0189 LATIN CAPITAL LETTER AFRICAN D
U+0190 LATIN CAPITAL LETTER OPEN E
U+0196 LATIN CAPITAL LETTER IOTA
U+01B2 LATIN CAPITAL LETTER V WITH HOOK

Between them, Hyperglot thinks this gains us useful coverage of
languages with a few tens of millions of speakers, which seems like good
value to me.

The all also have small caps, and in the case of the African D all the
capital-D variants.
2025-09-07 10:56:12 +01:00
Ben Harris
b39bef99df Proper names for Wgrave, wgrave, Wacute, wacute, Ygrave, and ygrave
Turns out that these are in AGLFN.  No compatibility aliases because
they never appeared in a release with the wrong names.
2025-09-06 23:36:26 +01:00
Ben Harris
e4359c014a Redesign U+028B LATIN SMALL LETTER V WITH HOOK
The International Phonetic Association's preferred sans-serif font
doesn't give this character a serif at the top left, so Bedstead
shouldn't either.  Also the bottom-left corner of the letter is subtly
curved, so I've rounded off that corner a bit as well.  The result is
more like the IPA's ideal and also easier to design a capital version
of.
2025-09-06 22:25:23 +01:00
Ben Harris
a72de29bc5 More-consistent 'W' glyphs
Now all of the caps and small caps have a central peak four pixels
above the baseline, and all of the lower-case have a central peak
three pixels above the baseline.  The outer arms vary as necessary to
accommodate accents and for small caps.
2025-09-06 10:18:20 +01:00
Ben Harris
6d9c0733e4 Add W/w with grave and acute
Hyperglot says these are needed for Welsh, and they're trivial to
draw.

There seems to be some confusion around the proper shape for small-cap
W in Bedstead; I should investigate this in more detail.
2025-09-06 10:18:10 +01:00
Ben Harris
fd6977574e Add Y/y with grave
They're trivial and Hyperglot says they're necessary for writing Welsh.
2025-09-06 10:17:18 +01:00