Cannot set Chinese character font typeface
See original GitHub issueI tried set set Chinese character font typeface, but failed. it works for English characters, but not for Chinese characters although they are at the same line.
from docx import Document
from docx.shared import Pt
document = Document()
p = document.add_paragraph('A plain paragraph having some ')
run = p.add_run("\n中文字体设置。Character formatting is applied at the Run level. Examples include font typeface and size, bold, italic, and underline.")
font = run.font
font.name = '宋体' #simSong
font.size = Pt(20)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Font Problem with Typing Chinese in Word
No matter I set Asian text font family using "Style" or "Font" -> "Set As Default", whenever I type new Chinese characters, it...
Read more >The font has chinese characters but I can't type it out?
I am using a font, Kievit for a design project. It is an English font however it says it supports Chinese characters. By...
Read more >font-face does not work with Chinese font - Stack Overflow
Unfortunately the 'normal' fonts do not support Chinese, so the characters will stay unaffected. Both fonts are located in the same folder as ......
Read more >Chinese Fonts not properly selected
This happens because the browser tries to find installed fonts based on what language it suspects the characters are. And for some reason ......
Read more >Chinese Fonts & Related Issues
There are three major encodings for Chinese fonts, two legacy encodings and Unicode. (As the Chinese characters are intimately related to the Japanese...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Check out this existing issue and see of that solves your problem: #154
Bugs I think it’s never success, it’s success to change to font name before the chinese character, but on chinese character always using ‘MS 明朝’ font.