diff options
author | Andrew Cady <d@jerkface.net> | 2017-03-09 15:54:13 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2017-03-09 15:54:13 -0500 |
commit | 84564e32311e47e5385bb2fc1b7146e68182cb73 (patch) | |
tree | 5fc417d09e4fd3d9f1add841c053348616569853 /dot/local | |
parent | e147ab5b9d0b7df6a689057b9398b0f486cc43b1 (diff) |
lptext: use text2png
Diffstat (limited to 'dot/local')
-rwxr-xr-x[-rw-r--r--] | dot/local/bin/lptext | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/dot/local/bin/lptext b/dot/local/bin/lptext index 61fa331..064e98e 100644..100755 --- a/dot/local/bin/lptext +++ b/dot/local/bin/lptext | |||
@@ -1,13 +1,2 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | font=${LP_FONT:-Courier} | 2 | text2png | lp "$@" |
3 | |||
4 | # Densities over 400 cause ImageMagick to cut off the top of the first line. | ||
5 | density=400 | ||
6 | |||
7 | # Leading whitespace causes ImageMagick to duplicate the first non-empty line. | ||
8 | skip_leading_empty_lines() | ||
9 | { | ||
10 | perl -pe 'if (/./) {$seen++} elsif (!$seen) {undef $_}' | ||
11 | } | ||
12 | |||
13 | skip_leading_empty_lines | gm convert -font $font -density $density text:- -trim png:- | lp "$@" | ||