9 cachedir
="${XDG_CACHE_HOME:-$HOME/.cache}/llpp"
10 test -d "$cachedir" || die
"cache directory '$cachedir' does not exist"
15 executable_p
() { command -v "$1" >/dev
/null
2>&1; }
19 eval "$1() { die \"$2 is needed for \$type conversion\"; }"
24 <pre style="font-size: ${1}pt;">
27 test -n "$2" && cat $2 ||
cat <<EOF
32 abcdefghijklmnopqrstwxyz
33 ABCDEFGHIJKLMNOPQRSTWXYZ
34 абвгдеёжзийклмнопрстуфхцчшщэюя
35 АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЭЮЯ
36 инпипнишпнипшнипнпншпнпинпипнпипщнпипипин
37 иннициатива шиорокошарикоподшипниковый взбзднуть гидроаэроионизация
38 телегаммааппарат фельдъегерь четырёхсотпятидесятисемимиллиметровое
39 превысокомногорассмотрительствующий вскользь забулдыжничество
46 S in S9 59 S9 is like 5
48 3ЗЭэзээз3ЗqgO0o ijklI1| bgqpykvwlliliiijil1 lLLl
49 01234567890 3ДС ЗДС ӠДС ʒДС
50 rnrmnnmrrrnmmr <i>Nürnberg</i> (rn -> m)
52 örök für A̋ a̋ ő ű https://en.wikipedia.org/wiki/Diacritic
55 curly vs plain braces {} () {} →
56 Bjarne Stroustrup (/ˈbjɑːrnə ˈstraʊstrʊp/; Danish: [ˈbjɑːnə ˈsdʁʌwˀsdʁɔb]
62 Commutative [Co mm utative]
64 Before [Bef ore, Be for e]
65 higher [gh, h i gher, hi gher]
74 mkfifo [mk f i fo, mk f i fo]
81 Compiling [Co mp iling]
87 buildglyphs.js [buil dg lyphs]
97 Apostolic [A postolic]
99 Прокофьевну [Про ко фьевну]
102 обьявляным [об ья вленым]
104 etymological [et ymologoical]
107 некочевого [не ко чевого]
110 покрытие [по кр ытие]
111 Julia [J ulia | Jul i a]
112 Singapore [Si ng apore]
115 Joe Armstrong [J oe (rip :()]
120 automatically effective
121 Ilium is the Latin for Ilion.
124 Box drawing alignment tests: █
126 ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳
127 ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳
128 ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳
129 ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
130 ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎
131 ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏
132 ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█
135 https://mirrors.zju.edu.cn/CTAN/fonts/gofonts/doc/gofonts.pdf (page 2)
137 DIN Legibility Standard
139 The recent German DIN 1450 legibility standard
140 recommends several features for font legibility, including
141 differentiation of letter shapes to reduce confusion. The Go fonts
142 conform to the 1450 standard by carefully differentiating zero from
143 capital O; numeral 1 from capital I (eye) and lowercase l (ell);
144 numeral 5 from capital S; and numeral 8 from capital B. The shapes of
145 bowls of b d p q follow the natural asymmetries of legible Renaissance
146 handwriting, aiding differentiation to reduce confusion. [5]
149 Mistaking S for a 5 (at certain sizes) is more of a problem... but... Ze Germans
151 (https://en.wikipedia.org/wiki/Jabberwocky
152 Idea from the aforementioned gofonts paper)
154 Бе сгладне и честлинните комбурси Það leið að stekju, og slýgir greðlar
155 търляха се и сврецваха във плите; sig snældu og böluðu um slöffruna,
156 съвсем окласни бяха тук щурпите og angurvært sungu sópfiðrungar
157 и отма равапсатваха прасурси. við sífgelt týðmana svíræna.
159 (https://en.wikipedia.org/wiki/Typeface)
161 For the rational mind, type design can be a maddening game
162 of drawing things differently in order to make them appear the
169 # https://github.com/react-boilerplate/react-boilerplate/issues/1340
170 test -d "$cachedir/fonts" || mkdir
"$cachedir/fonts"
171 filename
="$(basename "$1")"
173 cat >"$cachedir/fonts/text.html" <<EOF
174 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
175 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
178 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
179 <title>$filename</title>
180 <style type="text/css">
181 @font-face { font-family: moo; src: url('$1'); }
182 pre { font-family: moo; }
188 for size
in 6 8 10 12 4 2; do
189 text
$size $textfilename >>"$cachedir/fonts/text.html"
191 cat >>"$cachedir/fonts/text.html" <<EOF
193 $(fc-scan -f '%{fullname} %{style} %{slant} %{file} %{fontversion} %{capability} %{lang}' "$1" || file "$1")
199 trap 'test -n "$casp" && rm -f "$casp"' 0
201 while getopts s
:c
:m
:t
:fu opt
; do
206 c
) css
="-s $OPTARG";;
207 s
) textfilename
="$OPTARG";;
208 ?
) die
"usage: $0 [-c css] [-m mime/type] [-t filter] [-f] [-s textfile] [path|url]";;
211 shift $
(($OPTIND - 1))
212 test -z "$1" && die
"usage $0: path"
215 if ${force-test ! -e "$1"} && expr >/dev
/null
"$1" : "\(ftp\|https\?\)://"; then
216 if executable_p wget
; then
217 dl
() { wget
-q $1 -O $2; }
218 elif executable_p curl
; then
219 dl
() { curl
-L $1 -o $2; }
221 die
"no program to fetch remote urls found"
224 hashof
="$cachedir/$(basename "$1")"
225 dl
"$1" "$hashof" ||
test -e "$md5of"
227 set -- "$hashof" "$@"
232 test -z "$type" && { ft
=$
(file -L --mime-type -b "$1") || die
"$ft"; }
235 application
/x-gzip | application
/x-compress
) dc=zcat
;;
236 application
/x-xz
) dc=xzcat
;;
237 application
/x-bzip2
) dc=bzcat
;;
238 *) unset dc || true
;;
241 filt
='"${dc-cat}" "$1" |'
245 application
/postscript
) type=ps
;;
246 application
/pdf
) type=pdf
;;
247 image
/vnd.djvu
) type=djvu
;;
248 text
/html
) type=html
;;
249 text
/plain
) type=text
;;
250 application
/msword
) type=word
;;
251 application
/vnd.openxmlformats-officedocument.
* \
252 | application
/vnd.ms-powerpoint \
253 | application
/vnd.ms-excel \
254 | application
/vnd.oasis.opendocument.
*) type=uno
;;
255 image
/svg
+xml
) type=svg
;;
256 image
/png | image
/jpeg
) test -n "$dc" && type="image" ||
type="image2";;
257 image
/*) type=image
;;
258 application
/x-dvi
) type=dvi
;;
259 application
/x-font-ttf \
260 | application
/vnd.ms-opentype \
261 | application
/font-sfnt
) type=font
;;
267 if test -z "$type"; then
269 mime
=$
(file -L --mime-type -b "$1" || die
"$mime") || \
270 $
(file -L --mime-type -bz "$1" || die
"$mime")
271 typeofmime
"$mime" || die
"unhandled file type: '$mime'"
276 ps
) conv
='ps2pdf - "$casp"';;
277 image2|pdf
) test -z "$dc" && exec llpp
"$@" || conv
='cat >"$casp"';;
279 missing texi2html
"texi2html(http://www.nongnu.org/texi2html/)"
280 missing prince
"PrinceXML(http://www.princexml.com/)"
281 conv
='texi2html - -o - | prince $css - -o "$casp"'
284 missing ddjvu
"ddjvu(http://djvu.sourceforge.net/doc/man/ddjvu.html)"
285 conv
='ddjvu -format=pdf - "$casp"'
288 missing prince
"Prince(http://www.princexml.com/)"
289 conv
='prince $css - -o "$casp"'
292 missing pandoc
"pandoc(http://pandoc.org)"
294 conv
='pandoc -r html - -w epub2 -o "$casp"'
297 if executable_p unoconv
&& test -z "$dc"; then
299 conv
='unoconv -o "$casp" "$1"'
301 missing antiword
"antiword or unoconv"
302 conv
='antiword -m 8859-1.txt -a a4 - >"$casp"'
306 test -n "$dc" && die
"cannot convert compressed '$mime'"
308 missing unoconv
"unoconv(http://dag.wiee.rs/home-made/unoconv/)"
309 conv
='unoconv -o "$casp" "$1"'
312 if executable_p inkscape
&& test -z "$dc"; then
314 conv
='inkscape -z -A "$casp" "$1"'
316 if executable_p rsvg-convert
; then
317 conv
='rsvg-convert -f pdf -o "$casp"'
319 test -n "$dc" && die
"cannot convert compressed '$mime'"
321 missing unoconv
"unoconv(http://dag.wiee.rs/home-made/unoconv/)"
322 conv
='unoconv -o "$casp" "$1"'
327 maketext
"$1" "$textfilename"
328 exec llpp
-origin $1 -layout-height 0 "$cachedir/fonts/text.html"
331 missing convert
"convert(http://www.imagemagick.org/script/convert.php)"
332 conv
='convert - pdf:"$casp"'
335 test -n "$dc" && die
"cannot convert compressed '$mime'"
337 missing dvipdf
"dvipdf(http://ghostscript.com/)"
338 conv
='dvipdf "$1" "$casp"'
341 missing pandoc
"pandoc(http://pandoc.org/)"
342 conv
='pandoc -t epub2 - -o "$casp"'
345 *) die
"unhandled filter type: '$type'";;
348 hash=$
(cksum "$hashof") || die
"$hash"
349 casp
=$cachedir/${hash%% *}$caspsuf
351 { test -n "$force" ||
test ! -e "$casp"; } && eval "$filt" "$conv"
354 exec llpp
-origin $origin "$@" "$casp"