• Stars
    star
    912
  • Rank 50,097 (Top 1.0 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Highly customizable and minimal font previewer written in bash


✨ Very customizable and minimal font previewer written in bash ✨

fontpreview is a commandline tool that lets you quickly search for fonts that are installed on your machine and preview them. The fuzzy search feature is provided by fzf and the preview is generated with imagemagick and then displayed using sxiv. This tool is highly customizable, almost all of the variables in this tool can be changed using the commandline flags or you can configure them using environment variables.

Dependencies

  • xdotool
  • fzf
  • imagemagick
  • sxiv

Installation

Install using make

# Clone the repo
$ git clone https://github.com/sdushantha/fontpreview

# Change your current directory to fontpreview
$ cd fontpreview

# Install it
$ sudo make install

Install it locally

# Download the fontpreview source code, save as fontpreview
# and make it executeable
$ curl -L https://git.io/raw_fontpreview > fontpreview && chmod +x fontpreview

# Then move fontpreview to somewhere in your $PATH
# Here is an example
$ mv fontpreview ~/scripts/

Usage

$ fontpreview --help
usage: fontpreview [-h] [--size "px"] [--position "+x+y"] [--search-prompt SEARCH_PROMPT]
                   [--font-size "FONT_SIZE"] [--bg-color "BG_COLOR"] [--fg-color "FG_COLOR"]
                   [--preview-text "PREVIEW_TEXT"] [-i font.otf] [-o preview.png] [--version]

β”Œβ”€β”β”Œβ”€β”β”Œβ”β”Œβ”Œβ”¬β”β”Œβ”€β”β”¬β”€β”β”Œβ”€β”β”¬  β”¬β”¬β”Œβ”€β”β”¬ ┬
β”œβ”€ β”‚ β”‚β”‚β”‚β”‚ β”‚ β”œβ”€β”˜β”œβ”¬β”˜β”œβ”€ β””β”β”Œβ”˜β”‚β”œβ”€ β”‚β”‚β”‚
β””  β””β”€β”˜β”˜β””β”˜ β”΄ β”΄  β”΄β””β”€β””β”€β”˜ β””β”˜ β”΄β””β”€β”˜β””β”΄β”˜
Very customizable and minimal font previewer written in bash

optional arguments:
   -h, --help            show this help message and exit
   -i, --input           filename of the input font (.otf, .ttf, .woff are supported)
   -o, --output          filename of the output preview image (input.png if not set)
   --size                size of the font preview window
   --position            the position where the font preview window should be displayed
   --search-prompt       input prompt of fuzzy searcher
   --font-size           font size
   --bg-color            background color of the font preview window
   --fg-color            foreground color of the font preview window
   --preview-text        preview text that should be displayed in the font preview window
   --version             show the version of fontpreview you are using

If you want to generate a preview image for a single font file (.otf, .ttf, and .woff are supported), use the -i and -o option to indicate the filename of the input font and the output preview image.

$ fontpreview -i font.otf -o preview.png

This can be used with ΓΌberzug to implement font preview within terminal file managers such as vifm.

A detailed setup instructions can be found here

Configure

You can configure fontpreview through environment variables.

This can be in your .bashrc, .zshrc, etc

# Input prompt of fuzzy searcher
export FONTPREVIEW_SEARCH_PROMPT="❯ "

# Size of the font preview window
export FONTPREVIEW_SIZE=532x365

# The position where the font preview window should be displayed
export FONTPREVIEW_POSITION="+0+0"

# Font size
export FONTPREVIEW_FONT_SIZE=38

# Background color of the font preview window
export FONTPREVIEW_BG_COLOR="#ffffff"

# Foreground color of the font preview window
export FONTPREVIEW_FG_COLOR="#000000"

# Preview text that should be displayed in the font preview window
export FONTPREVIEW_PREVIEW_TEXT="ABCDEFGHIJKLM\nNOPQRSTUVWXYZ\nabcdefghijklm\nnopqrstuvwxyz\n1234567890\n!@$\%(){}[]"

More Repositories

1

tmpmail

A temporary email right from your terminal written in POSIX sh
Shell
3,841
star
2

wifi-password

Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect
Python
2,905
star
3

tmpsms

A temporary SMS utility right from your terminal written in POSIX sh
Shell
1,039
star
4

qr-filetransfer

Transfer files over WiFi between your computer and your smartphone from the terminal
Python
969
star
5

farge

Click on a pixel on your screen and show its color value
Shell
480
star
6

recycle-bin-themes

Silly icons for the Windows Recycle Bin
PowerShell
476
star
7

snaprecovery

Recover old Snaps that have β€œdisappeared” from Snapchat
Shell
427
star
8

soundcloud-dl

🎡 Download SoundCloud music at 128kbps with album art and tags
Python
320
star
9

kunst

Download and display album art or display embedded album art
Shell
309
star
10

dora

Find exposed API keys based on RegEx and get exploitation methods for some of keys that are found
Python
307
star
11

facebook-dl

πŸ“Ό Very minimal Facebook downloader written in 28 lines of Python code (not including comments and blank spaces)
Python
237
star
12

gitdir

Download a single directory/folder from a GitHub repo
Python
224
star
13

dotfiles

my dotfiles
Lua
223
star
14

svart

Change between dark/light mode depending on the ambient light intensity
Python
167
star
15

fileinfo

πŸ“„Get information on over 10,000 file extensions right from the terminal
Python
111
star
16

meobrute

Automate the process of brute forcing the My Eyes Only pin code on Snapchat
Shell
93
star
17

insta-dl

πŸ“· Download Instagram images from a public user.
Python
93
star
18

ff-pdf

Turn a Firefox profile into a standalone PDF reader app
Shell
87
star
19

pyradio

πŸ“» Play your favorite radio station from the terminal
Python
74
star
20

snapchat

Messing around with Snapchat's web APIs
Python
68
star
21

pine

πŸ“· A simple image to text OCR scanner for macOS
Python
55
star
22

down

β˜‘οΈ A CLI tool to check if a site or a list of sites are down or up
Python
54
star
23

vsco-dl

πŸ“· Download all of the images and videos from a VSCO user
Python
39
star
24

getroot

πŸ› οΈ Tool to bypass my school's security system to get sudo privileges on MacOS
Shell
38
star
25

bed

🧩 A very simple command line Browser Extension Downloader
Python
34
star
26

macbook-keyboard-visualizer

πŸ”† Audio visualizer using the MacBook keyboard lights
Python
31
star
27

dark-mode

πŸŒ— Control the macOS dark mode from the terminal
Python
22
star
28

awesome-bounty-rewards

A curated list of BBPs and VDPs that offer awesome/unique rewards
7
star
29

datainnbrudd.no

Overivew of all cyber incidients in Norway
MDX
7
star
30

top-secret

highly confiential top secret repository
Shell
6
star
31

sdushantha.github.io

HTML
4
star
32

bacit-php

PHP work for uni
PHP
1
star
33

bacit

IT og informasjonssystemer
Java
1
star
34

w

w
HTML
1
star
35

myquote

En teste modul 1, del 2 for is-105 faget
Go
1
star