652 Commits

Author SHA1 Message Date
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
c2e45853f7 Use EXIT_SUCCESS and EXIT_FAILURE
This is a bit of C pedantry.  POSIX requires that an exit status of
zero is success and non-zero is failure, but the C standard says no
such thing.  Instead it provides EXIT_SUCCESS and EXIT_FAILURE.  Since
Bedstead aspires to work on non-POSIX systems, it should use the
defined constants.  Also removing magic numbers is a good thing.
2024-11-10 09:27:31 +00:00
Ben Harris
cba03ce5fd Make it safe to call fullname_to_fontname() twice 2024-11-10 09:23:15 +00:00
Ben Harris
4db0ea6bc1 Another capital esszett link 2024-11-10 09:22:21 +00:00
Ben Harris
79cbd69c83 Map the .notdef character at U+F1FF
It should be the DEFAULT_CHAR in BDF, but that needs it to have an
encoding.  U+2395 APL FUNCTIONAL SYMBOL QUAD happens to look
identical, but I don't think I should rely on that.
2024-11-01 20:36:23 +00:00
Ben Harris
602c0aba1b Correct Wdieresis small-cap
Wdieresis.sc is obviously wrong: a capital shouldn't have an 'smcp'
mapping.  A 'c2sc' mapping for that character would also be wrong
because it's already squashed to fit under its accent.  On the other
hand, there should be a wdieresis.sc that maps to the upper-case,
because the characters are slightly different.

Wdieresis.sc is retained as a compatibility alias (for Wdieresis),
just in case.
2024-10-29 22:39:04 +00:00
Ben Harris
c08373b172 SAA5050 reverse-engineering links 2024-10-29 10:57:43 +00:00
Ben Harris
6863a1cf39 Add headings in NOTES 2024-10-29 10:57:36 +00:00
Ben Harris
b7a13dd61b Move dot in Ldot and corresponding small cap leftwards
It should be centred between the uprights of the Ls, and that makes it
so.  Sadly, it's not possible to do the same for the lower-case.

Also add a relevant link to NOTES.
2024-10-29 00:42:27 +00:00
Ben Harris
3653fab92e Some thoughts on UnitsPerEm 2024-10-28 15:05:11 +00:00
Ben Harris
be0055420f Explicitly set OS2Vendor to 'PfEd'
That's the default value that FontForge uses.  I'd like to change it,
but fontconfig makes it available to applications as "foundry" and I
somehow ended up with Emacs recording that in its configuration.  So if
I'm going to make that change I think it should go with a major version
bump.

But at least I can make sure it doesn't change unexpectedly and give
myself somewhere to make the change when it comes.
2024-10-27 11:56:30 +00:00
Ben Harris
b2bda72f72 Stop dopalt() reading off the end of the character bitmap
Spotted by GCC -Warray-bounds.
2024-10-26 19:00:39 +01:00
Ben Harris
e129bcd034 Update editor to emit the new style of character bitmap 2024-10-26 18:58:25 +01:00
Ben Harris
e303c792d3 Switch to using string constants for character bitmaps
Future versions of C are likely to make octal integer constants
obsolescent.  Switching to something non-obsolete seems wise, and also
using octal character constants saves eight characters per line that I
can use for other things.

I did consider just using one character per row, but I think that might
be a little too hard to read.
2024-10-26 16:25:14 +01:00
Ben Harris
a1715eff49 Tidy up Creative-Commons-related verbiage in HACKING
Specifically, "declaration" is not a usual noun for CC0, and "Creative
Commons" isn't usually followed by "Corporation".
2024-10-24 00:01:29 +01:00
Ben Harris
77efacaa0a Add some SPDX-License-Identifier headers
In places where they don't get in the way.
2024-10-24 00:01:26 +01:00
Ben Harris
32079c7b75 Make co-ordinate systems more sensible
The SAA5050 character images appear at the bottom-right corner of the
character cell, with a blank pixel to the top and the left.  This can
be seen if you put am alphanumeric character and a mosaic graphics
character side-by-side, since mosaic graphics characters fill the
entire character cell.

However, when I first made Bedstead, I put the character images in the
top-right corner, and the co-ordinate system matched that.  When I
fixed this in 2013 (commit 7bea0c6fadc35de50ea08eb184d4b15a7b411ef3),
I just did it by adjusting the final transformation of the vector
co-ordinates, leaving all the internal co-ordinate systems intact.
This was visible when I added mosaic graphics, which had to be offset
by one pixel to compensate.

