[postgis-tickets] [PostGIS] #5439: Error with Japanese translation (PDF)
PostGIS
trac at osgeo.org
Thu Jul 13 04:45:12 PDT 2023
#5439: Error with Japanese translation (PDF)
----------------------------+---------------------------
Reporter: strk | Owner: robe
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.3.4
Component: documentation | Version: 3.3.x
Resolution: | Keywords:
----------------------------+---------------------------
Comment (by lnicola):
After some investigation, it seems that XeTeX is unmaintained these days
(its previous maintainer has moved on to LuaTeX), and non-Latin support in
pdfTeX is very painful, if not wholly unachievable.
I was able to get a somewhat usable Japanese PDF by dumping the TeX source
and editing it to remove this:
{{{
\IfFileExists{ifxetex.sty}{%
\usepackage{ifxetex}%
}{%
\newif\ifxetex
\xetexfalse
}
\ifxetex
\usepackage{fontspec}
\usepackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{DejaVu Serif}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}
\else
\usepackage[T2A,T2D,T1]{fontenc}
\usepackage{ucs}
\usepackage[utf8]{inputenc}
\def\hyperparamadd{unicode=true}
\fi
}}}
and replace it with this:
{{{
\usepackage{luatexja}
\setlength{\headheight}{12.06757pt}
}}}
Increasing the headheight isn't strictly necessary, but I was getting
thousands of warnings about it.
luatexja supports Noto Sans CJK and related fonts, but the output looked
rather bad, especially the code listings. I ended up using the default
font, available as texlive-haranoaji on my distro.
Note that the dblatex style tries to load some fonts of its own when not
using XeTeX. This may or may not cause issues. I originally commented them
out in /usr/share/texlive/texmf-dist/tex/latex/dblatex/dbk_fonts.sty, but
it might work with luatexja.
Replacing utf8x with utf8 in \lstset{inputencoding=utf8x,
extendedchars=true} might also be a good idea, but I didn't test it.
I'm attaching a couple of versions, for anyone who's curious.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5439#comment:10>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list