Pango fonts are crappy in Acroread, Latin 1 fonts are good. External solution to character set mapping.
Submitted by Sampo Kellomaki
Link to original bug (#153607)
Description
I often use Latin 1 accented characters and have a problem where Pango fonts render badly under acroread (Linux). This happens both if I directly epstopdf the exported diagram or if I include the resulting diagram in LaTeX and then output that using pdflatex. The problem does not happen if I view the resulting file using gv (ghostview), but this is not a satisfactory solution since gv is not available to many people I want to share my presentations with. Apparently acroread does not have the requisite fonts (the default sans) available and uses some horrorous bitmap font.
If I try to export the diagram using "EPS with Latin 1 fonts" from the GUI I get an error and the export fails. If I perform the export in batch mode using eps-builtin filter the export completes but the characters are still in the dreaded UTF-8 format which will display as some garbage in final output. I see from your FAQ 27 that you are unwilling to fix font encoding problems, thus rather than patching dia I have developed the following external solution. Using this solution I do get nice antialiased accented end result.
#!/usr/bin/perl
sampo@iki.fi)
12.3.2004, Sampo Kellomaki (Fix UTF-8 encoding that dia-0.94 uses to form of latin1 which works in eps and
TeX.
The dia support for fonts either
- renders crappy in PDFs with Pango font export (acroread uses bitmap fonts,
gv works ok)
- has an encoding problem if PDF built-in PostScript fonts are used, thus
accents do not work
Furthermore, per Dia FAQ 27, the Dia developers are unwilling to fix this.
Usage: dia -n --export-to-format=eps-builtin --export=foo-utf-8.eps foo.dia
perl fix-dia-utf-8-to-latin1-encoding.pl <foo-utf-8.eps >foo.eps
epstopdf foo.eps
or in your Makefile set up rules like
%.pdf: %.eps
$(EPS2PDF) $<
%.eps: %-utf-8.eps
< >
@
$(PERL) fix-dia-utf-8-to-latin1-encoding.pl < %-utf-8.eps: %.dia
(DIA) --export-to-format=eps-builtin --export=
@ $<
Good luck!
undef $/;
$_=<STDIN>
;
Add to this table any other translations you need (open *-utf-8.eps file in
text editor) s/Ã/í/g; # iacute s/ó/ó/g; # oacute
print;
#EOF
BTW, I consider dia teams refusal (per FAQ 27) to support Latin 1 a bug.
Cheers, --Sampo
Version: 0.94