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

Fix incorrect CJK fonts in exported PDF #3

Merged
merged 4 commits into from
Aug 24, 2018
Merged

Fix incorrect CJK fonts in exported PDF #3

merged 4 commits into from
Aug 24, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Aug 23, 2018

The lang attribute of <html> element will follow system locale. While exporting PDF, the headless Chrome would be able to use correct fonts by locale.

For example, we expects the rendered font in PDF to use "メイリオ" (Meiryo) on Japanese Windows. But v0.0.4 is using Chinese "新細明體" (PMingLiU).

ToDo

  • Add tests

@yhatt yhatt changed the title Fix to be used incorrect CJK fonts in exported PDF Fix incorrect CJK fonts in exported PDF Aug 24, 2018
@yhatt
Copy link
Member Author

yhatt commented Aug 24, 2018

We have fixed font problems. PDF conversion will use fonts to be suited to system locale by default.

# <!-- fit --> 歓迎 <!-- It means "Welcome" / "欢迎" in Japanese. -->
Incorrect in Japanese (PMingLiU) Correct (Meiryo)

You should use LANG or LC_ALL env if you have to change locale manually.

LC_ALL=zh_CN marp markdown.md --pdf

@yhatt yhatt merged commit 0f73d4c into master Aug 24, 2018
@yhatt yhatt deleted the html-lang branch August 24, 2018 04:21
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

Successfully merging this pull request may close these issues.

1 participant