StimVinsh / xdocreport

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

incorrect font styling in odf->pdf conversion #77

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In an attached file there is a fragment with fonts <bold italic> <normal> <bold 
underline> and others.
After conversion to pdf this text styling is completely different than original.
If the whole paragraph has the same font, then conversion is ok, but if phrases 
added to paragraph has different font the conversion may be incorrect.

Original issue reported on code.google.com by abe...@gmail.com on 17 Feb 2012 at 2:36

Attachments:

GoogleCodeExporter commented 8 years ago
The situation occurs if paragraph starts with bold or italic font and some 
phases of a paragraph has 'normal font. The converter does not recognize 
changing font back to 'normal'.

Original comment by abe...@gmail.com on 20 Feb 2012 at 9:31

GoogleCodeExporter commented 8 years ago
While fixing this bug I tried different variants of Times New Roman font and I 
encountered a problem regarding font selection.

In ODFFontRegistry there is a function resolveFamilyName

@Angelo - what was the purpose of this function?

The effect is that for 'Times New Roman' an incorrect font is retrieved.
It looks ok for 'normal' style but 'bold' 'italic' or 'bold italic' the 
returned font looks very ancient. Obviously it is not a system font used by 
open office. I think it is internal iText font. Moreover non standard (cp1252) 
diactric characters are not supported.
If the translation is removed font selection works ok. Times New Roman font 
with different styles is properly retrieved.
So I think this translation is unecessary, even buggy and should be removed.

Original comment by abe...@gmail.com on 20 Feb 2012 at 11:39

GoogleCodeExporter commented 8 years ago
Hi Leszek,

resolveFamilyName it's kind of mapping between iText Font and ODT Font name. If 
you tell me that it works without this method and it's buggied, remove it!

Regards Angelo

Original comment by angelo.z...@gmail.com on 20 Feb 2012 at 12:39

GoogleCodeExporter commented 8 years ago
fix committed

Original comment by abe...@gmail.com on 20 Feb 2012 at 3:09