You are not logged in.

#1 2018-06-18 20:29:12

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,744

urxvt show/preview xft fonts

A dumb, but kinda fun script to jump over xft mono fonts and preview them in urxvt. Bitmap fonts not supported.

https://raw.githubusercontent.com/bront … eSomeFonts

showMeSomeFonts-fs8.png

usage: just run it from urxvt with no parameters.

Last edited by brontosaurusrex (2018-06-18 20:44:52)

Offline

#2 2018-06-18 23:11:35

sleekmason
zoom
Registered: 2018-05-22
Posts: 1,104
Website

Re: urxvt show/preview xft fonts

Okay, this is kinda neat:)  A delay before showing each font installed in it's own format/font.

DejaVuSansMono (/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf)
Inconsolata (/usr/share/fonts/truetype/inconsolata/Inconsolata.otf)
LiberationMono (/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf)
NotoMono (/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf)

Offline

#3 2018-06-19 05:23:46

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: urxvt show/preview xft fonts

it shows me each font twice, not sure why. I added '| uniq' to the fc-list command-pipe-oneliner:

fc-list -f "%{file}\n" :mono | grep -ivE "bold|italic|black|light|icons|.pfb" | sort | uniq | while read -r line ; do

that helps with that.

still, i get a lot of duplicates, e.g.:

Adobe-Courier (/usr/share/fonts/100dpi/courB08.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB10-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB10.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB12-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB12.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB14-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB14.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB18-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB18.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB24-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courB24.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO08-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO08.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO10-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO10.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO12-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO12.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO14-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO14.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO18-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO18.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO24-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courBO24.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courO08-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courO08.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courO10-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courO10.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courO12-ISO8859-1.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courO12.pcf.gz)
Adobe-Courier (/usr/share/fonts/100dpi/courO14-ISO8859-1.pcf.gz)
( ... the list goes on ...)

- and that's not even a monospace font.

Offline

#4 2018-06-19 05:45:09

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,744

Re: urxvt show/preview xft fonts

@ohnonot,  not sure how to do it properly, at the moment workaround is adding stuff to one of the blacklist lines, real solution would be a proper whitelist.

Last edited by brontosaurusrex (2018-06-19 06:17:33)

Offline

#5 2018-06-19 12:45:56

sleekmason
zoom
Registered: 2018-05-22
Posts: 1,104
Website

Re: urxvt show/preview xft fonts

Noting all the files above are .gz instead of ttf or otf.

Would it be possible to just blacklist any of the compressed/tar packages? (.gz)?  I suppose that would just extend the issue/problem further.

Offline

#6 2018-06-19 18:56:42

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,744

Re: urxvt show/preview xft fonts

Why not, added a whitelist of known-good extensions

grep -iE "\.ttf$|\.otf$|\.woff$|\.woff2$"

Last edited by brontosaurusrex (2018-06-19 18:58:56)

Offline

Board footer

Powered by FluxBB