9 cachedir
="${XDG_CACHE_HOME:-$HOME/.cache}/llpp"
10 test -d "$cachedir" || die
"cache directory '$cachedir' does not exist"
16 command -v "$1" >/dev
/null
2>&1
21 eval "$1() { die \"$2 is needed for \$type conversion\"; }"
26 <pre style="font-size: ${1}pt;">
29 test -n "$2" && cat $2 ||
cat <<EOF
34 abcdefghizklmnopqrstwxyz
35 ABCDEFGHIZKLMNOPQRSTWXYZ
36 абвгдеёжзийклмнопрстуфхцчшщэюя
37 АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЭЮЯ
42 S in S9 59 S9 is like 5
44 3ЗЭэзээз3ЗqgO0o ijklI1| bgqpykvwlliliiijil1 lLLl
49 curly vs plain braces {} () {}
55 Before [Bef ore, Be for e]
56 higher [gh, h i gher, hi gher]
65 mkfifo [mk f i fo, mk f i fo]
72 Compiling [Co mp iling]
78 buildglyphs.js [buil dg lyphs]
88 automatically effective
89 Ilium is the Latin for Ilion.
92 Box drawing alignment tests: █
94 ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳
95 ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳
96 ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳
97 ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
98 ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎
99 ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏
100 ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█
103 https://mirrors.zju.edu.cn/CTAN/fonts/gofonts/doc/gofonts.pdf (page 2)
105 DIN Legibility Standard
107 The recent German DIN 1450 legibility standard
108 recommends several features for font legibility, including
109 differentiation of letter shapes to reduce confusion. The Go fonts
110 conform to the 1450 standard by carefully differentiating zero from
111 capital O; numeral 1 from capital I (eye) and lowercase l (ell);
112 numeral 5 from capital S; and numeral 8 from capital B. The shapes of
113 bowls of b d p q follow the natural asymmetries of legible Renaissance
114 handwriting, aiding differentiation to reduce confusion. [5]
117 Mistaking S for a 5 (at certain sizes) is more of a problem... but... Ze Germans
119 (https://en.wikipedia.org/wiki/Jabberwocky
120 Idea from the aforementioned gofonts paper)
122 Бе сгладне и честлинните комбурси Það leið að stekju, og slýgir greðlar
123 търляха се и сврецваха във плите; sig snældu og böluðu um slöffruna,
124 съвсем окласни бяха тук щурпите og angurvært sungu sópfiðrungar
125 и отма равапсатваха прасурси. við sífgelt týðmana svíræna.
131 # https://github.com/react-boilerplate/react-boilerplate/issues/1340
132 test -d "$cachedir/fonts" || mkdir
"$cachedir/fonts"
133 filename
="$(basename "$1")"
135 cat >"$cachedir/fonts/text.html" <<EOF
136 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
137 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
140 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
141 <title>$filename</title>
142 <style type="text/css">
155 for size
in 6 8 10 12 4 2; do
156 text
$size $textfilename >>"$cachedir/fonts/text.html"
158 cat >>"$cachedir/fonts/text.html" <<EOF
160 $(fc-scan -f '%{fullname} %{style} %{slant} %{file} %{fontversion} %{capability} %{lang}' "$1" || file "$1")
166 trap 'test -n "$casp" && rm -f "$casp"' 0
168 while getopts s
:c
:m
:t
:fu opt
; do
173 c
) css
="-s $OPTARG";;
175 s
) textfilename
="$OPTARG";;
176 ?
) die
"usage: $0 [-c css] [-m mime/type] [-t filter] [-f] [-s textfile] [path|url]";;
179 shift $
(($OPTIND - 1))
180 test -z "$1" && die
"usage $0: path"
183 if ${force-test ! -e "$1"} && expr >/dev
/null
"$1" : "\(ftp\|https\?\)://"; then
184 if executable_p wget
; then
188 elif executable_p curl
; then
193 die
"no program to fetch remote urls found"
196 md5of
="$cachedir/$(basename "$1")"
197 dl
"$1" "$md5of" ||
test -e "$md5of"
205 ft
=$
(file -L --mime-type -b "$1") || die
"$ft"
209 application
/x-gzip | application
/x-compress
) dc=zcat
;;
210 application
/x-xz
) dc=xzcat
;;
211 application
/x-bzip2
) dc=bzcat
;;
212 *) unset dc || true
;;
215 filt
='"${dc-cat}" "$1" |'
219 application
/postscript
) type=ps
;;
220 application
/pdf
) type=pdf
;;
221 image
/vnd.djvu
) type=djvu
;;
222 text
/html
) type=html
;;
223 text
/plain
) type=text
;;
224 application
/msword
) type=word
;;
225 application
/vnd.openxmlformats-officedocument.
* \
226 | application
/vnd.ms-powerpoint \
227 | application
/vnd.ms-excel \
228 | application
/vnd.oasis.opendocument.
*) type=uno
;;
229 image
/svg
+xml
) type=svg
;;
230 image
/png | image
/jpeg
) test -n "$dc" && type="image" ||
type="image2";;
231 image
/*) type=image
;;
232 application
/x-dvi
) type=dvi
;;
233 application
/x-font-ttf \
234 | application
/vnd.ms-opentype \
235 | application
/font-sfnt
) type=font
;;
241 if test -z "$type"; then
243 mime
=$
(file -L --mime-type -b "$1" || die
"$mime") || \
244 $
(file -L --mime-type -bz "$1" || die
"$mime")
245 typeofmime
"$mime" || die
"unhandled file type: '$mime'"
250 ps
) conv
='ps2pdf - "$casp"';;
251 image2|pdf
) test -z "$dc" && exec llpp
"$@" || conv
='cat >"$casp"';;
253 missing texi2html
"texi2html(http://www.nongnu.org/texi2html/)"
254 missing prince
"PrinceXML(http://www.princexml.com/)"
255 conv
='texi2html - -o - | prince $css - -o "$casp"'
258 missing ddjvu
"ddjvu(http://djvu.sourceforge.net/doc/man/ddjvu.html)"
259 conv
='ddjvu -format=pdf - "$casp"'
262 missing prince
"PrinceXML(http://www.princexml.com/)"
263 conv
='prince $css - -o "$casp"'
266 missing pandoc
"pandoc(http://pandoc.org)"
268 conv
='pandoc -r html - -w epub -o "$casp"'
271 if executable_p unoconv
&& test -z "$dc"; then
273 conv
='unoconv -o "$casp" "$1"'
275 missing antiword
"antiword or unoconv"
276 conv
='antiword -m 8859-1.txt -a a4 - >"$casp"'
280 test -n "$dc" && die
"cannot convert compressed '$mime'"
282 missing unoconv
"unoconv(http://dag.wiee.rs/home-made/unoconv/)"
283 conv
='unoconv -o "$casp" "$1"'
286 if executable_p inkscape
&& test -z "$dc"; then
288 conv
='inkscape -z -A "$casp" "$1"'
290 missing rsvg-convert
"rsvg-convert"
291 conv
='rsvg-convert -f pdf -o "$casp"'
295 if test -z $usemupdf; then
298 mupdf
=$HOME/x
/rcs
/git
/mupdf
/build
/native
/mupdf-gl
299 executable_p
$mupdf || v
=mupdf-gl
&& v
=$mupdf
301 maketext
"$1" "$textfilename"
302 exec $v "$cachedir/fonts/text.html"
305 missing convert
"convert(http://www.imagemagick.org/script/convert.php)"
306 conv
='convert - pdf:"$casp"'
309 test -n "$dc" && die
"cannot convert compressed '$mime'"
311 missing dvipdf
"dvipdf(http://ghostscript.com/)"
312 conv
='dvipdf "$1" "$casp"'
315 missing pandoc
"pandoc(http://pandoc.org/)"
316 conv
='pandoc -t epub - -o "$casp"'
319 *) die
"unhandled filter type: '$type'";;
322 hash=$
(md5sum "$md5of") || die
"$hash"
323 casp
=$cachedir/${hash%% *}$caspsuf
325 { test -n "$force" ||
test ! -e "$casp"; } && eval "$filt" "$conv"
328 exec llpp
-origin $origin "$@" "$casp"