Add new fonts to Meadow MicroGraphics Library
Here we demonstrate adding new fonts to the Meadow MicroGraphics Library
- Consolas
- IBM Plex Mono
- Sometype Mono
- BP Typewrite
- IBM 3270
- 52 Adafruit GFX fonts
- Microsoft .NetMF fixed fonts
- Petscii - character ROM dump
- Release the Hoard! - 37 Fixed width Yaff fonts from the Bitmap Hoard
- Font Hoard part II - 11 more wider fixed width fonts, custom Yaff Font Renderer
- Font Hoard part III - 39 Proportional Yaff fonts, mostly Mac and Lisa from the Bitmap Hoard
The Meadow.Foundation MicroGraphics Library supports drawing fonts in a few (now 8) fixed width sizes.
4x6 | 4x8 | 6x8 |
---|---|---|
8x8 | 8x12 | 8x16 |
12x16 | 12x20 | |
The smaller sizes may be appropriate for hand drawn fonts, but if we are converting higher quality desktop fonts, 12x20 is the only size that can support fonts with descenders. These initial attempts target fixed width or Monospaced fonts.
Consolas is a Microsoft font, used in visual studio, it may not be appropriate for open source use.
Although apparently Fonts are not Copyright protected
So I found 3 open source fonts, which ended up with a much smaller character set
Note Consolas has an Initialization fault in RC1 and RC2
IBM Plex Mono or on Github
monospacedfont or on Github
BP Typewrite may be the most distinct of these fonts. It is based on an italic font stood upwrite. Smaller set of characters.
A favourite for terminal fonts or code editing. This version comes from an OpenType font converted back to bitmap 12x20. It has many of the drawing symbols of the petscii font - at a larger size, and at less precision. This font has many unicode characters hence the double size screenshot.
from github
To use them in your meadow project, you just need to compile the font file into your application. Then
graphics.CurrentFont = new BPtypewrite12x20();
The Windows application to generate these font files is called FontConverter
from Adafruit. These are bitmap fonts, that are proportionatley spaced, and support text wrapping. I had to convert the C++ .h files into C#. There seems to be 3 font faces converted from Berkley Unix.
- Free Mono
- Free Sans
- Free Serif
Each font has four typefaces: Normal, Bold, Oblique (or Italic), and Bold Oblique (or Bold Italic) and appears in four sizes: 9pt, 12pt, 18pt, 24pt.
Normal | Bold | Oblique | Bold Oblique |
---|---|---|---|
Normal | Bold | Oblique | Bold Oblique |
---|---|---|---|
Normal | Bold | Italic | Bold Italic |
---|---|---|---|
There are also 4 additional extra small fonts, in one typeface each. Other than the TomThumb font, only the lower 7bit ascii characters are available. I have included a 4 times zoom of each of the small fonts so you can see the detail (or lack thereof).
To use GFX fonts in your Meadow project, you need to include the GFXFontBase.cs and the GraphicsLibraryEx.cs as well as any of the GFX fonts you want to use. DrawGFXText is used to display text. The x,y origin is for the left baseline of the character (not the upper left). The WrapText property can be enabled and text will be written on the next line if it doesn't fit on the current line.
More GFX font info: Here and Here
There are certainly other GFX fonts avaialble, including tools to convert to the GFX format. Adafruit says they will not expand the base fonts available on Github any further.
I found these in the abandoned .net Micro Framework repository. They include a few extended characters. The way the character bitmaps are laid out is much easier to hand edit if you want to.
Converted from C++ these are compatible with the Meadow Graphics Library Fonts (just include the font file).
The OG personal computer circa 1977 was the Commodore PET - 6502 processor, cassette deck, green text enclosed in an industrial steel case. This version of the ROM is from the SuperPet a weird work from home offshoot that had Pascal, Fortran and APL built in along with the MSBasic. So along with the famous line drawing characters, we also get some APL symbols and several other rare math symbols. The character set is mapped to unicode (rather than the original shiftable 7bit ascii). See the comments for which unicode character to use.
from 6502.org
and don't forget, the Meadow Graphics Library can also display fonts at 2X or 3X here is petscii at 2X (16x16)
Rob Hagemans has not only collected many historical bitmap fonts, he has also created a new storage format (Yaff) that is more human readable than most formats, and not too bad to parse.
These Fonts, are read by the YaffReader, which returns an IYaffFont which is an IFont that the Micrographics DrawText function can use. This means you can include the YaYaffReader.cs in your meadow application, along with any number of these Yaff files, and load and display the font at runtime. This consumes more memory than compiling the fonts, but being able to treat the fonts as files, instead of code is more convienient.
Topaz | |||
---|---|---|---|
Xen | |||
Nudel | |||
MagicWB XCourier | |||
Courier | |||
Apple Mac
Gacha and Monaco are two of the few fixed Mac Fonts. There are a few slightly smaller versions of both.
Gacha 7x13 | Monaco 7x16 |
---|---|
Classic | ST 6x6 | ST 8x8 | ST 8x16 |
---|---|---|---|
There are several other sizes for these fonts in the hoard
DrDos 8x19 | Gem 3.1 6x6 | Viewmax 8x8 |
---|---|---|
Feld-Hell Typenbildschreiber 7x14 | Hellschreiber T-Typ 72 GL 7x14 | Hell-80 7x9 | GTL Telewriter 7x8 |
---|---|---|---|
Abtastfernschreiber 8x14 | |||
VT-52 | VT-100 | VT-220 |
---|---|---|
funky g and lightning tilda | Desenders and line drawing characters | Accented characters, backward ? |
There are other regional versions with slightly different characters as well
Windows 3.1 Terminal
Like the Mac fonts, most are proportional. There are also older versions from Windows 1.0-3.0
Terminal 140 | Terminal 8514 |
---|---|
The Yaff renderer was designed for proportional fonts, as it takes a vertical slice of the character, and wider characters just have more slices. This is also true of fixed width fonts, and removes any limitations, or alignment requirements.
The YaffReader is used to read the yaff files, and the MicroGraphicsEx extension has a DrawYaffText method similar to DrawGFXText and the default DrawText in the base library. DrawYaffText can wrap text automatically, again similar to the DrawGFXText method.
Courier 24 15x23 |
---|
ST 16x32 |
---|
Lots of fonts of various sizes in this set too
LW Barrows 14x24 |
---|
Lots of OS/2 fonts available in various sizes and versions
Courier 15x25 |
---|
The Graphics Terminal had a larger 15x12 font and character set plus the abilty to add custom fonts
VT-320 |
---|
VT-320 Fonts from Paul Williams
Boothill | Future | Gothic |
---|---|---|
Jetpac | Mercy | Powerslave |
Classic 12 | classic 18 | Classic 24 | |
---|---|---|---|
Modern 14 | Modern 24 | System Patterns | System Text |
Toolkit | Window Manager | ||
BSD Banner | Epson FX Printer | Windows EGA System |
---|---|---|