The Wayback Machine - https://web.archive.org/web/20200208181633/https://github.com/sdushantha/fontpreview
Skip to content
πŸ”‘ Very customizable and minimal font previewer written in bash
Shell Makefile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
extra [ImgBot] Optimize images Feb 8, 2020
LICENSE Create LICENSE Feb 8, 2020
Makefile add all files Feb 8, 2020
README.md added syntex highlighting to local installtion method Feb 8, 2020
fontpreview fixed all indentation errors Feb 8, 2020

README.md


✨ 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 highley customizeable, 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"] [--version]
 
β”Œβ”€οΏ½?β”Œβ”€οΏ½?β”ŒοΏ½?β”Œβ”Œβ”¬οΏ½?β”Œβ”€οΏ½?┬─�?β”Œβ”€οΏ½?┬  β”¬β”¬β”Œβ”€οΏ½?┬ ┬
β”œβ”€ β”‚ β”‚β”‚β”‚β”‚ β”‚ β”œβ”€β”˜β”œβ”¬β”˜β”œβ”€ β””οΏ½?β”Œβ”˜β”‚β”œβ”€ β”‚β”‚β”‚
β””  β””β”€β”˜β”˜β””β”˜ β”΄ β”΄  β”΄β””β”€β””β”€β”˜ β””β”˜ β”΄β””β”€β”˜β””β”΄β”˜
Very customizable and minimal font previewer written in bash
 
optional arguments:
   -h, --help            show this help message and exit
   --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 kunst you are using

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!@$\%(){}[]"
You can’t perform that action at this time.