-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feature: Font.shading #309
Copy link
Copy link
Open
Description
font.highlight_color appears to work fine when applied directly to a run's font, this way.
run=para.add_run("this should have a yellow background, but with no style (!)")
run.font.highlight_color=docx.enum.text.WD_COLOR.YELLOW
When applied using a style, it seems to have no effect.
style=doc.styles.add_style("highlightYellow",docx.enum.style.WD_STYLE_TYPE.CHARACTER)
style.base_style=doc.styles["Normal"]
style.font.highlight_color=docx.enum.text.WD_COLOR.YELLOW
para.add_run("this should have a yellow background, but does not",style)
In Microsoft Word, I can see that the style is being applied to that run, but it's background isn't yellow. If I look at the style using the Modify Style dialog, the sample text snippet shows a yellow background, oddly enough. But in that dialog, Format/Border.../Shading says that Fill is No Color. Selecting yellow there fixes it. Another oddity is that I do get a yellow background opening the same document in LibreOffice, oowriter.
I'm gathering some XML to help isolate this, and will attach it to the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels