tags 618781 patch
thanks

I think the problem is not with gpgsigs per se, but rather with the
LaTeX output it produces.  (As Tanguy hinted at, the text output of
UTF-8 encoded input files seems to be rendered properly.)   LaTeX is
in fact known for its poor support of Unicode characters in input files
(‘\usepackage[utf8x]{inputenc}‘ slightly improves that, but it's not a
panacea in any way).  On the other hand, other typesetting engines such
as LuaLaTeX or XeLaTeX perform much better.

So, as Postscript files poorly support Unicode characters, why bother
at all with the LaTeX engine?  I propose the enclosed patch, which makes
--latex produce an output compatible with pdfLaTex, LuaLaTeX and
XeLaTeX.  As for the font rendered in the PDF in the two latter cases,
I chose Droid which has very good Unicode coverage and IMHO is much
better looking than GNU Unifont.

 * pdfLaTex (no dependencies beside common texlive packages): renders
   latin1 characters properly, but fails to render Cyrillic and CJK
   characters.

 * luaLaTeX (depends on core texlive packages, texlive-luatex, luatex
   and fonts-droid): I believe only CJK are not properly rendered.

 * XeLaTeX (depends on core texlive packages, texlive-xetex and
   fonts-droid): so far I didn't find any character that wasn't
   properly rendered.

Also, since the 3 LaTeX typesetting engines above produce a PDF, and
since JPG images can be embedded in PDF files, the conversion from JPG
to EPS (or PDF for that matter) is no longer needed.  I therefore
renamed ‘gpgsigs-eps-helper’ as ‘gpgsigs-helper’.

If this patch is accepted, I'll try to port it to gpg-key2ps(1) which
I believe should solve #412512 and #316131/454405.

Cheers,
-- 
Guilhem.
diff -ru a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs
--- a/gpgsigs/gpgsigs
+++ b/gpgsigs/gpgsigs
@@ -181,8 +181,8 @@
 		next if $uidstatus eq "r";
 		if ($latex and not $photocount) { # call once per key
 			my ($shortkey) = substr $key, -8;
-			system "rm -f $shortkey.[1-9]*.eps";
-			system "gpg --photo-viewer 'gpgsigs-eps-helper $shortkey' --list-options show-photos --list-key $key > /dev/null";
+			system "rm -f $shortkey.[1-9]*.jpg";
+			system "gpg --photo-viewer 'gpgsigs-helper $shortkey' --list-options show-photos --list-key $key > /dev/null";
 			$photocount = 1;
 		}
 		my ($shortkey) = substr $key, -8;
@@ -307,8 +307,19 @@
 \documentclass{article}
 \usepackage[margin=2cm]{geometry}
 \usepackage{alltt}
-\usepackage{graphicx}
-\usepackage{grffile}
+\usepackage{graphicx,grffile}
+\usepackage{ifluatex,ifxetex}
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0
+  \usepackage[utf8x]{inputenc}
+\else
+  \usepackage[log-declarations=false]{xparse}
+  \usepackage{fontspec}
+  \setmonofont{Droid Sans Mono}
+  \ifxetex
+    \usepackage[quiet]{xeCJK}
+    \CJKfontspec{Droid Sans Fallback}
+  \fi
+\fi
 \begin{document}
 \begin{alltt}
 EOF
@@ -388,6 +399,9 @@
 		print WRITE print_tag($key, $uid) . " $_";
 		next;
 	}
+	if ( /^[_-]{50,}$/ and $latex ) {
+		$_ = "\n\\hrule\n";
+	}
 	print WRITE;
 }
 
Only in a/gpgsigs: gpgsigs-eps-helper
diff -ru a/gpgsigs/gpgsigs-eps-helper b/gpgsigs/gpgsigs-eps-helper
--- a/gpgsigs/gpgsigs-eps-helper
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-ID="$1"
-NUM=1
-
-while test -e $ID.$NUM.eps ; do
-	NUM=`expr $NUM + 1`
-done
-
-convert - $ID.$NUM.eps
Only in b/gpgsigs: gpgsigs-helper
diff -ru a/gpgsigs/gpgsigs-helper b/gpgsigs/gpgsigs-helper
--- /dev/null
+++ b/gpgsigs/gpgsigs-helper
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+ID="$1"
+NUM=1
+
+while test -e $ID.$NUM.jpg ; do
+    NUM=$(( $NUM + 1 ))
+done
+
+cat > $ID.$NUM.jpg
diff -ru a/gpgsigs/Makefile b/gpgsigs/Makefile
--- a/gpgsigs/Makefile
+++ b/gpgsigs/Makefile
@@ -5,8 +5,8 @@
 
 install:
 	install -D gpgsigs $(DESTDIR)/usr/bin/gpgsigs
-	install -D gpgsigs-eps-helper \
-		$(DESTDIR)/usr/share/signing-party/gpgsigs-eps-helper
+	install -D gpgsigs-helper \
+		$(DESTDIR)/usr/share/signing-party/gpgsigs-helper
 	install -d $(DESTDIR)/usr/share/doc/signing-party/examples/gpgsigs
 	install -m644 gpgsigs-lt2k5*.txt \
 		$(DESTDIR)/usr/share/doc/signing-party/examples/gpgsigs

Attachment: signature.asc
Description: Digital signature

Reply via email to