{"id":19797184,"url":"https://github.com/wyatt8740/ibm3161-font","last_synced_at":"2025-05-01T03:31:42.887Z","repository":{"id":41329847,"uuid":"87134453","full_name":"wyatt8740/IBM3161-font","owner":"wyatt8740","description":"The monospaced bitmap font from IBM's 1985 'ASCII Display Station' (terminal), the IBM 3161. Includes versions for a multitude of devices and platforms. (Also on gitlab: https://gitlab.com/wyatt8740/IBM3161-font)","archived":false,"fork":false,"pushed_at":"2023-08-22T19:25:26.000Z","size":31764,"stargazers_count":78,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-08-22T23:46:02.653Z","etag":null,"topics":["80s","ascii-characters","ascii-text","bitmap","bitmap-fonts","bitmap-versions","font","glyphs","gnu-unifont","ibm","retro","terminal","terminal-graphics","truetype","ttf"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wyatt8740.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-04T00:42:51.000Z","updated_at":"2023-08-07T20:10:26.000Z","dependencies_parsed_at":"2023-01-19T22:45:20.967Z","dependency_job_id":null,"html_url":"https://github.com/wyatt8740/IBM3161-font","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyatt8740%2FIBM3161-font","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyatt8740%2FIBM3161-font/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyatt8740%2FIBM3161-font/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wyatt8740%2FIBM3161-font/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wyatt8740","download_url":"https://codeload.github.com/wyatt8740/IBM3161-font/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224233528,"owners_count":17277804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["80s","ascii-characters","ascii-text","bitmap","bitmap-fonts","bitmap-versions","font","glyphs","gnu-unifont","ibm","retro","terminal","terminal-graphics","truetype","ttf"],"created_at":"2024-11-12T07:24:11.989Z","updated_at":"2024-11-12T07:24:12.629Z","avatar_url":"https://github.com/wyatt8740.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a very basic repository for my IBM 3161 ASCII terminal font.\n\n# Contents\n  - [Introduction](#introduction) \n  - [Formats](#formats)\n  - [Installation](#installation)\n    - [Windows Installation](#windows-installation)\n    - [Unix/X11 Installation](#unixx11-installation)\n      - [X11 OTB/PCF Installation](#x11-otbpcf-installation)\n      - [X11 TrueType Installation](#x11-truetype-installation)\n      - [Linux Console (TTY) Installation](#linux-console-installation)\n      - [FreeBSD Console Installation](#freebsd-console-installation)\n    - [Mac OS X ('MacOS') Installation](#mac-os-x-macos-installation)\n    - [Minecraft Installation](#minecraft-installation)\n    - [Rockbox Installation](#rockbox-installation)\n    - [GNU Emacs Installation](#gnu-emacs-installation)\n  - [How I Made It](#how-i-made-it)\n  - [Still Not Done](#still-not-done)\n  - [Licensing](#licensing)\n\n### [Introduction](#contents)\n![Screenshot of the ASCII set on my terminal](http://i.imgur.com/f2eG8H8.png)\n\n![Photo of IBM 3161 terminal with amber CRT playing the text-based adventure gam\ne, Zork](http://i.imgur.com/MkboCJs.jpg)\n\nThis repository contains a bitmap version of the font as well as a (slightly \nless complete) truetype version created through GNU Unifont's \"tracing\"\nprogram which it uses to create its truetype versions. The truetype covers 0x00\nthrough 0xFF (the basic ASCII set and first 'extended' bank), while I have\nextended the font to cover through about 0x17F in the bitmap versions. Beyond\nthese thresholds, the font more or less falls back on the glyphs from Unifont,\nwhich *almost* match the IBM font glyphs where applicable. This also means that\nI can use the font for other languages like Japanese, which is handy in a\nterminal if you are from an area of the world that does not use the latin\nalphabet as much or when dealing with files from users of another language\nin a terminal window.\n\nCreating the truetype to the extent I already have took a lot of effort, due to\nsome flawed decision making early on in the process; while I plan to do better\ngoing forward, the fact remains that fixing/translating the bitmap glyphs to\ntruetype is a lot of effort – too much for something I rarely use. All of the\nessentials are still in the TTF, anyway, and I expect that I may slowly\ncontinue to improve the TrueType going forward.\n\nI also have included the Fontforge Spline Font Database (SFD) files, which\nare uncompressed text (and thus pretty big; sorry). If you just want to use the\nfont, I therefore suggest downloading the zip on the 'releases' page instead of\ncloning the repo.\n\nI used GNU Unifont as a base because it looks somewhat similar and covers a lot\nof Unicode above the basic ASCII set my IBM terminal supports. Additionally,\nits sources contained some useful tools for automatically performing\ntransformations on fonts.\n\n### [Formats](#contents)\nSince I first created this font, I have been finding more and more formats I can\nconvert it to! Whenever I find another format to port to, I do so and then add\na commit here. Most recently, an Amiga version (made in Workbench 1.3 on an\nAmiga 500), as well as Minecraft, Rockbox, and an X11 emacs-specific font\n(to fix strange rendering issues) have been added.\n\nThis font is also available in a Minecraft 1.11-and-up compatible resource pack.\nWith minor tweaking it should also work for earlier and future versions.\nConveniently, Minecraft uses GNU Unifont for unicode text, which is also the\nbase for my font - this made it simple to add by modifying some tools included\nwith the Unifont source distribution to export the font.\n\n![Photo of font on an iPod running Rockbox](https://i.imgur.com/UsE8YDw.jpg)\n\n## [Installation](#contents)\nThis depends on your platform, but I will try to lay out what works where.\nFor some exotic formats (e.g. Minecraft, Rockbox) the directions are in the\nports' respective subdirectories.\n\n##### Why install both the bitmap and TrueType versions?\nOn Unix/Linux and Windows platforms the bitmap versions benefit from not\ngetting any software subpixel rendering attempted on them like the TrueType\nfont does. This is probably true in OS X as well, but I only tested the .dfont\nversion of the font in OS X on account of not actually having regular access to\nOS X. (the dfont is a bitmap-only font, so it probably won't be subpixel\nrendered.)\n\n### [Windows Installation](#contents)\nOn Windows, you will want the windows bitmap .fon file and/or the TrueType font\n(.ttf). They can be copied manually to `C:\\Windows\\Fonts`, or installed from\nthe font previewer.\n\n### [Unix/X11 Installation](#contents)\nIn (non-OS X/NextSTEP) Unix and Linux distros with X11, you'll want the\nOpenType bitmap (.otb) and/or the TrueType font (.ttf).\n\nThere is also a PCF font (old-school X11 font) that it may be a good\nidea to install for programs like `xterm` and the GUI version of `emacs`.\n\nInstalling all three versions (TTF, OTB, and PCF) lets you use the font with\nnearly any program on a Unix system. The TTF and OTB can be selected with most\n'font chooser' GUI programs, while the PCF is useful for traditional X11\nprograms like `xterm` and is usually set through a text configuration file\nlike `~/.Xresources` or `~/.emacs`.\n\nI think this will be the same on the BSD's with X11 as it is for Linux distros,\nsince they share a codebase for their X servers and FreeType.\n\nIt definitely is the same in OpenBSD and FreeBSD, where I have tried it\npersonally.\n\n#### [X11 OTB/PCF Installation](#contents)\nThe instructions for installing the X11 PCF font are in the\n[X11/README.md](X11/README.md) file.\n\n#### [X11 TrueType Installation](#contents)\nCopy the .ttf file to either a local font path (such as `~/.fonts`, or to a\nsystem-wide font path (such as /usr/share/fonts/). These paths are probably\ndistro and OS dependant.\n\n#### [Linux Console Installation](#contents)\nThis only for sure applies to Debian and derivatives. It might be different on\ndistros that I have not tried, but I bet it works there, too.\nCopy `linux-console/IBM3161.psf` to `/usr/share/consolefonts/IBM3161.psf`.\nThen, edit `/etc/default/console-setup`, and add/change the `FONT=` line to\nread:\n\n    FONT=\"IBM3161.psf\"\n\nYou're done. You might have to reboot for it to show everywhere.\n\nThe `setfont` command line program should also be able to apply it on a\nspecific TTY on a one-off basis.\n\n#### [FreeBSD Console Installation](#contents)\nTo-do: write up the FreeBSD console installation. I currently haven't gotten\nit to change in every terminal, just the primary one that you watch the boot\nprocess in. I am hoping I don't have to recompile the kernel to get it\neverywhere.\n\nI assure you, it does work in FreeBSD, though.\n\n### [Mac OS X ('MacOS') Installation](#contents)\nOn Apple systems (OS X), you'll want to use the '.dfont' file. If that fails,\ntry the .ttf or the .pt3 (PS type 3). IIRC, the installation process was\nrelatively intuitive.\n\nI don't yet know how it would be installed on \"classic\" Mac OS. If anyone has\na System 7 or lower floppy which I can use to start up my Mac Plus, please let\nme know about it (Or you could send me a better classic mac!)\n\n### [Minecraft Installation](#contents)\nInstructions to install the Minecraft version of the font are under the\n`minecraft/` directory.\n\n### [Rockbox Installation](#contents)\nRockbox is an alternative firmware for many mp3 players. It has been tested on\nmy iPod Classic. Instructions are of course in the `rockbox/` directory.\n\nI cannot support this port anymore until I can get a new CompactFlash card, as\nthe one in my iPod just failed and the hard drive failed many years ago. Feel\nfree to shoot me a question, but I might not be able to answer it.\n\n### [GNU Emacs Installation](#contents)\nThere are two main ways to go about this. The first is to just use the truetype\nfont. If I remember correctly, that spaces out everything correctly.\n\nThe regular OTB version gets all characters padded out to 16px, regardless of\ntheir actual width. On account of this, it is not recommended.\n\nHowever, the OTB file `8wide/IBM3161APL.otb` should work. This is (if I\nremember correctly) named as such because it is derived from the APL variant of\nUnifont. I discovered that the APL variant of Unifont does seem to render\ncorrectly in emacs, and so I made a similar variant of it for my own font.\n\nI am not sure if it's actually because it's the APL variant, or because maybe\nemacs tries to prioritize `pcf` style fonts over `otb` ones. Or maybe something\nelse FreeType related. But whatever the case may be, if you install\n`IBM3161APL.otb` somewhere (I have it in `~/.fonts/`), you should be able to\nmake it work in GNU emacs with `m-x customize`, or else manually add it to\n`custom-set-faces` in your emacs initialization file (usually `~/.emacs` or\n`~/.emacs.d/init.el`).\n\nAn example (from my `custom-set-faces` elisp) follows.\n\nThe most important line to focus on is the one containing the string\n`IBM3161APL`. The rest is just provided for context. There's almost nothing I\ndislike as much as insufficient context when looking at code samples,\nespecially in unfamiliar languages.\n\n    (custom-set-faces\n     ;; custom-set-faces was added by Custom.\n     ;; If you edit it by hand, you could mess it up, so be careful.\n     ;; Your init file should contain only one such instance.\n     ;; If there is more than one, they won't work right.\n     '(default ((t (:family \"IBM3161APL\" :foundry \"PfEd\" :slant normal :weight normal :height 128 :width normal))))\n     '(term-color-blue ((t (:background \"#2272D9\" :foreground \"#2272D9\"))))\n     '(term-color-cyan ((t (:background \"#06989A\" :foreground \"#06989A\"))))\n     '(term-color-green ((t (:background \"#4E9A06\" :foreground \"#4E9A06\"))))\n     '(term-color-magenta ((t (:background \"#A168AB\" :foreground \"#A168AB\"))))\n     '(term-color-red ((t (:background \"#CC0000\" :foreground \"#CC0000\"))))\n     '(term-color-white ((t (:background \"#D3D7CF\" :foreground \"#D3D7CF\"))))\n     '(term-color-yellow ((t (:background \"#C4A000\" :foreground \"#C4A000\"))))\n     '(tooltip ((t (:inherit tooltip-ui :background \"lightyellow\" :foreground \"black\")))))\n\nIf someone knows why this `IBM3161APL` variant actually works when the regular\nOTB doesn't, please tell me about it. I really would like to know!\n\n## [How I Made It](#contents)\nI screen-scraped the font from my IBM 3161 by hand via its built-in \"test\"\nmode, where it prints out its entire ASCII character set on a single screen. As\na result, I cannot guarantee it to be 100% accurate in terms of spacing between\ncharacters, but I can say that I personally have yet to notice anything wrong\nwith it. I have used it in my terminal emulator exclusively for five months now.\n\nYou can find some of the images I used [here](http://imgur.com/a/XHyDb) (though\nI have others that I did with a different amber CRT; I still need to dig those\nfiles up).\n\nAs such, I am as confident as one can be when using guesswork and (to an extent)\ntracing the letters in CAD and transforming my photos of the screen to correct\nfor the CRT's curvature. I am certain that the vertical pixels are accurate, as\nI can make out individual scans of the electron beam in my photos. I am\nrelatively certain that the horizontal pixels are accurate based on common\nsense, the fact that most characters would look wildly incorrect if shifted\nover a pixel, and from some trigonometry I did using the CAD tracings. Character\n0x7F is a checkerboard pattern, which made it easy for me to find out what the\naspect ratio of each 'pixel' is on the CRT near the center of the display.\n\nIf I had a ROM dumper, I could also dump the ROM's within the terminal, as they\nare all socketed. This may happen in the future, but I have been using this\nfont within my terminal emulators and in other places for the last year and not\nyet found any problems.\n\nIf you want to hack on this yourself, I'd suggest using the .hex file as a\njumping-off point if you want to be able to generate truetype versions. Merge\nit with the hex sources of Unifont.\n\n## [Still Not Done](#contents)\nMy font does not currently supply most of the non-ASCII \"Extended\" characters\nthat are in the real 3161 (characters above `0x7F`). Even those characters that\nhave unicode equivalents do not have them associated with the same 'numbers'\nas they have in the terminal, and I am not clever/talented/obsessive enough to\nmap those all out since I never use them. Additionally, some characters do not\nhave a unicode equivalent that I am aware of at all.\n\nI would also like to try to turn the 3161 part of it (not the whole of Unifont)\ninto a proper TTF font, meaning one that doesn't look pixellated but is made\nusing vectors for the various angles in the typeface. If you want an example of\nsomebody who has done this for a similar (but not identical!) font, see\n[rbanffy/3270font](https://github.com/rbanffy/3270font).\n\nIf anyone wants to add them, I will point you to [the photos of the terminal's\nscreen in its 'testing' mode,](http://imgur.com/a/XHyDb) which contains a full\nprintout of all of the characters the terminal is capable of displaying. Feel\nfree to send me a pull request!\n\n## [Licensing](#contents)\nThese font files are licensed under the GNU General Public License (where\napplicable), either version 2 or (at your option) a later version, with the\nexception that embedding the font in a document does not in itself constitute a\nviolation of the license. The full terms of the license are in GNU Unifont's\n[LICENSE.txt](http://unifoundry.com/LICENSE.txt). This license is inherited\nbecause I have based my font on GNU Unifont for nearly all non-ASCII characters.\n\nIf you wish to use only the glyphs that I created (0x00-0x7F in the truetype, or\n0x00-0xFF plus unicode superscript and subscript numerical digits in the\nbitmap), those glyphs are licensed (at your option) under the GNU GPL version 2\nor later (with the aforementioned exception regarding embedding), the\n[SIL Open Font License, version 1.1](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi\u0026id=OFL#5667e9e4), \nor the 3-Clause BSD License, which is reproduced\nbelow. Additionally, contact me if you wish to use it in another project or\nproduct under incompatible terms and I promise I'll be accommodating/not a jerk\nabout it. It might even be free.\n\nCopyright © 2017-2023 Wyatt Ward\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation\nand/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\nmay be used to endorse or promote products derived from this software without\nspecific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n----\n--[(Back to top)](#contents)--","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyatt8740%2Fibm3161-font","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyatt8740%2Fibm3161-font","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyatt8740%2Fibm3161-font/lists"}