git clone https://git.lucas.co/fontpreview.git
documentations for -i -o options
README.md | 36 ++++++++++++++++++++++++++++--------
extra/vifm.png | Bin 0 -> 174389 bytes
fontpreview | 6 ++++--
3 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 43ac9f0..479fd25 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
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
+variables in this tool can be changed using the commandline flags or you can
configure them using environment variables.

@@ -17,7 +17,7 @@ configure them using environment variables.
- `sxiv`
## Installation
-### Install using ```make```
+### Install using `make`
```bash
# Clone the repo
$ git clone https://github.com/sdushantha/fontpreview
@@ -41,26 +41,28 @@ $ mv fontpreview ~/scripts/
```
### AUR package
-For Arch based distros, an [AUR package](https://aur.archlinux.org/packages/fontpreview/) is available at
+For Arch based distros, an [AUR package](https://aur.archlinux.org/packages/fontpreview/) is available at
Maintained by **[@elsorino](https://github.com/elsorino)**
```bash
-yay -Sy fontpreview
+yay -Sy fontpreview
```
## 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]
-
+ [--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
@@ -68,8 +70,26 @@ optional arguments:
--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
+ --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](https://github.com/seebye/ueberzug)
+to implement font preview within terminal file managers such as
+[vifm](https://vifm.info/).
+
+
+
+A detailed setup instructions can be found [here](https://krasjet.com/scribbles/font-preview.html)
+
## Configure
You can configure `fontpreview` through environment variables.
diff --git a/extra/vifm.png b/extra/vifm.png
new file mode 100644
index 0000000..70103e6
Binary files /dev/null and b/extra/vifm.png differ
diff --git a/fontpreview b/fontpreview
index 1dbd993..4f7c014 100755
--- a/fontpreview
+++ b/fontpreview
@@ -24,7 +24,7 @@ PREVIEW_TEXT="ABCDEFGHIJKLM\nNOPQRSTUVWXYZ\nabcdefghijklm\nnopqrstuvwxyz\n123456
show_help() {
echo "usage: fontpreview [-h] [--size \"px\"] [--position \"+x+y\"] [--search-prompt SEARCH_PROMPT]"
echo " [--font-size \"FONT_SIZE\"] [--bg-color \"BG_COLOR\"] [--fg-color \"FG_COLOR\"]"
- echo " [--preview-text \"PREVIEW_TEXT\"] [--version]"
+ echo " [--preview-text \"PREVIEW_TEXT\"] [-i font.otf] [-o preview.png] [--version]"
echo " "
echo "┌─┐┌─┐┌┐┌┌┬┐┌─┐┬─┐┌─┐┬ ┬┬┌─┐┬ ┬"
echo "├┤ │ ││││ │ ├─┘├┬┘├┤ └┐┌┘│├┤ │││"
@@ -33,6 +33,8 @@ show_help() {
echo " "
echo "optional arguments:"
echo " -h, --help show this help message and exit"
+ echo " -i, --input filename of the input font (.otf, .ttf, .woff are supported)"
+ echo " -o, --output filename of the output preview image (input.png if not set)"
echo " --size size of the font preview window"
echo " --position the position where the font preview window should be displayed"
echo " --search-prompt input prompt of fuzzy searcher"
@@ -40,7 +42,7 @@ show_help() {
echo " --bg-color background color of the font preview window"
echo " --fg-color foreground color of the font preview window"
echo " --preview-text preview text that should be displayed in the font preview window"
- echo " --version show the version of kunst you are using"
+ echo " --version show the version of fontpreview you are using"
}
pre_exit() {