Skip to content
Discussion options

You must be logged in to vote

Have you confirmed that simsun.ttf actually exists on your Linux system? The backslash in any case cannot be used on a Linux system ...

You can always use the built-in CJK font. It supports Latin, Chinese, Korean and Japanese.
Try this:

cjk = pymupdf.Font("cjk")
fontname = "mycjk"

# then for each page where you need it:
page.insert_font(fontname=fontname, fontbuffer=cjk.buffer)

# text insertions do this:
page.insert_text(..., fontname=fontname, ...)
...

This ensures that a full blown font is used with a large range of languages.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yinghao-xue
Comment options

@JorjMcKie
Comment options

Answer selected by JorjMcKie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants