pax_global_header00006660000000000000000000000064152554767340014534gustar00rootroot0000000000000052 comment=ef55b87f03cb5d6007902b373df4af59397836ae fnt-1.9.2/000077500000000000000000000000001525547673400123345ustar00rootroot00000000000000fnt-1.9.2/.github/000077500000000000000000000000001525547673400136745ustar00rootroot00000000000000fnt-1.9.2/.github/workflows/000077500000000000000000000000001525547673400157315ustar00rootroot00000000000000fnt-1.9.2/.github/workflows/main.yml000066400000000000000000000023621525547673400174030ustar00rootroot00000000000000--- name: Update google-fonts index on: push: check_run: schedule: - cron: "30 23 * * *" jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: repository: "${{ github.repository }}" ref: 'mirror' - name: Restore id: cache-primes-restore uses: actions/cache/restore@v4 with: key: ${{ runner.os }}-primes path: | fonts-main - name: Install imagemagick and file run: sudo apt-get update -qq && sudo apt-get install -qq imagemagick file - name: generate index and previews run: | ./update.sh git config --global user.email "${{github.repository_owner}}@users.noreply.github.com" git config --global user.name "fnt index" git add OFL.xz APACHE.xz || : git status -s -b -u if git commit -m $(date -Im); then git push fi - name: Save id: cache-primes-save if: always() && steps.cache-primes-restore.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: key: ${{ steps.cache-primes-restore.outputs.cache-primary-key }} path: | fonts-main fnt-1.9.2/FNT.m000066400000000000000000000215641525547673400131510ustar00rootroot00000000000000#import #import @interface AppDelegate : NSObject { NSWindow *window; NSTableView *tableView; NSImageView *imageView; NSMutableArray *fontList; } @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)notification { fontList = [[NSMutableArray alloc] init]; // Create window NSRect frame = NSMakeRect(100, 100, 800, 600); window = [[NSWindow alloc] initWithContentRect:frame styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskResizable | NSWindowStyleMaskClosable) backing:NSBackingStoreBuffered defer:NO]; [window setTitle:@"FNT"]; [window makeKeyAndOrderFront:nil]; [[NSProcessInfo processInfo] setProcessName:@"FNT"]; NSImage *icon = [[NSImage alloc] initWithContentsOfFile:@"fnt.png"]; [window setMiniwindowImage:icon]; // Split view (vertical: left and right) NSSplitView *splitView = [[NSSplitView alloc] initWithFrame:[[window contentView] bounds]]; [splitView setVertical:YES]; // LEFT-RIGHT split [splitView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [splitView setDividerStyle:NSSplitViewDividerStyleThin]; // Left: ScrollView with TableView NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 200, 600)]; [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; tableView = [[NSTableView alloc] initWithFrame:scrollView.bounds]; NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:@"FontColumn"]; [column setTitle:@"Fonts"]; [column setWidth:200]; [tableView addTableColumn:column]; [tableView setDelegate:self]; [tableView setDataSource:self]; [scrollView setDocumentView:tableView]; [scrollView setHasVerticalScroller:YES]; // Right: ImageView imageView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 600, 600)]; [imageView setImageScaling:NSImageScaleProportionallyUpOrDown]; [imageView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; // Add subviews to split view [splitView addSubview:scrollView]; [splitView addSubview:imageView]; [[window contentView] addSubview:splitView]; [self buildMenu]; [self loadFontList]; } - (void)buildMenu { NSMenu *mainMenu = [[NSMenu alloc] init]; NSMenuItem *appMenuItem = [[NSMenuItem alloc] init]; [mainMenu addItem:appMenuItem]; [NSApp setMainMenu:mainMenu]; // App Menu (named after app) NSString *appName = @"FNT"; NSMenu *appMenu = [[NSMenu alloc] initWithTitle:appName]; // About NSMenuItem *aboutItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"About %@", appName] action:@selector(showAbout) keyEquivalent:@""]; [aboutItem setTarget:self]; [appMenu addItem:aboutItem]; // Update NSMenuItem *updateItem = [[NSMenuItem alloc] initWithTitle:@"Update Fonts" action:@selector(runUpdate) keyEquivalent:@"u"]; [updateItem setTarget:self]; [appMenu addItem:updateItem]; [appMenu addItem:[NSMenuItem separatorItem]]; // Quit NSMenuItem *quitItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Quit %@", appName] action:@selector(terminate:) keyEquivalent:@"q"]; [appMenu addItem:quitItem]; // Attach submenu [appMenuItem setSubmenu:appMenu]; } /* - (void)buildMenu { NSMenu *menubar = [[NSMenu alloc] init]; NSMenuItem *appMenuItem = [[NSMenuItem alloc] init]; [menubar addItem:appMenuItem]; [NSApp setMainMenu:menubar]; NSMenu *appMenu = [[NSMenu alloc] init]; // About NSMenuItem *aboutItem = [[NSMenuItem alloc] initWithTitle:@"About" action:@selector(showAbout) keyEquivalent:@""]; [aboutItem setTarget:self]; [appMenu addItem:aboutItem]; // Update NSMenuItem *updateItem = [[NSMenuItem alloc] initWithTitle:@"Update Fonts" action:@selector(runUpdate) keyEquivalent:@"u"]; [updateItem setTarget:self]; [appMenu addItem:updateItem]; [appMenu addItem:[NSMenuItem separatorItem]]; // Quit NSMenuItem *quitItem = [[NSMenuItem alloc] initWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@"q"]; [appMenu addItem:quitItem]; [appMenuItem setSubmenu:appMenu]; } */ - (void)showAbout { NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:@"FNT"]; [alert setInformativeText:@"Created by Alex Myczko \nhttps://github.com/alexmyczko/fnt/"]; [alert addButtonWithTitle:@"OK"]; [alert runModal]; } - (void)runUpdate { NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:@"/usr/bin/env"]; [task setArguments:@[@"fnt", @"update"]]; [task launch]; [task waitUntilExit]; [self loadFontList]; } - (void)loadFontList { [fontList removeAllObjects]; NSLog(@"fnt search..."); NSPipe *pipe = [NSPipe pipe]; NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:@"/usr/bin/env"]; [task setArguments:@[@"fnt", @"search"]]; [task setStandardOutput:pipe]; NSFileHandle *handle = [pipe fileHandleForReading]; [task launch]; [task waitUntilExit]; NSData *data = [handle readDataToEndOfFile]; NSString *output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSArray *lines = [output componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; for (NSString *line in lines) { if ([line length] > 0) { [fontList addObject:line]; } } NSLog(@"fnt search... done"); [tableView reloadData]; } #pragma mark - TableView Data Source - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { return [fontList count]; } - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { NSTextField *cell = [tableView makeViewWithIdentifier:@"Cell" owner:self]; if (!cell) { cell = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)]; [cell setIdentifier:@"Cell"]; [cell setBezeled:NO]; [cell setDrawsBackground:NO]; [cell setEditable:NO]; [cell setSelectable:NO]; } [cell setStringValue:fontList[row]]; return cell; } #pragma mark - TableView Delegate - (void)tableViewSelectionDidChange:(NSNotification *)notification { NSInteger selectedRow = [tableView selectedRow]; if (selectedRow < 0 || selectedRow >= [fontList count]) return; NSString *fontName = fontList[selectedRow]; // Remove "fonts-" or "google-" prefix NSString *cleanFontName = fontName; if ([cleanFontName hasPrefix:@"fonts-"]) { cleanFontName = [cleanFontName substringFromIndex:6]; } else if ([cleanFontName hasPrefix:@"google-"]) { cleanFontName = [cleanFontName substringFromIndex:7]; } NSLog(@"Previewing font: %@", cleanFontName); // Run `fnt preview ` NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:@"/usr/bin/env"]; [task setArguments:@[@"fnt", @"preview", cleanFontName]]; // Redirect output to /dev/null to avoid blocking NSFileHandle *nullFile = [NSFileHandle fileHandleForWritingAtPath:@"/dev/null"]; if (nullFile) { [task setStandardOutput:nullFile]; [task setStandardError:nullFile]; } [task launch]; [task waitUntilExit]; // Load image from ~/.fnt/preview.png NSLog(@"Downloaded preview, showing now..."); NSString *imagePath = [NSHomeDirectory() stringByAppendingPathComponent:@".fnt/preview.png"]; if ([[NSFileManager defaultManager] fileExistsAtPath:imagePath]) { NSImage *image = [[NSImage alloc] initWithContentsOfFile:imagePath]; [imageView setImage:image]; } else { NSLog(@"Preview image not found at %@", imagePath); [imageView setImage:nil]; } } @end int main(int argc, const char * argv[]) { @autoreleasepool { [NSApplication sharedApplication]; AppDelegate *delegate = [[AppDelegate alloc] init]; [NSApp setDelegate:delegate]; [NSApp run]; } return 0; } fnt-1.9.2/LICENSE000066400000000000000000000021741525547673400133450ustar00rootroot00000000000000MIT License Copyright (c) 2021-2024 Alex Myczko 2024 Christopher Bock 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.9.2/Makefile000066400000000000000000000023421525547673400137750ustar00rootroot00000000000000ROOT := $(dir $(lastword $(MAKEFILE_LIST))) BINDIR=/usr/bin MANDIR=/usr/share/man ZCOMPDIR=/usr/local/share/zsh/site-functions BIN=$(ROOT)/fnt VERSION := $(shell sed -n 's/^VERSION\s*=\s*\(.*\)/\1/p' $(BIN)) all: @echo make install to install the software @echo make uninstall to remove the software @echo make macos build macOS gui @echo make gnustep build GNUstep gui install: # No direct dir install/create because of *BSD install -v -d $(DESTDIR)/$(BINDIR) install -v -m 755 fnt $(DESTDIR)/$(BINDIR)/ install -v -d $(DESTDIR)/$(MANDIR)/man1 install -v -m 644 fnt.1 $(DESTDIR)/$(MANDIR)/man1/ gzip -v -9 $(DESTDIR)/$(MANDIR)/man1/fnt.1 install -v -d $(DESTDIR)/$(ZCOMPDIR) install -v -m 644 completions/_fnt $(DESTDIR)/$(ZCOMPDIR)/ uninstall: rm -v -f $(DESTDIR)/$(BINDIR)/fnt rm -v -f $(DESTDIR)/$(MANDIR)/man1/fnt.1.gz rm -v -f $(DESTDIR)/$(ZCOMPDIR)/_fnt macos: @echo building for macOS clang -framework Cocoa -o FNT FNT.m gnustep: @echo building for GNUstep gcc `gnustep-config --objc-flags` -lgnustep-base -lgnustep-gui -lgnustep-back -fobjc-arc -o FNT FNT.m clean: @echo nothing to clean release: cd .. ; tar cf fnt-$(VERSION).tar --exclude-vcs fnt ; xz -9f fnt-$(VERSION).tar fnt-1.9.2/README.md000066400000000000000000000326351525547673400136240ustar00rootroot00000000000000``` .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 [![Packaging status](https://repology.org/badge/tiny-repos/fnt.svg)](https://repology.org/project/fnt/versions) # 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/), ~500 fonts available, only those starting with `fonts-` [Google fonts](https://github.com/google/fonts), ~2000 fonts available, (`google-` prefixed) # Installation ``` make install ``` You can also use your native package manager, see https://repology.org/project/fnt/versions Meanwhile also Debian stable (Bullseye) has an official BPO. # Usage ``` $ fnt update Updating... $ fnt info Information... Available Fonts: 2196 $ fnt search agave $ fnt preview 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) ; sleep 10; done` If you want to install all available fonts from Debian, you could run something like this: `while read -r font; do echo fnt install $font ; done < <(fnt search |grep -v "^google")` You end up with ~2700 font files (~500 fonts), taking up 1.6 GB. `for a in $(fnt search |grep "^google-"); do fnt install $a; done` You end up with ~4200 font files (~1600 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/ # 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://bits.debian.org/2021/12/2000-fonts-debian.html 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/ https://terminaltrove.com/fnt/ # 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](http://web.archive.org/web/20221003112339/https://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.9.2/completions/000077500000000000000000000000001525547673400146705ustar00rootroot00000000000000fnt-1.9.2/completions/_fnt000066400000000000000000000017301525547673400155420ustar00rootroot00000000000000#compdef fnt _arguments \ "1: :->mode" \ "2: :->fonts" case $state in mode) _values \ $state \ {update,-u}"[update fnt package cache]" \ {list,-l}"[lists installed fonts with glyphcount per font]" \ info"[information about how many fonts can be installed]" \ {help,-h}"[show help]" \ {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 help | update | info | search) ;; install|-i|preview|-p) local -a fonts fonts=($(fnt search 2>/dev/null)) _values \ "fonts" $fonts ;; list|-l|remove|-r) local -a fontindex fontindex=("${(@f)$(fnt list index)}") [[ -z $fontindex ]] && return 0 _values \ "fontindex" $fontindex ;; *) ;; esac ;; esac fnt-1.9.2/fnt000077500000000000000000000310001525547673400130430ustar00rootroot00000000000000#!/usr/bin/env bash # vim: autoindent noexpandtab # shellcheck disable=SC2237 set -e #set -x # APT but only for fonts # alex@aiei.ch # christopher@bocki.com VERSION=1.9.1 FNT_AWK=${FNT_AWK:-awk} FNT_SED=${FNT_SED:-sed} # Defaults BASE=${XDG_DATA_HOME:-"$HOME/.local/share"} TARGET="$BASE/fonts" FNTDATA="$BASE/fnt" # Fallback if ~/.local/share doesn't exist as if fnt would be the first program # writing to it... HAH! if ! test -d "$BASE"; then BASE="$HOME" TARGET="$BASE/.fonts" FNTDATA="$BASE/.fnt" fi FNTINDEXDIR="$FNTDATA/index" PACKAGES="$FNTDATA/Packages.xz" APACHE="$FNTDATA/APACHE.xz" OFL="$FNTDATA/OFL.xz" MIRROR="https://deb.debian.org/debian" INDEX="$MIRROR/dists/sid/main/binary-all/Packages.xz" GINDEX="https://alexmyczko.github.io/fnt" APACHEINDEX="$GINDEX/APACHE.xz" OFLINDEX="$GINDEX/OFL.xz" if [ ! -d "$FNTDATA" ] || [ ! -d "$FNTINDEXDIR" ]; then mkdir -p "$FNTINDEXDIR" || { echo "Couldn't create cache+index directory: $FNTDATA + /index" ; exit 1 ; } fi check_com() { if ! command -v "$1" &> /dev/null; then return 1; fi ; } if ! check_com uname; then s="Windows" else s=$(uname -s) fi search() { if [ -r "$PACKAGES" ] && [ -r "$APACHE" ] && [ -r "$OFL" ]; then xzcat "$PACKAGES" | "$FNT_AWK" '/^Package: fonts-.*'"$1"'.*/ {gsub(/^Package: /,"");print;}' xzcat "$APACHE" "$OFL" | "$FNT_AWK" '/^Package: .*'"$1"'.*/ {gsub(/^/, "google-", $2); print $2}' else echo "Can't find any Data, please run ${BASH_SOURCE[0]} update and try again." fi } urlencode() { local s="$1" i c for ((i=0; i<${#s}; i++)); do c=${s:i:1} case "$c" in [a-zA-Z0-9.~_-]) printf '%s' "$c" ;; *) printf '%%%02X' "'$c" ;; esac done } download() { # shellcheck disable=SC2086 local URL LOPTS URL="$1" if test -z "${1##*.deb}"; then if check_com /usr/lib/apt/apt-helper; then # Test if we could use an local apt-proxy (non-ssl) but no worry we do # md5sum checking on the file anyway. PROXYURL=${URL/https:/http:} if test -n "$(/usr/lib/apt/apt-helper auto-detect-proxy \ "$PROXYURL" | "$FNT_AWK" -F\' '{print $2}')"; then URL=$PROXYURL; fi # shellcheck disable=SC2090,SC2086 /usr/lib/apt/apt-helper $LOPTS download-file "$URL" "$2" >/dev/null return fi fi # Make sure special non-alpha chars are encoded for filenames. URL="${URL%/*}/$(urlencode "${URL##*/}")" if check_com fetch; then fetch -q -o "$2" "$URL" elif check_com curl; then curl -g -L -s -o "$2" "$URL" elif check_com wget; then wget -q -O "$2" "$URL" else print "ERROR: neither apt-helper, wget, curl nor fetch is installed" >&2 exit 69 fi } deb_handler() { # retrieve font from debian mirror and store infos for removal TMPDIR="$(mktemp -d)" chmod go-rwx "$TMPDIR" trap 'rm -rf -- "$TMPDIR"' EXIT PIT="${TMPDIR}/extract" mkdir -m go-rwx "$PIT" || { echo "Couldn't eat tartar." ; exit 73 ; } NAME="$1" INFOS="$(unxz -c "$PACKAGES" | "$FNT_SED" -n '/^Package: '"$NAME"'$/,/^$/ {H}; /^Package: '"$NAME"'$/ h; $ {g;p}' | "$FNT_AWK" '/^(Version|Installed-Size|Filename|Size|MD5sum): /')" VER="$("$FNT_AWK" '/^Version: /{print$2}' <<< "$INFOS")" INSTSIZE="$("$FNT_AWK" '/^Installed-Size: /{print$2}' <<< "$INFOS")" DOWNSIZE="$("$FNT_AWK" '/^Size: /{print$2}' <<< "$INFOS")" FPATH="$("$FNT_AWK" '/^Filename: /{print$2}' <<< "$INFOS")" FNAME="$(basename "$FPATH")" MD5SUM="$("$FNT_AWK" '/^MD5sum: /{print$2}' <<< "$INFOS") ${FNAME}" echo "Installing $NAME $VER [${DOWNSIZE} ${INSTSIZE}000 ${MIRROR}/${FPATH}]..." cd "$TMPDIR" || { echo "Couldn't cd into $TMPDIR" ; exit 66 ; } test -z "$(download "${MIRROR}/${FPATH}" "${TMPDIR}/$FNAME")" || { echo "Couldn't retrieve file." ; exit 69 ; } echo "$MD5SUM" > "${TMPDIR}/${FNAME}.md5" if $md5 -c "${TMPDIR}/${FNAME}.md5" >/dev/null; then # deb data DATA="$(ar t "$TMPDIR/$FNAME" | grep '^data\.tar')" mkdir -p "${PIT}/data" && cd "${PIT}/data" ar x "${TMPDIR}/$FNAME" "$DATA" tar xf "${PIT}/data/$DATA" find "${PIT}/data" -name "*.?tf" -exec cp {} "$TARGET" \; # deb control CONTROL="$(ar t "$TMPDIR/$FNAME" | grep '^control\.tar')" mkdir -p "${PIT}/control" && cd "${PIT}/control" ar x "${TMPDIR}/$FNAME" "$CONTROL" tar xf "${PIT}/control/${CONTROL}" "$FNT_SED" -n 's/^\(.*\) .*\/\(.*tf$\)/\1 \2/p' "${PIT}/control/md5sums" > "$FNTINDEXDIR/$NAME" "$FNT_AWK" -v pkg="$NAME" '$1="";{printf "Package: %s File:%s\n", pkg, $NFR}' "$FNTINDEXDIR/$NAME" else echo "Can't verify md5sum!" exit 65 fi } fnt_install() { local a o p a='' o='' p='' if [ ! -f "$PACKAGES" ]; then echo "Could not find $PACKAGES" echo "Please run ${BASH_SOURCE[0]} update" # could also just run itself with update... # but apt doesn't do that either :) exit 75 fi if [ ! $# -eq 2 ]; then echo "No fontname supplied." echo "Usage: ${BASH_SOURCE[0]} install agave" exit 64 fi FNTMATCH=$2 if [ ! -d "$TARGET" ]; then mkdir -p "$TARGET" fi # look for first font match p="$(unxz -c "$PACKAGES" | "$FNT_AWK" '/^Package: (fonts-)?'"$FNTMATCH"'/ {gsub(/^Package: /,"");print;exit;}')" if ! [ -z "$p" ]; then deb_handler "$p" return fi FNTMATCH=${FNTMATCH/google-/} a="$(unxz -c "$APACHE" | "$FNT_AWK" '/Package: '"$FNTMATCH"'$/,/^$/')" if ! [ -z "$a" ]; then url=$("$FNT_AWK" '/^URL:/ {print$2}' <<< "$a") dir="${url##*/}" files="$("$FNT_AWK" '/^ .*\.?tf$/ {print $2}' <<< "$a")" md5sums="$("$FNT_AWK" '/^ .*\.?tf$/ {gsub(/^ /,""); print}' <<< "$a")" for file in $files; do download "${url}/${file}" "${TARGET}/${file}" echo "Package: $FNTMATCH File: $file" done echo "$md5sums" > "${FNTINDEXDIR}/google-${dir}" return else o="$(unxz -c "$OFL" | "$FNT_AWK" '/Package: '"$FNTMATCH"'$/,/^$/')" if ! [ -z "$o" ]; then url="$("$FNT_AWK" '/^URL:/ {print$2}' <<< "$o")" dir="${url##*/}" files="$("$FNT_AWK" '/^ .*\.?tf$/ {print $2}' <<< "$o")" md5sums="$("$FNT_AWK" '/^ .*\.?tf$/ {gsub(/^ /,""); print}' <<< "$o")" for file in $files; do download "${url}/${file}" "${TARGET}/${file}" echo "Package: $FNTMATCH File: $file" done echo "$md5sums" > "${FNTINDEXDIR}/google-${dir}" return fi fi echo "Font \"$2\" not found" exit 1 } render_preview() { PREVIEW="$1" _app=( chafa="-w 9" timg="" ) for a in "${_app[@]}"; do bin=${a%=*} opt=${a#*=} if check_com "$bin"; then if file --brief --mime-type "$PREVIEW" |grep -q 'image/*'; then # shellcheck disable=SC2086 $bin $opt "$PREVIEW" return 0 fi return 0 else missing=( "${missing[@]}" "$bin" ) fi done echo "Warning: ${missing[*]} not available. Please install one of them." >&2 echo -e "\v\t${PREVIEWURI}\v" return 69 } preview() { PREVIEW="${FNTDATA}/preview.png" PREVIEWURI="https://screenshots.debian.net/screenshot/fonts-$1" if download "$PREVIEWURI" "${PREVIEW}"; then # if we get nothing / "this picture is not available" pic if [ "$($md5 "$PREVIEW" | "$FNT_AWK" '{print$1}')" = "b5765b390157e36eaf721c8848a4b04d" ]; then PREVIEWURI="$GINDEX/preview/$1/preview.webp" if download "$PREVIEWURI" "$PREVIEW"; then if ! file --brief --mime-type "$PREVIEW" |grep -q 'image/*'; then echo "Couldn't retrieve a preview for ${1}." exit 69 fi fi fi if render_preview "$PREVIEW"; then PRINTED=1 echo "$1: $PREVIEWURI" fi fi if [ "$PRINTED" != "1" ]; then echo "Couldn't display a preview for $1." >&2 return 69 fi } case "$s" in Darwin) #echo macOS md5="md5sum" check="$md5 curl brew otfinfo ar" # otfinfo comes with lcdf-typetools TARGET="$HOME/Library/Fonts/" FNTDATA="$HOME/.fnt" ;; Linux|GNU/kFreeBSD|GNU) #echo Linux md5="md5sum" check="$md5 ar "$FNT_AWK" curl file otfinfo tar unxz xzcat" # TARGET="$HOME/.fonts/" if [ 0 -eq "$(id -u)" ]; then TARGET="/usr/local/share/fonts/" fi ;; FreeBSD) #echo FreeBSD md5="md5" check="$md5 curl otfinfo ar" TARGET="$HOME/.fonts" FNTDATA="$HOME/.fnt" ;; OpenBSD) #echo OpenBSD md5="md5" check="$md5 curl otfinfo ar" #TARGET="$HOME/.local/share/fonts" ;; Haiku) #echo Haiku OS check="curl ar" TARGET="$HOME/config/non-packaged/data/fonts" FNTDATA="$HOME/.fnt" ;; Windows) #echo Windows check="cmd.exe" TARGET="$USERPROFILE\\Fonts" ;; *) echo "Please report $s to https://github.com/alexmyczko/fnt/issues" exit 1 ;; esac for a in $check; do if ! check_com "$a"; then echo "$a not found, please install it with your package manager." exit 69 fi done if check_com lolcat; then cat=lolcat; else cat=cat; fi PATH="/usr/games:$PATH" case "$1" in help|-h) cat << 'EOF' Syntax: fnt [ update | list [indexfile]| info | help ] fnt [ install | remove | preview | search ] font help|-h this help info information about how many fonts can be installed and are available install|-i install a font list|-l lists installed fonts with glyphcount per font preview|-p preview a font remove|-r remove a font search|-s search for font update|-u updates the font package index of debian sid EOF ;; update|-u) echo -n "Updating... " mkdir -p "${FNTDATA}/index" && rm -rf "$PACKAGES" "$APACHE" "$OFL" PACKAGESTMP=$(mktemp) download "$INDEX" "$PACKAGESTMP" xzcat "$PACKAGESTMP" | "$FNT_AWK" '/^Package: fonts-/,/^$/' > "${PACKAGES%.xz}"; xz "${PACKAGES%.xz}" ; rm "$PACKAGESTMP" ; echo -n "${PACKAGES##*/}... " download "$APACHEINDEX" "$APACHE"; echo -n "${APACHE##*/}... " download "$OFLINDEX" "$OFL"; echo -n "${OFL##*/}... " echo -n -e "done.\n" ;; info) mkdir -p "$FNTINDEXDIR" INSTALLEDFONTS=$(fnt list index) ALLFONTS=$(${BASH_SOURCE[0]} search) printf 'fnt v:%s infos...\nFNTDATA %s (%s)\nTARGET %s (%s)\n' \ "$VERSION" \ "$FNTDATA" "$(du -hs "$FNTDATA" 2>/dev/null |cut -f1)" \ "$TARGET" "$(du -hs "$TARGET" 2>/dev/null |cut -f1)" printf 'Available Fonts from\tDebian: %i\tGoogle: %i\n' \ "$(grep -c '^fonts-' <<< "$ALLFONTS")" \ "$(grep -c '^google-' <<< "$ALLFONTS")" printf 'Installed Fonts from\tDebian: %i\tGoogle: %i\n' \ "$(grep -c '^fonts-' <<< "$INSTALLEDFONTS")" \ "$(grep -c '^google-' <<< "$INSTALLEDFONTS")" ;; list|-l) if [ $# -eq 1 ]; then find "$TARGET" -iname '*.?tf' 2>/dev/null | sort | while read -r f; do IDX=$(basename "$(grep -rlF "$(basename "$f")" "$FNTINDEXDIR")") if test -z "$IDX"; then IDX=NOT-MANAGED-BY-FNT; fi echo "$IDX: $(basename "${f}") [$(otfinfo -u "$f" 2>/dev/null | wc -l | "$FNT_AWK" '{print $1}')]" unset IDX done fi if [ $# -eq 2 ] && [ "$2" = "index" ] ; then find "$FNTINDEXDIR" -type f | "$FNT_AWK" -F'/' '{print $NF}' fi if [ $# -eq 2 ] && [ -r "$FNTINDEXDIR/$2" ]; then # shellcheck disable=SC2046 "$FNT_AWK" -v target="$TARGET" \ '$1="";{printf "%s/%s\n", target, substr($0,2)}' \ "$FNTINDEXDIR/$2" | while read -r font; do echo "$(basename "${font}") [$(otfinfo -u "$font" 2>/dev/null | wc -l)]" done fi ;; preview|-p) if [ $# -ne 2 ]; then echo "No fontname supplied." echo "Usage: ${BASH_SOURCE[0]} preview agave" exit 64 fi mkdir -p "$FNTINDEXDIR" rm -f "${FNTDATA}/preview.png" FNTMATCH="$("$FNT_SED" -E 's/^(fonts|google)-//g' <<< "$2")" preview "$FNTMATCH" ;; install|-i) fnt_install "$@" ;; remove|-r) if [ $# -eq 1 ] ; then echo "Usage: ${BASH_SOURCE[0]} remove fonts-agave agave-b-autohinted.ttf" echo "To get a list of indexes/files: ${BASH_SOURCE[0]} list [index|fonts-agave]" fi if [ $# -eq 2 ] && [ -w "$FNTINDEXDIR/$2" ] ; then if [ -e "$FNTINDEXDIR/$2" ]; then "$FNT_AWK" '{print$2}' "$FNTINDEXDIR/$2" |while read -r FONTFILE; do ${BASH_SOURCE[0]} remove "$2" "$FONTFILE" done else echo "Couldn't find the font $2" fi rm -fv "${FNTINDEXDIR:?}/$2" fi if [ $# -eq 3 ] && [ -w "$FNTINDEXDIR/$2" ] && [ -w "$TARGET/$3" ] ; then if grep -q "$3" "$FNTINDEXDIR/$2"; then rm -fv "${TARGET:?}/${3:?}" fi fi ;; search|-s) search "$2" ;; purge) if [ $# -eq 1 ] ; then echo "This command will remove $TARGET and $FNTDATA!" echo -e "If you are certain use:\n\t${BASH_SOURCE[0]} purge yes-i-am-sure" echo "You have been warned." fi if [ $# -eq 2 ] && [ "$2" = "yes-i-am-sure" ] ; then rm -Rvf "${TARGET:?}" "${FNTDATA:?}" fi ;; moo) echo "This fnt does not have cow powers." ;; wak) $cat << 'EOF' _()< wak wak (__) EOF ;; quak) $cat << 'EOF' _______ < QUAK? > ------- \ \ oO)-. .-(Oo /__ _\ /_ __\ \ \( | ()~() | )/ / \__|\ | (-___-) | /|__/ ' '--' ==`-'== '--' ' EOF ;; *) $cat << EOF .d888 $VERSION d88P" 888 888 888 .d88888 888888b. d888888 888 888 "88b 888 888 888 888 888 888 888 888 Y88b. 888 888 888 "Y888 EOF ;; esac fnt-1.9.2/fnt.1000066400000000000000000000017671525547673400132200ustar00rootroot00000000000000.TH man 1 "12 Aug 2023" "1.9" "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 info show available/installed font summary. .TP .I fnt search aga search for fonts named aga. .TP .I fnt install agave install the font called agave. .TP .I fnt purge deletes all data in FNTDATA and TARGET. See \fBfnt info\fP for more information. .TP .I fnt preview agave show a text-based preview of the font called agave. .TP .I fnt remove agave [agave-boo-autohinted.ttf] remove a font package or selected fontfiles. .TP .I fnt list [\fIindex | fonts-agave\fP] 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