On 2017-10-10 13:43:53 +0200, Vincent Lefevre wrote:
> When I used muttprint (with print to file, for checking) on a mail
> with δ and ε characters, these characters were silently missing
> from the generated .ps file.

I think that the easiest solution would be to use xelatex and
a font that the required characters (DejaVu Sans Mono seems one
of the most complete fonts).

I've attached a patch that does this (mainly for testing), but
I haven't tried in non-UTF8 locales (I suppose that the input
should be converted to UTF8 or \XeTeXinputencoding should be
used) and the font is hardcoded in the patch.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
--- a/muttprint 2017-06-19 21:12:50.000000000 +0200
+++ b/muttprint 2017-10-10 15:02:58.212793432 +0200
@@ -177,7 +177,7 @@
 my %Header;                                                                    
# Header ...
 my @PrintedMailheaders;                                                # 
Mailheader so wie er gedruckt wird (LaTeX-Code)
 my $childPid;                                                          # PID 
des Kinds
-my $DVIopts;                                                           # 
Optionen fuer DVI - Aufruf
+my $PDFopts;                                                           # 
Optionen fuer PDF - Aufruf
 my @Command;                                                           # 
Kommando zum Drucken; fuer Druck in Datei
 my $Laenge = "0";                                                      # zum 
Ermitteln der laengsten Zeile
 my $MaxLaenge = "0";                                           # die laengste 
Zeile
@@ -583,13 +583,13 @@
 
 #
 # running latex twice because of the "page ... of ..."
-system("latex -interaction=nonstopmode mail.tex >> $errorRedirection 2>&1");
-system("latex -interaction=nonstopmode mail.tex >> $errorRedirection 2>&1");
+system("xelatex -interaction=nonstopmode mail.tex >> $errorRedirection 2>&1");
+system("xelatex -interaction=nonstopmode mail.tex >> $errorRedirection 2>&1");
 
 #
 # no check of the exit code because we do this here
-unless (-e $Temp{dvi}) {
-       fatalError "Latex didn't work. There's no DVI file. If you ".
+unless (-e $Temp{pdf}) {
+       fatalError "Latex didn't work. There's no PDF file. If you ".
                "write a bugreport, please include a mail where printing 
fails.";
 }
 
@@ -599,8 +599,8 @@
 
 #
 # generating the postscript file in every case
-system("dvips -t $paperformat -o $Temp{ps} $Temp{dvi} >> $errorRedirection 
2>&1")
-       and fatalError "Error while running dvips:\n$!";
+system("pdftops $Temp{pdf} $Temp{ps} >> $errorRedirection 2>&1")
+       and fatalError "Error while running pdftops:\n$!";
 
 
 # now we find out the number of pages the document has
@@ -1167,7 +1167,7 @@
        $Temp{content}  = "$Temp{dir}/content";
        $Temp{latex}            = "$Temp{dir}/mail.tex";
        $Temp{logf}             = "$logf";
-       $Temp{dvi}                      = "$Temp{dir}/mail.dvi";
+       $Temp{pdf}                      = "$Temp{dir}/mail.pdf";
        $Temp{ps}                       = "$Temp{dir}/mail.ps";
        $Temp{psnew}            = "$Temp{dir}/mail-new.ps";
        $Temp{ps1}                      = "$Temp{dir}/mail1.ps";
@@ -1386,10 +1386,11 @@
 
 output \*LATEX, "
 \\documentclass[compat2,$Config{FONTSIZE}]{article}
-$fontencString
 \\renewcommand{\\tt}{\\rm}
 \\usepackage[$babellanguage]{babel}
-\\usepackage[$inputcharset]{inputenc}
+\\usepackage{fontspec}
+\\setmainfont{DejaVu Sans}
+\\setmonofont{DejaVu Sans Mono}
 \\usepackage{$LatexPackages}
 
\\usepackage[${paperformat}paper,left=$Config{LEFTMARGIN}mm,right=$Config{RIGHTMARGIN}mm,%
        
top=$Config{TOPMARGIN}mm,bottom=$Config{BOTTOMMARGIN}mm,headsep=5mm]{geometry}

Reply via email to