Git Product home page Git Product logo

fontporter's Introduction

AUTHOR

Fontporter, libUseful-lua and libUseful are (C) 2020 Colum Paget. They are released under the Gnu Public License so you may do anything with them that the GPL allows.

Email: [email protected]

SYNOPSIS

Fontporter is a terminal font viewer and installer that supports font previews using the sixel system, allowing graphics to be viewed in supporting terminals such as xterm. It can install fonts from googlefonts, fontsquirrel, fontsource.org, Mozilla's CDN and from a list of font's available 'elsewhere'.

INSTALL

Fontporter requires both libUseful (https://github.com/ColumPaget/libUseful) and libUseful-lua (https://github.com/ColumPaget/libUseful-lua) to be installed. Font preview requires image magick to be installed (at least the 'convert' command) in order to create the preview image.

Fontporter consists of a single 'fontporter.lua' file that you can place somewhere in your path. You can either run it as 'lua fontporter.lua' or, as I do, use linux's binfmt system to automatically invoke lua.

There's also a 'fonts-elsewhere.conf' file that can either be put in the '/etc' or '~/.config/fontporter/' that supplies a list of fonts available on the internet.

USAGE

Currently fontporter has the following command-line options:

  -sixel                activate sixel font previews
  -viewer <prog>        set viewer to use for previews
  -fontsdir <path>      set fonts directory
	-?                    display help
	-h                    display help
	-help                 display help
	--help                display help

The 'fonts directory' is the directory that fonts are installed into when the user choses 'system wide install'. It defaults to /usr/share/fonts.

'sixel mode' requires image-magick to be installed to produce the font previews, and a terminal with the sixel feature enabled to display them.

the 'viewer' option allows supplying the name or path of an image viewer program to view font previews. Font previews require image-magick installed to generate them.

The app is menu-driven, and can be navigated using the arrow keys, or w,s,enter,backspace or i,k,enter,backspace, or any combination of these. When a font is selected from any of the menus for external fonts, it can be installed either in the user's font directory (~/.local/share/fonts) using the 'i' key, or in the systemwide fonts directory (default: '/usr/share/fonts') using the 'g' key. System-wide install requires permission to write into the target directory, and to update the font-config cache, so it's often best to just run the app using sudo.

PREVIEW

Fonts can be previewed either by activating sixel mode or by pressing 'v' in the font screen. The 'v' key activates a font viewer, currently one of "display", "feh", "fim", "sxiv", "xv", "giv" or "meh". (If you want to use another image viewer use the '-viewer' command-line option).

Preview requires image magick's 'convert' command to be available.

PCF and OTB fonts cannot be previewed at current.

Fonts to be previewed are downloaded into '~/.font_preview'. Nothing has yet been implemented to clear out this directory, so it will tend to fill up over time.

sixel-mode preview requires a terminal emulator that supports sixel display. xterm supports this if run as xterm -ti vt340.

TODO

Find a way to preview PCF and OTB fonts. Find a way to organize fonts by supported languages. Offer preview for different language/character sets Add cache-cleanup system to clean out ~/.font_preview directory Maintain style/language/license information of downloaded fonts (this is currently lost). Add management functions to allow grouping fonts into use-cases.

SCREENSHOTS

Viewing a font from googlefonts in xterm-sixel mode

googlefonts sixel preview

localfonts sixel-mode browsing preview

locally installed fonts sixel preview

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.