Herein lies a collection of fonts I've modified for PICO-8 programming. Why? I can't say, really, other than it was a small curiosity I was tempted to solve.
Screenshot of Sublime Text, Notepad++, and PICO-8, all displaying the same p8 file.
It came up elsewhere what the p8 encoding might be. It is clearly a custom form of Extended ASCII... or, as I think of it, P8SCII
(first! 😁). But that's just my opinion. Ask the author what he calls it, if anything. Regardless, it's an 8-bit character set right now and -- judging by where the current extended characters sit (on top of Windows 125x, ISO 8859-x, and Unicode control characters) -- forever. For more tables of this, see my P8SCII wiki.
P8SCII mapped to Windows 1252 (also the same mapping for ISO 8859-1, etc).
📣 If working on P8 code in an external editor, open and save with a DOS encoding if you can, such as Code Page 437. This works well in Sublime Text (as "DOS (CP 437)") and in Notepad++ (as either "ANSI" or "Western European -> OEM-US") and probably most others.
Saving as Windows 1252 can appear to preserve the embedded extended characters when using these fonts... but don't be fooled, you may find differently when you reload the file in PICO-8. To fix, reload in your editor as Windows 1252 and save as CP 437. ISO 8859-1 won't work unless you get really lucky with your editor ("No, your text editor!"). Feeling lucky? Saving as UTF-8 will destroy the encoding, for sure, with multibyte replacements.
In my opinion, however, it is safer to escape the extended P8SCII characters than embed them:
♥ = \135
or \x87
The comments here will, hopefully, tell you how to use the fonts in most editors, regardless of whether or not it is listed here.
Here are some useful preferences to set in "Settings - Syntax Specific" for your *.p8 files:
"font_face": "PICO-8 Raize",
"fallback_encoding": "DOS (CP 437)",
"default_encoding": "DOS (CP 437)",
"show_encoding": true,
"rulers": [32]
Sublime won't load OEM fonts (which may be just as well since some editors don't display them completely anyway) so use the non-OEM variants, mono or variable-width, your choice.
Note: Sublime has an odd limitation when working with bitmap FON fonts that a few of you may run into. That is, if you change the text zoom in Windows to, say, 150% (if you're on a high-DPI display and losing your youth vision like me), Sublime will not let you zoom all the way out with many FON fonts. The furthest I can zoom out in Sublime with my current Windows display settings is 2x the actual bitmap size for all FON files I have here thus far (I believe the Windows settings are part of the cause--not sure yet). The really bizarre thing is that Sublime will let you zoom all the way out on all but the smallest font in a FON file [if the file has more than one font in it]. Thus, the workaround might be to put a tiny font in all files (such as the 4x6 ROM font) but I don't care to go down that hacky road, so good luck getting Sublime to care enough to fix this.
If working with TrueType or OpenType fonts in Windows with Sublime, the secret to turning off antialiasing is to set GDI mode as well:
"font_options": [ "gdi", "no_antialias" ]
Another useful feature to enable is to install the Auto Fold package and modify it for *.p8 files to hide the non-code parts of the file. See: Using Sublime Text and Auto Fold with PICO-8 files.
Also, see: PICO-8 syntax highlighting in Sublime Text.
Notepad++ works well with any of these fonts. If loading and saving as "ANSI" use the OEM variants. If loading and saving as "OEM-US" use the non-OEM variants. Sounds a little backwards, eh? But it makes some sense if you understand how code pages get translated by OSs.
Note: If using TrueType fonts that contain the double-wide extended characters, Notepad++ doesn't always get the spacing right, at some sizes, for the gap between the single- and double-wide characters. For some wacky reason, Notepad++ sets its own character spacing.
You don't want to use Windows' Notepad because it doesn't support the Unix line terminators that PICO-8 uses. I thought I would mention it, however, because it is one of those programs that will only display correctly with the OEM variants of these fonts.
UPDATE: Notepad added support or Unix files in 2019 so, um, go ahead and knock yourself out with a notepad if you like.
Thus far, only one TrueType font (DejaVu) and a few Windows FON bitmap fonts are available here. I could convert the bitmap fonts to Unix/Linux types but I am not set up for testing those conversions so I'll wait for others to do that work, if anyone chooses to, and include them via pull request. But is that really needed anymore considering FreeType (for Linux, etc.) now supports FON as well?
Creating patch files for various vector fonts is also a possibility (such as for Consolas, what I currently use) but I have no plans to engage in such things at the moment because licensing would likely require that I patch them instead of mod them (which would then require maintaining patches for all the various versions scattered across the world). If you doing the mod yourself, this post of mine may be of some help: How To Make a Snap-to Grid In FontForge.
Suffix | Spacing | Encoding | Who |
---|---|---|---|
(none) | Double-wide extended chars | Win 1252, ISO 8859-1, etc | What most of you probably want |
OEM | Double-wide extended chars | OEM, Symbol | What most of the rest of you want |
Mono | Fully monospaced | Win 1252, ISO 8859-1, etc | The few, the unproud, the regular |
Mono OEM | Fully monospaced | OEM, Symbol | Old-schoolers |
I really didn't want to take the time to create this set -- because I don't see the point in punishing yourself with it -- I did enough of that with bad fonts and displays way back somewhere in the last century. Isn't the primary point of third-party code editors to bring consistency to all your languages... and not diversity? But, I knew I would be pestered for these anyway if I didn't create them, so here they are in all their "dune" glory (you might be able to figure out what that means if you find this 4x6 font to be worse than all other 4x6 fonts like I do). I even created these as multi-font FON files (same font in multiple bitmap resolutions) so that your editor should let you zoom in pretty big before Windows decides you're totally insane and replaces it with a default vector font.
- Windows FON fonts:
- PICO-8 ROM
- PICO-8 ROM OEM
- PICO-8 ROM Mono
- PICO-8 ROM Mono OEM
- In my opinion, you want these over the TTFs because they won't aa-blur on you.
- TrueType fonts:
- PICO-8 forum discussion: PICO-8.ttf + variants
- Hopefully, these will be updated soon to the Windows-1252/ISO-8859-1 mapping (so that I don't feel tempted to build my own). I'm not sure if the OEM mapping (Symbol encoding, really, in TrueType) is possible with the FontStruct tool these were created in.
- PICO-8 forum discussion: PICO-8.ttf + variants
This is the first font I worked on... because, well, it was just sitting there, begging to be tweaked, and it seems to have a bit of a fan base for some reason. I call this one a semi-sane choice for programming. It is a very VGA-ish 9x16. Plus, I added an extra line of "external leading" because it looks better with more line spacing. But, few editors pay attention to that attribute (HxD being the only one I tested that does) so you may want to tell your editor to vertically space it more. If you like Tektite, you can get the matching set of non-P8 versions (that I also modified a bit from the original Tektite font).
- Windows FON fonts:
- PICO-8 Tektite
- PICO-8 Tektite OEM
- PICO-8 Tektite Mono
- PICO-8 Tektite Mono OEM
- Matching fonts (which may also be good for roguelike games) hosted in my mkwinfont project:
- Tektite (Windows 1252, ISO-8859-1, "Font has XWindows encoding" option in PuTTY)
- Tektite OEM (CP 437, OEM-US, PC-8)
This one is a formerly-sane choice for programming. It is a squished VGA-ish of 8x12. This is a sample font that was included with some Microsoft sample code for building a FNT editor, ages ago. Thus, it sounds like public domain to me even though it looks suspiciously like an old version of Fixedsys. I did descend the brackets a bit -- the curly brackets were hardly recognizable. Otherwise, unchanged in the 7-bit region.
- Windows FON fonts:
This one is a fairly-sane choice for programming. It comes in many sizes so I chose the fairly large 11x22 regular for some variety here (maybe I should include the 11x22 bold as well... but I'm bored with this P8 font stuff already and anxious to get back to game building). I looked at ProFont, Proggy, Terminus, and a few others, and decided I liked Raize the best even though I'm not a huge fan of some of the squarish characters and dislike the high placement of +
and -
. So, now you have to live with it or make your own mod of your favorite. I'm not entirely sure it is licensed for modding like most of the others I looked at are; it is copyrighted by Raize Software and given out as free software with no license details.
- Windows FON fonts:
- Matching fonts:
- Raize Software - Three sizes in regular and bold, plus Unix/Linux versions
DejaVu Sans Mono is a really nice programming font. Maybe not the greatest... but its open-source-ity-ness (new word) made it a good TTF candidate for inclusion in this collection. (The FontForge source files are also found in this repo.) If you want to modify your own TTF files like this, my blog post that resulted from this work may help: How To Make a Snap-to Grid In FontForge.
- TrueType fonts:
- PICO-8 DejaVu
- PICO-8 DejaVu OEM
- PICO-8 DejaVu Mono
- PICO-8 DejaVu Mono OEM
- Matching fonts: