Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docx/oxml/text/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CT_Fonts(BaseOxmlElement):
"""
ascii = OptionalAttribute('w:ascii', ST_String)
hAnsi = OptionalAttribute('w:hAnsi', ST_String)
eastAsia = OptionalAttribute('w:eastAsia', ST_String)


class CT_Highlight(BaseOxmlElement):
Expand Down Expand Up @@ -138,6 +139,27 @@ def rFonts_ascii(self, value):
rFonts = self.get_or_add_rFonts()
rFonts.ascii = value

@property
def rFonts_eastAsia(self):
"""
The value of `w:rFonts/@w:eastAsia` or |None| if not present. Represents
the assigned typeface name. The rFonts element also specifies other
special-case typeface names; this method handles the case where just
the common name is required.
"""
rFonts = self.rFonts
if rFonts is None:
return None
return rFonts.eastAsia

@rFonts_eastAsia.setter
def rFonts_eastAsia(self, value):
if value is None:
self._remove_rFonts()
return
rFonts = self.get_or_add_rFonts()
rFonts.eastAsia = value

@property
def rFonts_hAnsi(self):
"""
Expand Down
1 change: 1 addition & 0 deletions docx/text/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def name(self, value):
rPr = self._element.get_or_add_rPr()
rPr.rFonts_ascii = value
rPr.rFonts_hAnsi = value
rPr.rFonts_eastAsia = value

@property
def no_proof(self):
Expand Down