921 Commits

Author SHA1 Message Date
Ben Harris
5ffd5b23ef Styling for text <input> in bedstead.css 2026-01-13 21:42:18 +00:00
Ben Harris
15f9f591a1 webstead: more sensible viewBox for <svg> 2026-01-13 21:42:18 +00:00
Ben Harris
e6b411252b webstead: use a non-module <script> and import()
According to <https://github.com/fuweichin/xhtml5-esm-support>, an
internal script (a <script> element with content) can't be a module in
an XHTML page in Safari.  So following the suggestion on that page, I
make the <script> on the page into a classic script, and use import()
to load the module containing the bedstead executable.  Maybe this
will work on a reasonable selection of modern browsers.
2026-01-13 21:42:18 +00:00
Ben Harris
1edf533277 Set a content security policy in .htaccess
My Web site disables JavaScript by default, so we need to override
that if the Web editor is going to work.
2026-01-13 21:42:18 +00:00
Ben Harris
b62b0454b5 webstead: add Emscripten and musl copyright notices
Programs compiled with Emscripten end up statically linked against the
Emscripten runtime, which includes musl libc.  So we need to comply with
their licences by including a copy of the licence and the relevant
copyright notices.  I think putting them on the webstead page in small
print is probably the best approach.

This might need updating each release to match the version of Emscripten
that I build the editor with.
2026-01-13 21:42:18 +00:00
Ben Harris
0e23fc6658 Makefile cleanups for webstead
Add -sINCOMING_MODULE_JS_API because in newer Emscripten -sSTRICT
empties it.  Remove -sMODULARIZE because -sEXPORT_ES6 implies it.  Add
-O2 since the compiled code will probably be run more than once.  Pass
standard compiler flags to emcc.  Build bedstead.js in all-web, and
remove it in clean.
2026-01-13 21:42:18 +00:00
Ben Harris
c99994e91d webstead: prefer querySelector[All] over getElement*
It's a bit shorter, a bit more general, and allows me to properly
query only input elements that are children of the table of pixels.
2026-01-13 21:42:18 +00:00
Ben Harris
e6c1e44db0 webstead: mark script as async
Apparently Chromium can't cope with "defer" scripts (which modules are
by default) in XHTML documents.  But "async" scripts work properly,
so now we use one of those and then wait for DOMContentLoaded as
necessary.
2026-01-13 21:42:18 +00:00
Ben Harris
295660b1f9 webstead: set color:inherit on tickyboxes
Chromium's browser stylesheet overrides this.
2026-01-13 21:42:18 +00:00
Ben Harris
96ee19d038 webstead: put border on tickboxes, not table cells
That means the borders are clickable, which is what I want.
2026-01-13 21:42:18 +00:00
Ben Harris
7ba57f2e27 webstead: scale input and output better with window size
It turns out that setting --pix to 7vmin, while rather unprincipled,
does actually work quite adequately.
2026-01-13 21:42:18 +00:00
Ben Harris
64b18f30bb webstead: use currentColor for checked background
This means that webstead.xhtml doesn't know anything about the colours
in bedstead.css.
2026-01-13 21:42:18 +00:00
Ben Harris
8825e680dd webstead: use <pre> for C code 2026-01-13 21:42:18 +00:00
Ben Harris
74463d2a76 webstead: generate initialisers to paste into bedstead.c 2026-01-13 21:42:18 +00:00
Ben Harris
02514737cd webstead: slight CSS simplification
Don't need to specify border colour if it's the current colour anyway.
2026-01-13 21:42:18 +00:00
Ben Harris
e1e16471c8 webstead: better layout 2026-01-13 21:42:18 +00:00
Ben Harris
3a6e2bc265 webstead: almost-acceptable pixel-looking input 2026-01-13 21:42:18 +00:00
Ben Harris
70cbbde7f9 webstead: slightly cleverer path translation
Now paths with successive rlineto operations (to avoid overflowing the
Type 2 stack) work.
2026-01-13 21:42:18 +00:00
Ben Harris
357fbbc829 webstead: SVG transform to turn output right way up 2026-01-13 21:42:18 +00:00
Ben Harris
568d7f43ab webstead: properly ignore cntrmask 2026-01-13 21:42:18 +00:00
Ben Harris
09c777481b webstead: input from an array of tickyboxes 2026-01-13 21:42:18 +00:00
Ben Harris
6cf53005fe webstead: make a named function to update the rendered glyph 2026-01-13 21:42:18 +00:00
Ben Harris
111484a4f1 webstead: SVG rendering by extremely crude regexps 2026-01-13 21:42:18 +00:00
Ben Harris
1a49f8d120 webstead: use standard bedstead.css 2026-01-13 21:42:18 +00:00
Ben Harris
fb377b66af Capture output in HTML 2026-01-13 21:42:18 +00:00
Ben Harris
861c4749e6 Minimal build system and test page for Bedstead-in-WASM
Just allows for typing a command line and seeing the output.
2026-01-13 21:42:18 +00:00
Ben Harris
a0a11e9e34 Use text/plain for all-caps filenames in .htaccess
There are various text files in the Bedstead sources (and hence on the
Web site) that have conventional names in all caps, like NEWS.  These
should be served as text/plain.  That can be achieved in Apache using
a <FilesMatch> block and ForceType.
2025-10-19 00:07:51 +01:00
Ben Harris
245ab8e819 Add more compressible types in .htaccess
It looks like by AddOutputFilterByType directive somehow overrides the
defaults, and also there are a few more types that could usefully be
compressd.  So now it lists all the compressible file types in the
directory.
2025-10-18 23:45:47 +01:00
Ben Harris
81fdc813c9 Enable "deflate" filter for XHTML and fonts in .htaccess
The configuration on chiark already compresses most HTML content
types, and OTF fonts (especially Bedstead) are very compressible.
2025-10-18 17:31:40 +01:00
Ben Harris
b51e2a479d Remove .sfd from .htaccess file
We don't serve and SFD files any more.
2025-10-18 17:27:23 +01:00
Ben Harris
401ac714c5 Add a paragraphs about the other semi-graphics Bedstead can do
They could probably do with examples as well.
2025-10-04 16:49:15 +01: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
3eb79d1b2a Notes on what the missing 8-cell mosaics are unified with 2025-09-23 23:23:44 +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