Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF build: missing characters #595

Closed
JulienPalard opened this issue May 21, 2019 · 4 comments
Closed

PDF build: missing characters #595

JulienPalard opened this issue May 21, 2019 · 4 comments

Comments

@JulienPalard
Copy link
Member

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: python/docsbuild-scripts#71

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

@flowdas
Copy link
Collaborator

flowdas commented May 21, 2019

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

latex_elements = {
    'papersize': 'a4paper',
    'pointsize': '12pt',
    'preamble': '\\usepackage{kotex}',
}

@flowdas flowdas closed this as completed May 27, 2019
@JulienPalard
Copy link
Member Author

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?

@JulienPalard JulienPalard reopened this May 28, 2019
@flowdas
Copy link
Collaborator

flowdas commented Jun 1, 2019

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}",

@flowdas flowdas closed this as completed Jun 28, 2019
@JulienPalard
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants