66
77from ...enum .text import WD_UNDERLINE
88from ..ns import qn
9- from ..simpletypes import ST_BrClear , ST_BrType
9+ from ..simpletypes import ST_BrClear , ST_BrType , ST_String
1010from ..xmlchemy import (
1111 BaseOxmlElement , OptionalAttribute , ZeroOrMore , ZeroOrOne
1212)
@@ -20,6 +20,14 @@ class CT_Br(BaseOxmlElement):
2020 clear = OptionalAttribute ('w:clear' , ST_BrClear )
2121
2222
23+ class CT_Fonts (BaseOxmlElement ):
24+ """
25+ ``<w:rFonts>`` element, specifying typeface name for the various language
26+ types.
27+ """
28+ ascii = OptionalAttribute ('w:ascii' , ST_String )
29+
30+
2331class CT_R (BaseOxmlElement ):
2432 """
2533 ``<w:r>`` element, containing the properties and text for a run.
@@ -135,6 +143,7 @@ class CT_RPr(BaseOxmlElement):
135143 'w:eastAsianLayout' , 'w:specVanish' , 'w:oMath'
136144 )
137145 rStyle = ZeroOrOne ('w:rStyle' , successors = _tag_seq [1 :])
146+ rFonts = ZeroOrOne ('w:rFonts' , successors = _tag_seq [2 :])
138147 b = ZeroOrOne ('w:b' , successors = _tag_seq [3 :])
139148 bCs = ZeroOrOne ('w:bCs' , successors = _tag_seq [4 :])
140149 i = ZeroOrOne ('w:i' , successors = _tag_seq [5 :])
@@ -158,6 +167,19 @@ class CT_RPr(BaseOxmlElement):
158167 oMath = ZeroOrOne ('w:oMath' , successors = _tag_seq [39 :])
159168 del _tag_seq
160169
170+ @property
171+ def rFonts_ascii (self ):
172+ """
173+ The value of `w:rFonts/@w:ascii` or |None| if not present. Represents
174+ the assigned typeface name. The rFonts element also specifies other
175+ special-case typeface names; this method handles the case where just
176+ the common name is required.
177+ """
178+ rFonts = self .rFonts
179+ if rFonts is None :
180+ return None
181+ return rFonts .ascii
182+
161183 @property
162184 def style (self ):
163185 """
0 commit comments