-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for copying embedded fonts settings #557
Conversation
Look for embedded font settings if there are fonts embedded into the current file
Added settings for embedded fonts.
Thanks for looking at my PR. After much searching I found that the problem with I accepted word's correction of <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:fonts xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh">
<w:font w:name="Cambria">
<w:panose1 w:val="02040503050406030204"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E00002FF" w:usb1="400004FF" w:usb2="00000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
<w:embedRegular r:id="rId1" w:fontKey="{3024D4E8-6DA2-E943-9225-3829064D197B}"/>
<w:embedBold r:id="rId2" w:fontKey="{269B668A-DB16-1442-AD8E-5A571F935C73}"/>
</w:font>
<w:font w:name="Times New Roman">
<w:panose1 w:val="02020603050405020304"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E0002EFF" w:usb1="C000785B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
<w:embedRegular r:id="rId3" w:fontKey="{0D0DFF31-141B-7E47-B711-E7A60FEABC57}"/>
<w:embedBold r:id="rId4" w:fontKey="{0D61B6C2-4A1C-0B4B-A2E7-C85E5078CD0A}"/>
<w:embedBoldItalic r:id="rId5" w:fontKey="{AA69A62C-C5B1-514E-9A72-573BF593198B}"/>
</w:font>
<w:font w:name="Open Sans">
<w:panose1 w:val="020B0604020202020204"/>
<w:charset w:val="00"/>
<w:family w:val="auto"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="A000007F" w:usb1="0000000B" w:usb2="00000028" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
<w:embedRegular r:id="rId6" w:fontKey="{22ED20E3-8F03-A048-A60F-8A910C302729}"/>
<w:embedBoldItalic r:id="rId7" w:fontKey="{4C9EFDE0-289A-6345-A3B3-EB80EDED12B5}"/>
</w:font>
<w:font w:name="Calibri">
<w:panose1 w:val="020F0502020204030204"/>
<w:charset w:val="00"/>
<w:family w:val="swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E0002AFF" w:usb1="C000247B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
<w:embedRegular r:id="rId8" w:fontKey="{15282AC0-9253-AA47-9916-B8E08D79C5FB}"/>
<w:embedBold r:id="rId9" w:fontKey="{0A0FDEEF-E1FB-BF44-98C8-36A26AA9E00F}"/>
</w:font>
<w:font w:name="Lucida Grande">
<w:panose1 w:val="020B0600040502020204"/>
<w:charset w:val="00"/>
<w:family w:val="auto"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E1000AEF" w:usb1="5000A1FF" w:usb2="00000000" w:usb3="00000000" w:csb0="000001BF" w:csb1="00000000"/>
</w:font>
</w:fonts> instead of the version in the word corrected file which is: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:fonts xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh">
<w:font w:name="Cambria">
<w:panose1 w:val="02040503050406030204"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E00006FF" w:usb1="420024FF" w:usb2="02000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
<w:embedRegular r:id="rId1" w:fontKey="{C2E7DFB9-3B20-42EA-924F-B4D1612512BA}"/>
<w:embedBold r:id="rId2" w:fontKey="{B7BE5861-6FA4-42FA-94BD-88B0F9E27900}"/>
</w:font>
<w:font w:name="Times New Roman">
<w:panose1 w:val="02020603050405020304"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E0002EFF" w:usb1="C000785B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
</w:font>
<w:font w:name="Open Sans">
<w:charset w:val="00"/>
<w:family w:val="swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E00002EF" w:usb1="4000205B" w:usb2="00000028" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
<w:embedRegular r:id="rId3" w:fontKey="{E156D5F2-6AE7-4D3A-8443-712DA26340DD}"/>
<w:embedBoldItalic r:id="rId4" w:fontKey="{98D9B174-20D7-4CB5-9D19-1F76585C722B}"/>
</w:font>
<w:font w:name="Calibri">
<w:panose1 w:val="020F0502020204030204"/>
<w:charset w:val="00"/>
<w:family w:val="swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E4002EFF" w:usb1="C000247B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
<w:embedRegular r:id="rId5" w:fontKey="{40BB2FA1-2400-4E18-B5C5-3302E34DB57A}"/>
<w:embedBold r:id="rId6" w:fontKey="{A46084A5-459C-4177-B79E-E286D10BEDE9}"/>
</w:font>
<w:font w:name="Lucida Grande">
<w:charset w:val="00"/>
<w:family w:val="auto"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E1000AEF" w:usb1="5000A1FF" w:usb2="00000000" w:usb3="00000000" w:csb0="000001BF" w:csb1="00000000"/>
</w:font>
</w:fonts> Notice the additional tags for Times New Roman (presumably a system font). I'm not clear how this happened, since I wasn't able to re-create a faulty docx myself. I've not made tests before, but would be happy to give it a go, if you could give me a hint as to what you want. Is there a way to test if a resultant docx is valid? |
Let me know if you want to re-open the PR. I am not able to make it work for now. Also I did try to add this feature in the past without success . |
No description provided.