|
4 | 4 | Custom element classes related to run properties (font). |
5 | 5 | """ |
6 | 6 |
|
| 7 | +from ...enum.dml import MSO_THEME_COLOR |
7 | 8 | from ...enum.text import WD_UNDERLINE |
8 | 9 | from ..ns import qn |
9 | | -from ..simpletypes import ST_HpsMeasure, ST_String, ST_VerticalAlignRun |
| 10 | +from ..simpletypes import ( |
| 11 | + ST_HexColor, ST_HpsMeasure, ST_String, ST_VerticalAlignRun |
| 12 | +) |
10 | 13 | from ..xmlchemy import ( |
11 | 14 | BaseOxmlElement, OptionalAttribute, RequiredAttribute, ZeroOrOne |
12 | 15 | ) |
13 | 16 |
|
14 | 17 |
|
| 18 | +class CT_Color(BaseOxmlElement): |
| 19 | + """ |
| 20 | + `w:color` element, specifying the color of a font and perhaps other |
| 21 | + objects. |
| 22 | + """ |
| 23 | + val = RequiredAttribute('w:val', ST_HexColor) |
| 24 | + themeColor = OptionalAttribute('w:themeColor', MSO_THEME_COLOR) |
| 25 | + |
| 26 | + |
15 | 27 | class CT_Fonts(BaseOxmlElement): |
16 | 28 | """ |
17 | 29 | ``<w:rFonts>`` element, specifying typeface name for the various language |
@@ -60,6 +72,7 @@ class CT_RPr(BaseOxmlElement): |
60 | 72 | snapToGrid = ZeroOrOne('w:snapToGrid', successors=_tag_seq[16:]) |
61 | 73 | vanish = ZeroOrOne('w:vanish', successors=_tag_seq[17:]) |
62 | 74 | webHidden = ZeroOrOne('w:webHidden', successors=_tag_seq[18:]) |
| 75 | + color = ZeroOrOne('w:color', successors=_tag_seq[19:]) |
63 | 76 | sz = ZeroOrOne('w:sz', successors=_tag_seq[24:]) |
64 | 77 | u = ZeroOrOne('w:u', successors=_tag_seq[27:]) |
65 | 78 | vertAlign = ZeroOrOne('w:vertAlign', successors=_tag_seq[32:]) |
|
0 commit comments