pax_global_header00006660000000000000000000000064141541174120014512gustar00rootroot0000000000000052 comment=500ba216b3cc2ebfcb762726eead5f4b8b12b961 fnt-1.4.1/000077500000000000000000000000001415411741200123045ustar00rootroot00000000000000fnt-1.4.1/LICENSE000066400000000000000000000020731415411741200133130ustar00rootroot00000000000000MIT License Copyright (c) 2021 Alex Myczko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. fnt-1.4.1/README.md000066400000000000000000000321251415411741200135660ustar00rootroot00000000000000``` .d888 d88P" 888 888 888 .d88888 88888b. d888888 888 888 "88b 888 888 888 888 888 888 888 888 Y88b. 888 888 888 "Y888 ``` apt for fonts, the missing font manager for macOS/linux # Why? If you run [Debian](https://www.debian.org) stable, you don't get the latest fonts, unless someone backports them actively. So this is useful to just get the latest and greatest fonts from Debian sid. It gets even worse with non Debian based Linux distributions. If you run [macOS](https://www.next.com), neither [fink](https://www.finkproject.org), [brew](https://brew.sh), nor [macports](https://www.macports.org) come with a great list of available to install fonts. # Privacy? Read more about [Google Fonts](https://uxdesign.cc/a-privacy-concern-about-google-fonts-5aa4418bf87e) and [their FAQ](https://developers.google.com/fonts/faq#what_does_using_the_google_fonts_api_mean_for_the_privacy_of_my_users). Host them [yourself](https://wicki.io/posts/2020-11-goodbye-google-fonts/). # Font repositories [Debian sid](https://packages.debian.org/unstable/fonts/), ~480 fonts available, only those starting with `fonts-` [Google fonts](https://github.com/google/fonts), ~1420 fonts available, (`google-` prefixed) # Installation ``` make install ``` # Usage ``` $ fnt update $ fnt search agave $ fnt preview agave ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴▗▄▖╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴▟▇▉▏╴▗▆▆▆▖╴╺▆▆▅▖▐▆▖▗▆▍▁▅▇▆▅╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▗▇▌▇▙╴▜▉▁▇▋╴▃▅▅▇▌╴▜▊▟▉╴▐▇▅▟▉▏╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▟▛▀▜▉▖▔▀▀▇▋▕▜▙▃▇▍╴▝▇▉▍╴▝▜▙▃▖╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▔▔╴╴▔▔▕▅▆▛▘╴╴▔▔▔╴╴╴▔▔╴╴╴╴▔▔▔╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴▁▁╴╴╴╴╴╴╴╴╴╴╴╴╴╴▁▁▁▁╴╴╴╴╴╴╴╴╴╴╴╴╴▁▁▁▁╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴▐▇▉╴╴▕▃▃▃▁╴╴╴╴╴╴▕▇▛▀▀▏╴▂▄▃▁╴╴╴╴╴╴╴▇▛▀▇▌╴▃▃▃▂╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▕▇▛▇▌╴╴▔▂▇▋╴╴╴╴╴╴▕▇▇▆▅╴▐▇▍▜▉▏╴╴╴╴╴╴▇▉▆▉▘▕▇▍▀▛▏╴╴╴╴╴╴╴╴╴╵╵╵╵╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▉▆▇▉╴▇▉▀▇▋╴╴╴╴╴╴▕▇▌╴╴╴▐▇▛▀▀╴╴╴╴╴╴╴▇▋▐▉▖▕▇▍╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╵╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▀▘╴▕▀▘▝▀▀▀▘╴╴╴╴╴╴▕▀▀▀▀▏╴▀▀▀▘╴╴╴╴╴╴╴▀▘╴▀▘▕▀▘╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╵╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╶╴╴╴╵╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴▁▁╴╴╴╴╴╴╴╴╴╴╴╵╴╴╴╶╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▇▇▆▖╴▇▊▁╴╴╴╴╴╴╴╴╴▄▆▇▇▏╴╴▁▁╴╴╴╴╴╴╴╴┡▇▇▇▏╴╴▕▀▀╴╴╴╴╴╴╴╴╴╴╶╴╴╴╴╴╵╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▉▃▇▛╴▟▉▀▇▌╴╴╴╴╴╴▐▇▘▃▃▖▗▇▛▜▉╴╴╴╴╴╴╴╴╴▐▇▏╴╇▇▇▊╴╴╴╴╴╴╴╴╴╴╷╷╷╷╴╴╶╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▉▔▜▇▏▟▊╴▇▊╴╴╴╴╴╴▐▇▎▐▇▍▐▇▄▟▉╴╴╴╴╴╴╴╴╴▐▉▏╴╴╴▇▊╴╴╴╴╴╴╴╴╴╶╴╴╴╴╴╴╴╵╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▉▆▇▀╴▜▉▆▛▘╴╴╴╴╴╴╴▜▇▇▛▘╴╴▔▟▉╴╴╴╴╴╴╴▆▆▛▀╴╴╴▁▇▊╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴▀▀▀▘╴╴╴╴╴╴╴╴╴╴╴╴▕▜▀▀▔╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▇╴▐▇╴▅▇▇▆▖╴╺▇▇▆▖▐▇▇▆▇▖▕▆▇▇▅╴╴╴╴╴╴╴╴╴╴╴╴╴┡▇▆▆▏╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▉╴▐▉╴▟▊╴▇▋╴▄▅▅▇▌▐▋▟▋▟▌▐▇▅▟▉▏╴╴╴╴╴╴▝▛▛▛▏╴▄▅▟▇▎╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴▐▇▄▟▉╴▟▊╴▇▋▕▜▙▄▇▍▐▋▟▋▟▌▝▜▙▄▖╴╴╴╴╴╴╴╴╴╴╴╴▕▇▙▟▉▎╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴▔▔▔╴╴▔▔╴▔▔╴╴▔▔▔╴▔▔▔▔▔▔╴╴▔▔▔╴╴╴╴╴╴╴╴╴╴╴╴╴╴▔▔▔╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▛▃▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▛▋▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▛╏▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▆▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▉▛▀▀▉ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▉▏╴▕▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▆▆▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▛▁▖▔▜▛▔╴▇▉▔▗╴▐▉▃▃▔▜▇▛▘╶▇▍╴▃▃▇▉▘▁▟▊▃▃╴▕▛▔▃▏▜▛▔▃▔▜▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▏▔▔╴▐▆▋╴▇▇▉▀╴▟▇▋▁╴▐▛▏▖╶▇▍▂▔▀▜▘▁▁▀▇▇▛╴▟▉╸▔╴▐▙▁▀╴▟▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▖▝▘▁▟▇▋╴▇▉▘╶┻▜▉▀▀╴▐▄▃▖╴▟▛▀▘▁▟▖▝▘▁▇▛╴▐▇▌╴▀▏▐▇▛╴▟▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ ▇▇▇▇▇▇▆▇▇▇▇▇▇▇▇▇▇▇▇▆▇▇▇▇▇▇▇▇▇▆▇▇▇▇▆▆▇▇▇▇▇▇▇▇▆▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ monospaces programming font [37-1 D:103112 I:364000] https://b.agaric.net/page/agave $ fnt install agave $ fnt list agave-b-autohinted.ttf [699] agave-r-autohinted.ttf [2443] ``` Randomly display a preview every ten seconds: `while (clear); do fnt preview $(fnt search | shuf -n1 | sed "s,google-,,;s,fonts-,,"); sleep 10; done` If you want to install all available fonts, you could run something like this: `for a in $(fnt search |grep ^fonts- |sed s,fonts-,,); do fnt install $a; done` You end up with ~2700 font files (~480 fonts), taking up 1.6 GB. `for a in $(fnt search |grep ^google- |sed s,google-,,); do fnt install $a; done` You end up with ~4200 font files (~1420 fonts), taking up 1.4 GB. # ZSH autocompletion You might want to add something like this to your `.zshrc`: ``` # enable autocomplete function autoload -U compinit compinit ``` # Thanks The preview mode works using https://github.com/hpjansson/chafa and https://screenshots.debian.net # Screenshots Create your own with http://shell.aiei.ch/typography/ # Online service http://bootes.ethz.ch/fonts/ # Missing a font? Feel free to create an issue, if the font comes with sources and its license is DFSG compliant, I'm happy to package it for a dollar. Free if I like it. # Want to create or edit fonts? https://trufont.github.io/ https://fontforge.org/en-US/ https://birdfont.org/ # Serve fonts on the web as woff2 and save a lot of traffic https://github.com/google/woff2 # Advertisement https://news.ycombinator.com/item?id=26063971 https://fostips.com/fnt-a-command-line-font-manager-for-linux-and-mac-os/ https://www.basher.it/package/ # Some interesting links [Helvetica in Motion](https://www.youtube.com/watch?v=R1ZBknDPlu4) https://wakamaifondue.com https://github.com/fcambus/bdf2sfd (convert bitmap fonts to vector fonts) https://en.wikipedia.org/wiki/Computer_font https://github.com/rewtnull/amigafonts (Amiga) https://www.trueschool.se (More Amiga) https://github.com/alexmyczko/ree (dump your video card ROM, and extract the bitmap fonts) [Paul Renner and his font Futura](https://www.maroverlag.de/typo/84-die-kunst-der-typographie-9783875124149.html) fnt-1.4.1/completions/000077500000000000000000000000001415411741200146405ustar00rootroot00000000000000fnt-1.4.1/completions/_fnt000077500000000000000000000016221415411741200155150ustar00rootroot00000000000000#compdef fnt _arguments \ "1: :->mode" \ "2: :->fonts" case $state in mode) _values \ $state \ {update,-u}"[updates the font package index of debian sid]" \ {list,-l}"[lists installed fonts with glyphcount per font]" \ info"[information about how many fonts can be installed]" \ {install,-i}"[install a font]" \ {remove,-r}"[remove a font]" \ {preview,-p}"[preview a font]" \ {search,-s}"[search for font]" ;; fonts) subcmd=${words[2]} case $subcmd in update | info | search) ;; remove) local -a installed if [ "$(fnt list)" != "" ]; then installed=("$(fnt list)") _values \ "installed" $installed fi ;; *) local -a fonts fonts=($(fnt search)) _values \ "fonts" $fonts ;; esac ;; esac fnt-1.4.1/fnt000077500000000000000000000140601415411741200130220ustar00rootroot00000000000000#!/usr/bin/env bash # APT but only for fonts # alex@aiei.ch # # selfupdate=https://raw.githubusercontent.com/alexmyczko/fnt/main/fnt #TMPDIR="${TMPDIR:-/tmp}" TMPDIR="${HOME}/.fnt" # debian sid index INDEX="http://ftp.ch.debian.org/debian/dists/sid/main/binary-all/Packages.xz" # google fonts index GINDEX="https://sid.ethz.ch/debian/google-fonts/fonts-master/" MIRROR="http://ftp.ch.debian.org/debian/" if ! which uname &>/dev/null; then s="Windows" else s=$(uname -s) fi case "$s" in Darwin) #echo macOS check="curl brew otfinfo chafa" # otfinfo comes with lcdf-typetools i="brew" md5="md5" target="$HOME/Library/Fonts/" ;; Linux|GNU/kFreeBSD|GNU) #echo Linux check="curl chafa otfinfo" i="apt" md5="md5sum" target="$HOME/.fonts/" if [ 0 -eq `id -u` ]; then target="/usr/local/share/fonts/" mkdir -p $target fi ;; FreeBSD) #echo FreeBSD check="curl chafa otfinfo" i="pkg" md5="md5" target="$HOME/.fonts/" ;; Haiku) #echo Haiku OS check="curl" i="pkgman" target="$HOME/config/non-packaged/data/fonts/" ;; Windows) #echo Windows check="cmd.exe" alias which="where" i="ENOPKGMANAGER" target="$USERPROFILE\\Fonts" ;; *) echo "Please report $s to https://github.com/alexmyczko/fnt/issues" exit 1 ;; esac for a in $check; do if ! which "$a" &>/dev/null; then echo "$a not found, please use $i to install it." exit 1 fi done if [ "${1}x" = 'x' ]; then echo "Syntax: fnt [ update | list | info ]" echo " fnt [ install | remove | preview | search ] font" echo echo "update|-u updates the font package index of debian sid" echo "list|-l lists installed fonts with glyphcount per font" echo "info information about how many fonts can be installed" echo "install|-i install a font" echo "remove|-r remove a font" echo "preview|-p preview a font" echo "search|-s search for font" echo exit 0 fi case "$1" in update|-u) echo Updating... if [ ! -d "${TMPDIR}" ]; then mkdir -p "${TMPDIR}"; fi if [ -f "${TMPDIR}/Packages.xz" ]; then rm "${TMPDIR}/Packages.xz"; fi curl -s "$INDEX" -o "${TMPDIR}/Packages.xz" ;; info) echo "Information..." echo "Available Fonts: $(fnt search | wc -l)" ;; list|-l) # echo Listing... # macOS mainly comes with *.ttc (truetype font collections, that can not be processed by otfinfo) #ls -1 /System/Library/Fonts/*.?tf /usr/share/fonts/*type/*/*.?tf $HOME/Library/Fonts/*.?tf $HOME/.fonts/*.?tf 2>/dev/null | while read f; do ls -1 $HOME/Library/Fonts/*.?tf $HOME/.fonts/*.?tf /usr/local/share/fonts/*.?tf 2>/dev/null | while read f; do echo "$f" [$(otfinfo -u "$f" 2>/dev/null|wc -l|awk '{print $1}')] | sed s,.*/,, done ;; preview|-p) # echo Previewing... curl -L -s "https://screenshots.debian.net/screenshot/fonts-$2" -o "${TMPDIR}/preview.png" md5s=$($md5 ${TMPDIR}/preview.png) echo $md5s |grep b5765b390157e36eaf721c8848a4b04d >/dev/null && curl -L -s "https://bootes.ethz.ch/fonts/$2/preview.png" -o "${TMPDIR}/preview.png" #chafa --invert -c none --symbols block+border-solid "${TMPDIR}/preview.png" chafa -c 240 -w 9 -O 9 -p on --symbols all "${TMPDIR}/preview.png" ;; install|-i) if [ ! -f "${TMPDIR}/Packages.xz" ]; then echo "Could not find ${TMPDIR}/Packages.xz" echo "Please run $0 update" # could also just run itself with update... exit 1 fi if [ ! -d "${target}" ]; then mkdir -p "${target}" fi # cat $HOME/.fnt/Packages.xz |unxz|grep "^Package:\|^Homepage:\|^Size:\|^Installed-Size:\|^Description:" # cat $HOME/.fnt/Packages.xz |unxz| awk '!NF{print line; line=""}{line=line " " $0}' |grep "Package: fonts-" p=$(unxz -c "$HOME/.fnt/Packages.xz" | grep -v "^Architecture:\|^Section:\|^Priority:\|^Replaces:\|^Provides:\|^Brekas:\|^Maintainer:\|^MD5sum:\|^Source:\|^Breaks:\|^Multi-Arch:\|^Description-\|^Tag:\|^SHA256:"|awk '!NF{print line; line=""}{line=line " " $0}' |grep "Package: fonts-"|grep "fonts-$2"|head -1) # Package: fonts-agave Version: 37-1 Installed-Size: 364 Description: monospaces programming font Homepage: https://b.agaric.net/page/agave Filename: pool/main/f/fonts-agave/fonts-agave_37-1_all.deb Size: 103112 if [ -z "$p" ]; then q=$(curl -s "$GINDEX/ofl/" |grep "a href" |sed 's,.*">,google-,;s,/.*,,' |grep "$2" | head -1) s=$(curl -s "$GINDEX/apache/" |grep "a href" |sed 's,.*">,google-,;s,/.*,,' |grep "$2" | head -1) if [ -z "$q" ] && [ -z "$s" ]; then echo "Font \"$2\" not found" exit 1 else echo "Installing google-${2}" # here comes the google web font installer part using grep '\..tf' curl -s "$GINDEX/ofl/${2}/" |grep "a href" |grep "\..tf" |sed 's,.*tf.>,,' | sed 's,,,' | sed 's,,google-,;s,/.*,,' |grep -v "\.\.$" |grep "$2" curl -s "$GINDEX/apache/" |grep "a href" |sed 's,.*">,google-,;s,/.*,,' |grep -v "\.\.$" |grep "$2" ;; moo) echo "This fnt does not have cow powers." ;; wak) echo ' _()< wak wak' echo '(__)' ;; *) echo "Nothing..." ;; esac fnt-1.4.1/fnt.1000066400000000000000000000012251415411741200131550ustar00rootroot00000000000000.TH man 1 "01 Mar 2021" "1.1" "font downloader and manager" .SH NAME fnt \- download and install fonts .SH SYNOPSIS .TP \fBfnt\fP \fIcommand\fP [\fIargument\fP] .SH DESCRIPTION This tool helps you to download vector fonts from Debian sid, and Google Web Fonts. .SH EXAMPLES .TP .I fnt update update font index. .TP .I fnt search aga search for fonts named aga. .TP .I fnt preview agave install the font called agave. .TP .I fnt list list installed fonts with glyphcount. .SH SEE ALSO birdfont(1), bdf2sfd(1). .SH BUGS Please report to https://github.com/alexmyczko/fnt/issues .SH AUTHOR Alex Myczko .SH INTERNET https://github.com/alexmyczko/fnt fnt-1.4.1/makefile000066400000000000000000000016011415411741200140020ustar00rootroot00000000000000BINDIR=/usr/bin MANDIR=/usr/share/man ZCOMPDIR=/usr/local/share/zsh/site-functions VERSION=1.3 all: @echo make install to install the software @echo make uninstall to remove the software install: if test ! -d $(DESTDIR)/$(BINDIR) ; then mkdir -p $(DESTDIR)/$(BINDIR) ; fi install -m 755 fnt $(DESTDIR)/$(BINDIR)/ if test ! -d $(DESTDIR)/$(MANDIR)/man1 ; then mkdir -p $(DESTDIR)/$(MANDIR)/man1; fi install -c -m 644 fnt.1 $(DESTDIR)/$(MANDIR)/man1/ ; gzip -9 $(DESTDIR)/$(MANDIR)/man1/fnt.1 if test ! -d $(DESTDIR)/$(ZCOMPDIR) ; then mkdir -p $(DESTDIR)/$(ZCOMPDIR) ; fi install -m 755 completions/_fnt $(DESTDIR)/$(ZCOMPDIR)/ uninstall: rm -f $(DESTDIR)/$(BINDIR)/fnt rm -f $(DESTDIR)/$(MANDIR)/man1/fnt.1.gz rm -f $(DESTDIR)/$(ZCOMPDIR)/_fnt clean: @echo nothing to clean release: cd .. ; tar cf fnt-$(VERSION).tar --exclude-vcs fnt ; xz -9f fnt-$(VERSION).tar