python / python-docs-ko

Korean translation of the Python documentation
https://docs.python.org/ko/
65 stars 47 forks source link

PDF build: missing characters #595

Closed JulienPalard closed 5 years ago

JulienPalard commented 5 years ago

In the PDF builds, I see almost no characters expect ASCII.

Reported here: https://mail.python.org/pipermail/docs/2019-April/040304.html Mentionned here: https://github.com/python/docsbuild-scripts/issues/71

Any hint on how to build sphinx doc with Korean characters?

flowdas commented 5 years ago

I use the kotex package. My sphinx conf.py usually has the following settings:

latex_elements = {
    'papersize': 'a4paper',
    'pointsize': '12pt',
    'preamble': '\\usepackage{kotex}',
}
JulienPalard commented 5 years ago

I just tried it in a setup similar to docs.python.org... wait I'll push this in a branch...

Here it is: https://github.com/JulienPalard/docsbuild-scripts/tree/ko

As I use Debian testing I used docker to get an Ubuntu with the exact packets we have in production:

# ./build_docs.py --version
build_docs: 19.0

# platex

e-pTeX 3.14159265-p3.7.1-161114-2.6 (utf8.euc) (TeX Live 2017/Debian)
kpathsea version 6.2.3
ptexenc version 1.3.5

# xelatex

XeTeX 3.14159265-2.6-0.99998 (TeX Live 2017/Debian)
kpathsea version 6.2.3

And sphinx 2.

I used:

docker build --tag=docsbuild .
docker run --rm -it --entrypoint /bin/bash docsbuild

then inside:

python3 ./build_docs.py --build-root build_root --www-root www --log-directory logs --group $(id -g) --skip-cache-invalidation --language ko --branch 3.7

The builds goes OK but the generated PDF does contains only [?] characters (except ASCII ones).

Any hint?

flowdas commented 5 years ago

I've investigated your Dockerfile. It seems that the default font (Nanum) used by kotex is not installed on the system. A simple fix is to change to more traditional fonts.

 r"-D latex_elements.preamble=\\usepackage{kotex}\\setmainhangulfont{UnBatang}\\setsanshangulfont{UnDotum}\\setmonohangulfont{UnTaza}",
JulienPalard commented 5 years ago

I'm applying this to docs.python.org after a successfull local build. Expect correct PDFs in like 24h max.