Now I've finally corrected the problem somewhat properly.  Pixel
co-ordinates count from (0,0) in the top-left corner of the character
cell.  Vector co-ordinates count from (0,0) in the bottom-left corner
and are offset to the baseline on emission.  The conversion between
the two forms is still weirdly spread all over the place though.
2024-10-21 09:31:57 +01:00
Ben Harris
6bac55c65b Update version to 002.009
This release is just to give the Debian build a more sensible base to
work from.
bedstead-002.009
2024-10-19 21:02:11 +01:00
Ben Harris
13228ac77e State default author/licence in HACKING
Now that all the files are either mine or have other explicitly stated
authorship.
2024-10-13 16:09:28 +01:00
Ben Harris
ea66bc5fbe Update HACKING document for editor changes 2024-10-13 15:06:41 +01:00
Simon Tatham
d523da3671 editor: miscellaneous source cleanups.
Apparently I didn't know about chained comparisons when I wrote this
code, so I didn't take the opportunity to write '0 <= x < limit'.

Also, removed the wildcard import from tkinter, replacing it with
explicit references to the things needed. There weren't that many of
them, so I think the 'import *' didn't gain much.
2024-10-13 15:04:53 +01:00
Simon Tatham
67290ddd01 editor: better error message on paste failure.
Apparently I was incredibly lazy at some point in the past and forgot
to say what the problem was when the paste data couldn't be matched
against the regex.
2024-10-13 15:04:53 +01:00
Simon Tatham
4ce96879d8 editor: better ways to find the bedstead executable.
Previously the editor just expected to find it in your cwd. Now by
default it looks in the same directory as its own script, which means
you can run it from some other directory.

Also, I've provided a command-line option to override the default, in
case you keep the executable somewhere else again.
2024-10-13 15:04:53 +01:00
Simon Tatham
384c5a305c editor: put all the Tk work into a class.
The previous code organisation had a tiny 'Container' classlet that
held all the mutable variables, just so that all the event handler
functions could reach into it and modify it without having to faff
with 'global'.

But if you're going to make that much of a class, it makes more sense
to go further, and make all those functions _methods_ of the class. So
here's a reorganisation that wraps up the Tk code into a more or less
conventional class structure.

The patch for this commit looks like a total rewrite, but it's not
really: everything is indented further to the right (with a couple of
reflowings of long lines), and a lot of variables have a new 'self.'
on the front, but in other respects the code is substantially
unchanged.
2024-10-13 15:04:53 +01:00
Simon Tatham
cfab21f7a7 editor: commit to Python 3.
At the time I wrote this editor, it was sensible to try to be Python
2/3 agnostic. P2 is now thoroughly obsolete, so I've removed the P2
affordances. That lets me fix the shebang line to say 'python3', and
chmod the file +x, so that you can run it by its name.

