dbarra / xdocreport

Automatically exported from code.google.com/p/xdocreport
1 stars 0 forks source link

Incorrect font requested for Cambria (Headings) - the MS Word defaults headings font #250

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

I have uploaded a simple class (which is based on your 
ConvertDocxStructuresToPDF.java) along with the two docx it converts. My 
version loads the docx files each containing just some heading text and outputs 
the contained fonts.

Note that:

1. CambriaHeadings.docx contains a string which is formatted with the default 
MS Word Heading 1 style: i.e. style= Cambria (Headings).
2. Cambria.docx contains the same string with the Heading 1 style modified 
(right click on Heading 1 in Styles panel > Modifiy > Formatting > Cambria), 
i.e. style= Cambria.

Run the test file.

What is the expected output? What do you see instead?

The two files when processed produce ouput as follows:

1. CambriaHeadingsRequired font: familyName=Calibri, encoding=Cp1252, 
size=14.0, style=1, color=java.awt.Color[r=54,g=95,b=145]
2. CambriaRequired font: familyName=Cambria, encoding=Cp1252, size=14.0, 
style=1, color=java.awt.Color[r=54,g=95,b=145]

I expected that both would list the required family name as Cambria but when 
the unmodified heading 1 is used (Cambria (Headings)), the Cambria font is not 
requested.

This means that when processing a document with default headings the wrong font 
is requested for them so it is not possible to supply the correct font (the 
supply of the correct font is not included in the example code).

What version of the product are you using? On what operating system?

XDocReport 1.0.0 on Windows 7 with MS Word 2010 to produce the docx.

Original issue reported on code.google.com by Mr.M.McM...@googlemail.com on 22 Apr 2013 at 9:05

Attachments:

GoogleCodeExporter commented 8 years ago
I know this problem but I don't know how to resolve that? My problem is where I 
can found (styles.xml?, tableFont.xml?) the information about default font? 
When you force the font, it works because in the styles.xml it contains the 
font name.

Original comment by angelo.z...@gmail.com on 22 Apr 2013 at 9:16