dotfonter to put together three demonstration fonts, it seems like a useful time to post links to get pre-built copies of the fonts so you can use them without having to go to the effort of installing dotfonter yourself.
Unlike the last several posts, we wont be extending the tool. Although I will later write an article about font kerning and how I added support to dotfonter for that. One of the fonts I’m making available here has kerning tables.
This post is one of several describing a utility that will read a variety of textual descriptions of characters and produce a usable TrueType font.
Download all the current demonstration fonts from here in a single ZIP archive. The fonts included are described below.
Seven Segment Regular
This is presented in two forms. The first is a small font that covers only the hex digits:
0123456789ABCDEF For sanity, the six letters are in the table at both their upper and lower case codepoints. Note that the actual character design does not attempt to distinguish upper from lower case.
You can use the simple font if all you need are those sixteen character forms.
The four punctuation marks “period” (
.), “comma” (
,), “colon” (
:), and “semicolon” (
;) are also included, as is a character with all 10 segments lit up mapped to the code point for “number sign” (
Seven Segment Extended Regular
This is the second form of a segmented display font. In addition to all the features of Seven Segment Regular, it includes a kerning pair table which will kern the punctuation marks up close to the hex digits. This makes it easier to draw simulations of instrument faces that include dot and comma, or clocks that use the colon. In practice on real displays, the punctuation is always shown along with a digit to its left, because that is how the typical physical display component is built. Not all applications support kerning, and some that do (such as Microsoft Word) require that you enable an advanced font option for text that you want to have kerned.) The kerning is much more severe than with typical fonts, and if used will cause the digit and punctuation to appear to occupy the same space.
The other feature (which is responsible for most of the file size) is a complete enumeration of all 1024 patterns of the 10 segments, in the first Private Use Area beginning at
U+E800 and extending through
U+EBFF. The segments are arranged as follows:
+-a-+ f b +-g-+ j e c +-d-+ h i
and coded with the principle segments
a on bit 0 through
g on bit 6, and the punctuation segments
h on bit 7,
i on bit 8, and
j on bit 9.
To display a particular bit pattern, sum up the bits corresponding to lit segments, and add the result to 0xE800 to find the corresponding Unicode private use area code point.
Note that the kerning table deliberately does not cover any of the private use characters so that they will always be displayed in fixed pitch with no surprises. To display the dot to right of a digit, simply add 0x80 to the code point for the digit’s segment pattern.
Five by Seven Dot Matrix
This font contains characters styled after a typical character generator rom for a dot matrix display, based on 5 by 7 dot character cells. Single character display packages were readily available containing 35 individual LEDs arranged on a grid and pinned out to be scanned a row (or column) at a time. Today, this form of character is most frequently seen as LCD display modules with anywhere from 1 row of 8 characters to 4 rows of 20 characters.
This version of the font is styled with nearly circular dots, and as such is better visual match to older LED based devices. The typical LCD panel has square dots.
The ASCII characters covered are code points U+0021 through U+007E, along with a checkered block at U+007F and a black block at U+00FF.
I have not considered making characters covering all possible dot patterns. A 5×7 display has 35 dots, and Unicode itself only has 1,114,112 code points, a tiny fraction of the number required to represent all dot patterns. A font enumerating all dot patterns would be huge, even considering modern disk drives.
Punched Paper Tape
This font provides all 256 hole patterns available on nine-track one inch punched paper tape, including the sprocket hole on track 4. It also has coverage of the basic printable ASCII characters, making it easy to assemble display headlines that have the right hole patterns.
If the font is printed on paper at 72 point, the image of the tape will match real paper tape, with ten columns of holes per inch.
The ASCII characters covered are code points U+0021 through U+007E. All 256 8-bit patterns are at code points U+EE00 through U+EEFF.
These fonts are all licensed for use under the Creative Commons Attribution 4.0 International License (CC-BY).
Unzip the archive to find several TTF files. The ZIP may also include documentation or source code which you won’t need for installation. Of course, any documentation may help use a font with features more advanced than simple coverage of ASCII printable characters.
In modern versions of Windows (certainly anything newer than Windows XP) you can double-click the TTF file then click the Install button to install the font, or right-click the font and pick Install. Either will have the same effect.
If using the font with an application that doesn’t require fonts by installed on the system, consult the application’s documentation for instructions.
If using a Mac or Linux, the TTF files I’ve build should work. If you try them, please let me know of any issues you find, especially if those can be addressed by fixing
dotfonter for better cross-platform compatibility.
Updating an installed font on Windows
To update a font you have previously installed, locate it in the Fonts page of control panel, select it, and click Delete. In my experience, installing a second copy of a previously installed font will cause confusion rather than a clean upgrade. In short, don’t do that.
If you did do that, first uninstall the font from the control panel as usual. Then open an Administrator command prompt, and
dir myfont*.ttf to see how many copies are of your font file are still present in the fonts folder. If, after deleting the font with control panel, you have no copies at all, you are fine. Otherwise, if
dir lists several (usually named
myfont_1.ttf, and so on) then delete them from the command prompt. Now install the new version of your font and play.
Playing Along at Home
Clone the public fossil repository.
The version of the code described in this post is from checkin [4b953090b9].
There are still a lot of features missing from the script, but the bones are there to build upon.
dotfonter.lua defers to an external file for both the shapes of the segments and the ROM image itself. This post shows that the external file alone had enough power to define a five by seven dot matrix font.
Here are some tools I’m using to develop this utility:
Documentation and references:
Watch this space for more articles about work in progress on the utility.
The code I have running today has created several TTF fonts from scratch modeled after seven segment displays, dot matrix displays, and punched paper tape. covering only the digits, and a few letters. The output is styled after a five by seven dot matrix display and is a fixed pitch font.
Things I’d like to do next include:
dotfonteras a finished tool for wider release.
- Build in better support for kerning and other advanced features.
- Build a square-dot variant of the dotmatrix font for the LCD panel look.
- Make an italic variant of the seven segment to match common real displays.
- Consider a 5-bit tape or an 80-column Hollerith card font.
What I actually do next will likely depend on what I need out of the tool next, and might not even be from that list.
After making a dot matrix display font by hand using the impressive capabilities of FontStruct, I decided I wanted a tool to make the whole process easier. The result is the work in progress currently named
If you have a project involving embedded systems, micro-controllers, electronics design, audio, video, or more we can help. Check out our main site and call or email us with your needs. No project is too small!
+1 626 303-1602
Cheshire Engineering Corp.
710 S Myrtle Ave, #315
Monrovia, CA 91016
(Written with StackEdit.)