Also, it can be renamed to just 'editor', because now that it's
executable, the fact that it's in Python is nothing but an internal
implementation detail.
2024-10-13 15:04:53 +01:00
Simon Tatham
61ed1e1f76 editor.py: add a comment including authorship and licence.
Ben is trying to make Bedstead into a Debian package, which involves
clarifying copyright and licences anywhere it's unclear. When I
contributed this editing tool I did it on a very informal basis ('look
at this fun hack!') and didn't make that clear. Time to fix that.
2024-10-13 15:04:53 +01:00
Ben Harris
7d3e0454e6 Remove ZVBI-derived comment and code tables from NOTES
For the most part they're not useful, and they're arguably under the GNU
GPL.  I've replaced them with an original prose description of some of
the interesting facts.  For everything else, you can go to ZVBI itself.
2024-10-12 23:35:54 +01:00
Ben Harris
4cf2d9d354 Proper licence etc for ZVBI bits in NOTES
ZVBI is under LGPL v2, but the NOTES file isn't a library so I need to
licence the excerpt under GPL v2 instead.  But actually I think I want
to remove that text, so this is just to legitimise the distribution of
the Git history.
2024-10-12 22:55:03 +01:00
Ben Harris
65df740a33 Correct SAA5050 ROM encoding
The character at 6/0 is emdash (5 pixels long), not endash (4 pixels
long).
2024-10-12 17:05:57 +01:00
Ben Harris
8d58b7485c Add a HACKING file that's a guide to the source code
Suggested by Ian Jackson.
2024-10-12 16:28:35 +01:00
Ben Harris
6bf599f447 Update version to 002.008 bedstead-002.008 2024-10-05 13:06:39 +01:00
Ben Harris
69ccb47499 Add U+2001 EM QUAD
It's canonically equivalent to U+2003 EM SPACE, so we should have
both.
2024-10-05 12:36:53 +01:00
Ben Harris
0cd03defca CSS: switch to monospace
Safari badly misdisplays Bedstead in proportional mode.  This is
caused by a bug in WebKit, and I haven't found an acceptable
workaround.  Thus, I think the best thing to do is to turn off
proportional spacing on the Web page entirely.  I think it looks nice,
but even I'll admit that it's a little too tight, and I know others
prefer the monospaced version.

Also, I can't think of a way that a real chip anything like the
SAA5050 could produce proportionally-spaced text.  It's fundamentally
based on getting fed character data at a constant 1 MHz.  There's no
way it can ask for a character early because the previous one was
narrow.
2024-10-04 00:30:30 +01:00
Ben Harris
d23a7c9b5c CSS: use "background" shorthand property
It's more compact and works just as well.  In fact, I think it might
work better on browsers that support background-image but not
background-size.  On such browsers the entire rule will be ignored,
which is what I want.  If the background image can't appear at
precisely the correct size, it shouldn't appear at all.

Of course, ideally on a browser that fails to display the background,
the title also wouldn't fade out to the left.  I wonder if there's a
sensible way to achieve that.
2024-10-04 00:06:49 +01:00
Ben Harris
51f37a4975 More details on WebKit bug, including link to bug tracker 2024-10-03 23:18:47 +01:00
Ben Harris
79c1606966 Light HTML modernisation
The "sizes" attribute on the icon <links> wasn't allowed by XHTML 1.0
Strict, so I've removed the DOCTYPE for that.  Meanwhile HTML 5
doesn't want you declaring a <meta http-equiv="content-type">
specifying XHTML, so I've removed that as well.  So now it's
XML-syntax HTML 5, which seems sensible to me even if other people
don't like XML.
2024-09-27 21:01:35 +01:00
Ben Harris
f243706d38 Use no-break spaces in Web page
I added them to Bedstead so I may as well use them.
2024-09-27 20:21:23 +01:00
Ben Harris
dbf936f949 Convert the fading <div> in the Web page back to a <span>
HTML doesn't allow <div> inside <h1>.  I found before that using a
<span> caused the background not to work.  That seems to be down to CSS2
section 10.6.1, describing inline, non-replaced elements: "The height of
the content area should be based on the font, but this specification
does not specify how."

Happily, we can just define this particular <span> to be a block
element, so that it behaves like a <div> even though it's a <span>.
That works fine, and because we're only using it to get a well-defined
content area it doesn't matter if it's ineffective when the stylesheet
is missing.
2024-09-27 19:07:50 +01:00
Ben Harris
3b920b8698 Use EN DASH characters directly in Web page, without entities
The W3C HTML 5 checker objects to my use of "&ndash;" and I can't see
any reason why I should use it.  The page is unashamedly in UTF-8, so
there's not much benefit to singling out this one character for special
treatment.

The page is still officially in XHTML 1.0 Strict at the moment, but I
might want to change that, which is why I'm paying attention to an
HTML 5 checker.
2024-09-27 11:58:26 +01:00
Ben Harris
fff625c720 Add the GeoGebra file that I used to sort out PANOSE 2024-09-27 10:58:15 +01:00
Ben Harris
9c346371c7 Correct PANOSE Letterform value and extend to implausible weights 2024-09-27 10:57:22 +01:00
Ben Harris
11d38bb34e Rework PANOSE generation
The code predated the introduction of bold variants, so it was
significantly incorrect.  Also it appears that some software uses the
PANOSE classification to distinguish monospaced fonts.  After careful
study of the specification, I think all the variants of Bedstead can
be classified as text fonts, so I've removed the code that described
some variants as decorative.  Then I did some calculations and a lot
of playing around with GeoGebra to work out which parts of the design
space give which values of Stroke Variation, Letterform, and Midline.
2024-09-27 10:12:56 +01:00
Ben Harris
157eece073 A few more subscript letters 2024-09-26 17:50:34 +01:00
Ben Harris
1809b33380 Generate the backward-compatibility *.sep6 glyphs correctly
They should actually be separated, but I forgot to fix some pasted
text and so they weren't.
2024-09-26 17:24:26 +01:00
Ben Harris
20e3c2b8a8 Notes on a Safari display bug 2024-09-26 16:41:28 +01:00
Ben Harris
b5b40b0ba1 Add link to gitweb
It's in a rather weird place, but it's still useful.
2024-09-26 14:57:57 +01:00
Ben Harris
74e4de5b33 Add U+2003 EM SPACE as a blank mosaic graphics character
At least Noto Sans and Noto Sans Symbols2 think that EM SPACE should
be the same width as mosaic graphics characters, and I think we could
do with a space that doesn't get changed by 'palt'.
2024-09-26 13:31:51 +01:00
Ben Harris
b8afbee0dc Update version to 002.007 bedstead-002.007 2024-09-24 14:26:49 +01:00