字体高亮颜色
====================
Font highlight color
.. tab:: 中文
Word 文档中的文本可以用多种颜色“突出显示”,提供文本背景颜色。视觉效果类似于在打印页面上使用荧光笔(通常是荧光黄)产生的效果。
.. tab:: 英文
Text in a Word document can be "highlighted" with a number of colors, providing text background color. The visual effect is similar to that produced using a highlighter (often fluorescent yellow) on a printed page.
协议
--------
Protocol
.. tab:: 中文
通过将 `WD_COLOR_INDEX` 的成员分配给 `Font.highlight_color` 来突出显示文本。
.. tab:: 英文
Text is highlighted by assigning a member of `WD_COLOR_INDEX` to `Font.highlight_color`.
::
>>> font = paragraph.add_run().font
>>> font.highlight_color
None
>>> font.highlight_color = WD_COLOR_INDEX.YELLOW
>>> font.highlight_color
YELLOW (7)
>>> font.highlight_color = WD_COLOR_INDEX.TURQUOISE
>>> font.highlight_color
TURQUOISE (3)
>>> font.highlight_color = None
>>> font.highlight_color
None
枚举
------------
Enumerations
* `WdColorIndex Enumeration on MSDN`_
.. _WdColorIndex Enumeration on MSDN: https://msdn.microsoft.com/EN-US/library/office/ff195343.aspx
XML 语义
-------------
XML Semantics
.. tab:: 中文
将 `WD_COLOR_INDEX` 成员映射到 `ST_Highlight` 值
.. tab:: 英文
Mapping of `WD_COLOR_INDEX` members to `ST_Highlight` values
::
AUTO = 'default'
BLACK = 'black'
BLUE = 'blue'
BRIGHTGREEN = 'green'
DARKBLUE = 'darkBlue'
DARKRED = 'darkRed'
DARKYELLOW = 'darkYellow'
GRAY25 = 'lightGray'
GRAY50 = 'darkGray'
GREEN = 'darkGreen'
PINK = 'magenta'
RED = 'red'
TEAL = 'darkCyan'
TURQUOISE = 'cyan'
VOILET = 'darkMagenta'
WHITE = 'white'
YELLOW = 'yellow'
样本 XML
------------
Specimen XML
.. highlight:: xml
.. tab:: 中文
基线运行(Baseline run)::
黑色文本,白色背景
蓝色文本,亮绿色高亮::
蓝色文本,亮绿色背景
红色文本,绿色高亮::
红色文本,绿色背景
.. tab:: 英文
Baseline run::
Black text on white background
Blue text, Bright Green Highlight::
Blue text on bright green background
Red text, Green Highlight::
Red text on green background
架构摘录
--------------
Schema excerpt
.. tab:: 中文
根据架构,运行属性可以按任意顺序出现,并且每个属性可能出现多次。不确定其语义是什么,也不确定为什么要这样做,但需要注意。Word 似乎在写入文件时将它们按以下顺序放置。
.. tab:: 英文
According to the schema, run properties may appear in any order and may
appear multiple times each. Not sure what the semantics of that would be or
why one would want to do it, but something to note. Word seems to place them
in the order below when it writes the file.
.. highlight:: xml
::