Docx writer: Support bold and italic in "complex script."

Previously bold and italics didn't work properly in LTR
text.  This commit causes the w:bCs and w:iCs attributes
to be used, in addition to w:b and w:i, for bold and
italics respectively.

Closes #6911.
This commit is contained in:
John MacFarlane 2020-12-03 09:51:23 -08:00
parent aab54c4325
commit 5bbd5a9e80
4 changed files with 6 additions and 2 deletions

View file

@ -1272,9 +1272,13 @@ inlineToOpenXML' opts (Span (ident,classes,kvs) ils) = do
$ inlinesToOpenXML opts ils
wrapBookmark ident contents
inlineToOpenXML' opts (Strong lst) =
withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst
withTextProp (mknode "w:b" [] ()) $
withTextProp (mknode "w:bCs" [] ()) $ -- needed for LTR, #6911
inlinesToOpenXML opts lst
inlineToOpenXML' opts (Emph lst) =
withTextProp (mknode "w:i" [] ()) $ inlinesToOpenXML opts lst
withTextProp (mknode "w:i" [] ()) $
withTextProp (mknode "w:iCs" [] ()) $ -- needed for LTR, #6911
inlinesToOpenXML opts lst
inlineToOpenXML' opts (Underline lst) =
withTextProp (mknode "w:u" [("w:val","single")] ()) $
inlinesToOpenXML opts lst