Skip to content

east asia, chinese font family#329

Open
leonzhu211 wants to merge 1 commit intopython-openxml:masterfrom
leonzhu211:master
Open

east asia, chinese font family#329
leonzhu211 wants to merge 1 commit intopython-openxml:masterfrom
leonzhu211:master

Conversation

@leonzhu211
Copy link
Copy Markdown

My test code is like this:
styles = document.styles
s1 = styles.add_style('s1', WD_STYLE_TYPE.PARAGRAPH)
s1.font.size = Pt(40)
s1.font.name = u'楷体_GB2312'
document.add_paragraph(u'中文内容', style = s1)

The chinese font family name has no effect.
So I create a docx file with the goal content, unzip it and compare the xml with that generated by python-docx. I find that the difference is the following fragment:

<w:rFonts w:eastAsia="楷体_GB2312" w:asciiTheme="minorAscii" w:hAnsiTheme="minorAscii"/>/w:rPr

That's why I add the property 'eastAsia'.

fengdasuk19 added a commit to fengdasuk19/python-docx that referenced this pull request Feb 13, 2020
@fengdasuk19
Copy link
Copy Markdown

The unit test code has been updated in PR #781 .

@ruixingw
Copy link
Copy Markdown

are we ready to merge this (and also #781 )?

@leonzhu211
Copy link
Copy Markdown
Author

leonzhu211 commented Oct 28, 2021 via email

@ruixingw
Copy link
Copy Markdown

ruixingw commented Oct 28, 2021 via email

@scanny
Copy link
Copy Markdown
Contributor

scanny commented Oct 28, 2021

We generally don't accept pull requests. The engineering standard is generally just too high and almost all PRs require more rework than implementing ourselves from scratch. For example, this one includes no analysis documentation, no tests, and the CI tests fail.

If you want to merge code, best thing is probably to fork and use a private version. New versions are relatively infrequent and most can be merged or rebased onto without too much trouble.

At the same time, we welcome PRs because they often inform features that are later built and can be informative or useful to others who want the same feature and are willing to work from a private fork.

@ruixingw
Copy link
Copy Markdown

sounds good. Thanks.

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.

4 participants