There is a way to avoid all this trouble;
txt|UTF-8 txt:\
:lp=/dev/null:\
:sd=/var/spool/lpd/txt:\
:if=/usr/local/bin/utxt-local
:mx#0:\
:sh:
This printcap entry sends the data to the script 'utxt-local';
#!/bin/bash # This script converts UTF-8 txt to postscript uniprint -printer lp -size 8 -hsize 0 -font /usr/share/fonts/truetype/freefont/FreeMono.ttf'uniprint', which is in Debian package 'yudit', converts the text to postscript using a True Type Font. This data is then send to the postscript queue (on this system 'lp' is the postscript queue).
You can use any (monospaced) True Type Font for this;
uniprint -printer lj -size 8 -hsize 0 -font /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttfYou can even specify more then one font, creating a virtual font;
uniprint -printer lp -size 8 -hsize 0 \
-font /path/to/1st-font.ttf \
-font /path/to/2nd-font.ttf
See 'man uniprint' for more info.
#!/bin/bash # This script converts UTF-8 txt to postscript paps | lprThis setup does not depend on gs fonts, the printer's build-in fonts or the printer's default character set.