{"id":17101239,"url":"https://github.com/hackerb9/fonttable","last_synced_at":"2026-06-05T10:30:15.028Z","repository":{"id":113746295,"uuid":"122135720","full_name":"hackerb9/fonttable","owner":"hackerb9","description":"Print out every unicode character; see all possible glyphs in your terminal","archived":false,"fork":false,"pushed_at":"2024-04-03T10:13:32.000Z","size":9217,"stargazers_count":26,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T08:52:28.868Z","etag":null,"topics":["cjk-characters","font","glyphs","gnome-terminal","unicode-characters","unicode-data","unihan","unihan-database","xterm"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/hackerb9.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-02-19T23:51:01.000Z","updated_at":"2024-05-30T08:21:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"2a157739-62ee-4dd7-a7d4-91ee40a7565e","html_url":"https://github.com/hackerb9/fonttable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Ffonttable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Ffonttable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Ffonttable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2Ffonttable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackerb9","download_url":"https://codeload.github.com/hackerb9/fonttable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239997009,"owners_count":19731332,"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":["cjk-characters","font","glyphs","gnome-terminal","unicode-characters","unicode-data","unihan","unihan-database","xterm"],"created_at":"2024-10-14T15:24:27.005Z","updated_at":"2026-06-05T10:30:14.778Z","avatar_url":"https://github.com/hackerb9.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=\"README.md.d/fonttable.gif\" title=\"Example of fonttable running in `xterm -fa DroidSansMono -fd DroidSansFallback`\"\nalt=\"Scrolling CJK glyphs\"\u003e\n\n# fonttable\nPrint out every¹ unicode character; see all possible glyphs in your terminal\n\n¹ Well... not quite *every* character. We don't want control codes\nand such, so characters in categories `C`, `M`, and `Z` won't be printed. (See the table of [general category values](http://unicode.org/reports/tr44/#GC_Values_Table) at the end of the script.)\n \nIf you don't have [`/usr/share/unicode/UnicodeData.txt`](http://unicode.org/Public/UNIDATA/UnicodeData.txt) on your system, a version cached in this script will be automatically used. (v14.0.0, current as of September 2021 from unicode.org).\n\nWhile fonttable sends all printable Unicode characters to stdout, what\ncharacters are _actually_ displayed depends upon what fonts you have\ninstalled on your system and if your terminal is setup to use them.\n\nOptionally, one can specify a particular font using -f fontname\nto restrict the display to glyphs defined in that font.\n(Requires fontconfig and sixel graphics.)\n\nNote: the Unicode Consortium's [\"UnicodeData.txt\"](http://unicode.org/Public/UNIDATA/UnicodeData.txt) file does not list CJK characters, but they can be found in the adjacent [Unihan](http://unicode.org/Public/UNIDATA/Unihan.zip) database. If you'd like to see them as well, specify \"-s\" \n\n## Installation\n\nIt's a shell script. Just download\n[`fonttable`](https://github.com/hackerb9/fonttable/blob/master/fonttable?raw=true)\nand run it. \n\n## Notes\n\n1. This was inspired by the favorite 8-bit one-liner of many a youth:\n    \u003cvideo\u003e\n    \u003csource src=\"README.md.d/c64xterm.mp4\" type=\"video/mp4\"\u003e\n    \u003cimg width=50% align=\"right\" src=\"README.md.d/c64xterm.gif\"\n    alt=\"Scrolling C64 PETSCII\" secret=\"You figured it out! It's actually\n    xterm -fa C64ProMono\" title=\"FORT=0TO255:?CHR$(T);:NEXT:RUN\"\u003e\n    \u003c/video\u003e \n\n         FORT=0TO255:?CHR$(T);:NEXT:RUN \n\n2. This is the modern equivalent, a way to see every valid glyph.\n   Of course, we can't use a simple loop since Unicode has a huge\n   address space and only a small fraction of the code points are\n   valid characters. The solution is to only print characters\n   specified in the UnicodeData.txt file.\n\n3. Likewise, not every CJK code point in the allocated UNIFIED\n   IDEOGRAPH range is a character. Fonttable prints only characters\n   that the Unihan database knows exist. (Unihan_DictionaryIndices.txt).\n   \n4. As of Unicode 14 (2021), I count almost 32,000 printable characters\n   in UnicodeData.txt. Additionally, there are over 70,000 known CJK\n   characters in the Unihan database.\n\n        $ ./fonttable -s | awk '{print length($1)}'\n        31959\n        70805\n\n    (Some people claim much higher numbers because they are using\n    PropList.txt and counting *allocated* regions, whether or not\n    characters exist at those code points.)\n\n## Usage\n\n\tfonttable: Show every Unicode character in your terminal.\n\n\tUsage: fonttable [ -csu ] [ START..END ] [ -f FONT [ -p POINTSIZE ]]\n\n\t\tSTART..END\n\t\t\tShow range from START to END, inclusive. (Hexadecimal).\n\t\t\tSTART defaults to 0, END defaults to infinity.\n\t\t\tMultiple ranges are allowed: fonttable 2590..f 1fb00..ff\n\n\t\t-f FONT | --font-name FONT\n\t\t\tDisplay every Unicode glyph which is defined in FONT as\n\t\t\ta sixel image directly in the terminal. \n\n\t\t-p POINTSIZE | --point-size POINTSIZE\n\t\t\tChange the size of the font rendered by -f.\n\t\t\t\n\t\t-d FONT | --defined-in FONT\n\t\t\tLike -f, but displays using the default terminal font,\n\t\t\tnot graphics. Useful to quickly see character coverage.\n\n\t\t-c | --cache\n\t\t\tUse cached UnicodeData.txt embedded in this script.\n\t\t\tUsually the cached version is only used if the file is\n\t\t\tnot in /usr/share/unicode/ or the current directory.\n\n\t\t-s | --show-unihan\n\t\t\tAlso show CJK data from the Unihan database.\n\t\t\tThe default is to not show characters that Unicode has\n\t\t\tdesignated as mappings to other standards.\n\n\t\t-u | --unihan-cache\n\t\t\tUse a cached copy of the list of valid CJK characters\n\t\t\tinstead of looking for Unihan_DictionaryIndices.txt.\n\n\n\tUnicodeData.txt contains around 30,000 characters.\n\tUnihan adds another 70,000.\n____\n\n## About --font-name\n\nThe -f / --font-name option is like the range option, but it shows\nonly the codepoints that are defined in a specific font (and that are\nmarked as normal, printable characters in Unicode). For example:\n\n    fonttable -f NotoSans\n\nFonts may be specified by filename:\n\n    fonttable -f /usr/share/fonts/X11/misc/neep-iso10646-1-10x20.pcf.gz \n\n### Caveat 1: Requires sixel graphics to display in the named font\n\nFonttable uses sixel graphics to draw the font requested. Use the \n`-d FONT` option if you would like to use a specific font to limit which\ncodepoints are displayed, but still show them in the default font.\n\nBUG: Currently the sixel handling is quite naive. The terminal is not\nqueried if it supports sixels graphics, nor how many pixels high each\ncharacter should be, nor the proper text colors.\n\n### Caveat 2: FontConfig is required\n\nYour machine must have FontConfig, which will be true for Debian\nGNU/Linux and derivatives, but may not be true universally.\nAdditionally, the fontname must in a format FontConfig likes. For\nexample:\n\n    fonttable -f LTCCaslon                          # Works\n    fonttable -f \"LTC Caslon\"                       # Works\n    fonttable -f \"LTC Caslon Swash Long Regular\"    # Works\n\nBut, as it happens:\n\n    fonttable -f Caslon                     # Does Not Work \n    fonttable -f \"LTC Caslon Swash Long\"    # Does Not Work\n\nIf you are unsure of the name, try `fc-list | grep -i caslon`. You may\nalso specify a font filename directly. For example:\n\n    fonttable ~/.local/share/fonts/P22CezannePro.ttf\n\n### Caveat 3: Decorative and expert fonts\n\nSome decorative and expert fonts define glyphs that do not have\nmappings to Unicode codepoints or that map to Private Use. Those\ncharacters will not be found by this script. For example:\n\n\tfonttable -f AdobeWoodType\t\t# Shows no glyphs!\n\nHowever, with some effort, one can move such glyphs to Unicode code\npoints using a program such as FontForge.\n\n\u003cimg width=90% align=\"center\" src=\"README.md.d/woodtype.png\"\nalt=\"Image of running fonttable to view Adobe Wood Type\"\u003e\n\n____\n\n# YMMV\n\nDifferent terminal programs and fonts will give you drastically\ndifferent results.\n\n**XXX TODO**\n\nThis section needs to be redone as the terminals tested are now quite old.\n\n## Sixel output (on XTerm)\n\n\u003cimg width=90% align=\"center\" src=\"README.md.d/courier.png\"\nalt=\"Image of running fonttable -f ibmcourier.\"\u003e\n\n\u003cimg width=90% align=\"center\" src=\"README.md.d/runic.png\" alt=\"Image of running fonttable to view a font with few glyphs: noto sans runic.\"\u003e\n\n\n## Gnome Terminal \n\nGnome-Terminal-3.38.3 uses multiple fonts using FreeType. For some\ncharacters, such as ⑫ (Circled Number Twelve) the glyphs are too wide\nfor the character cell and overlap badly. There appears to be no\nsetting to tell Gnome-Terminal to shrink or truncate overly wide\nglyphs.\n\n\u003cdetails\u003e\n\n![Example of Gnome Terminal 3.38.3 running fonttable](/README.md.d/ss-gnome-terminal.png \"Notice the overlapping glyphs\")\n\nGnome Terminal has very few user settable preferences, but you can set\n\"Ambiguous Width\" characters to be wide (two cells) instead of narrow.\nThis helps quite a bit, at least on this torture test. \n\n![Example of Gnome Terminal's Ambiguous-width = WIDE setting](/README.md.d/ss-gnome-ambiguous-wide.png \"Notice less overlapping glyphs\")\n\nHowever, setting ambiguous-width to wide is not a panacea. For example, if the glyph is being replaced by a font of a very different aspect ratio from your default. For example, here is what happens when the \"DEC Terminal\" font is chosen (which is twice as high as it is wide):\n\n![Example of Gnome Terminal using DEC Terminal font](/README.md.d/ss-gnome-wide-decfont.png \"Notice glyphs once again overlap\")\n\nNotice that with this default font, glyphs are overlapping even though\nambiguous-width is set to wide.\n\n\u003c/details\u003e\n\n\n## Xterm\n\nLike gnome-terminal, Xterm also uses multiple fonts when an\nantialiased (vector) font is selected (`-fa Inconsolata -fs 18`),\nfilling in with other system fonts if the selected font is too\nlimited. Xterm can also work with bitmaps fonts, but they are a little\ntrickier.\n\n### For bitmap fonts\n\u003cdetails\u003e\n\nXterm will use only a single font if you specify a bitmap font using\n`-fn`. That means you'll need to find one font that covers every\nsection of Unicode you use. This is not always easy.\n\n\nThe default xterm font, called \"fixed\", seems a terrible choice as it\nhas very few Unicode characters. However, that is because xterm uses\nthe Latin-1 version by default. There is a Unicode (10646) version of\n\"fixed\" which is not bad in terms of coverage. \"Fixed\" also comes in a\nwide version for Asian characters, which xterm automatically detects\nand uses. So, not a bad choice, and it comes pre-installed.\n\n    xterm  -fn '*fixed-medium-r-normal--20*10646*' \n    \n![Example of XTerm(322) running fonttable with neep](/README.md.d/ss-xterm-neep.png \"Technically, this is the 'neep' font, which I prefer to 'fixed', but requires you to install xfonts-jmk\")\n\n\u003c/details\u003e\n\n### For antialiased fonts\n\u003cdetails\u003e\n\nXTerm already fills in missing glyphs for you by using other fonts\nwhen you specify an antialiased font using `-fa`. (Use `-fs` to specify\nthe point size). Note: _Antialiased_ is how XTerm refers to vector\nfonts like TrueType, OpenType, and Type 1.\n\nWhile XTerm and GNOME-Terminal both use FreeType to render antialiased\nfonts, unlike GNOME-terminal, XTerm enforces character cell boundaries\nand does not let glyphs overlap. Instead, overly wide glyphs are\ntruncated. Whether this is better or not is a matter of taste. \n\n![Example of XTerm(369) running fonttable with DroidSansMono](/README.md.d/ss-xterm-droidsans.png \"fonttable demonstrating how some wide characters get truncated in XTerm\")\n\nNote that XTerm defaults to using the font color specified by the user\nrather than colors builtin to a font. Again, this is a matter of\ntaste, but it should be noted that most emoji fonts nowadays are\ndesigned *only* in color, so single color fonts for certain ranges may\nlook outdated or be missing glyphs.\n\n#### Debugging XTerm Antialiased fonts\n\nIf you wish to see which fonts are getting loaded as you run\nfonttable, set the XFT_DEBUG environment variable to 3 before running\nxterm. \n\n    XFT_DEBUG=3 xterm -fa DroidSansMono -fs 24\n\nIf you wish to force xterm to use *only* the fonts you requested, you\ncan do so by setting the `limitFontsets` X resource to 0.\n\n    xterm -fa DroidSansMono -xrm \"XTerm*vt100.limitFontsets: 0\"\n    \nNote that xterm will attempt to automatically detect if your font is\nalso available in a doublesize version (for CJK). If it doesn't find\nit, you can specify a separate \"doublesize\" font using `-fd`.\n\n    xterm -fs 24 -fa DroidSansMono -fd DroidSansFallback -xrm \"XTerm*vt100.limitFontsets: 0\"\n    \nNote that if you don't have a particular font installed, even if you\nuse limitFontsets: 0, you will be shown a substitute font. Again, you\ncan use XFT_DEBUG to find out what is going on.\n\n    XFT_DEBUG=3 xterm -fs 24 -fa DroidSansMono -fd DroidSansFallback -xrm \"XTerm*vt100.limitFontsets: 0\"\n    \n\u003c/details\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerb9%2Ffonttable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackerb9%2Ffonttable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerb9%2Ffonttable/lists"}