[#10816] - PDF Exporting Seems to Not Prioritize Primary Font in Font Set

Bug report
Project: Severity:
Component: Reproducibility:
Assigned to:

I have 3 font family setup:
1. Liberation Sans - complete with styles
2. Liberation Sans - no styles - normal font only
3. Ming(for ISO10646) - Chinese font

I have 2 font sets:
Font1 - Liberation Sans (primary), Ming
Font2 - Liberation Sans - no styles (primary), Ming

Test String: Advertising 廣告從業員

Column 1: Font 1 (odd) or Font 2 (even)
Column 2: Liberation Sans (odd) or Liberation Sans - no styles (even)
Column 3: Ming - this is normal only

Row 1-2: Normal
Row 3-4: Bold
Row 5-6: Italic
Row 7-8: Bold Italic
Row 9-10: Underline
Row 10-11: Strikethrough

I was expecting that for the normal one, the Advertising part in Column 1 should be rendered in Liberation font, but it was not.

From the test it seems that the PDFExporter will do the following in order:
1. find a font family that can render everything in the text container including styles (see row 1, everything is in Ming), else
2. find if part of the text can be rendered in a font family that has the style specified and use it partially in rendering (see row 3, Advertising is in Liberation), else
3. find a font family that can render the text in an approximation of the styles used (see row 4, Advertising is rendered in a Bold style approximation of Ming font).

Shouldn't it be:
1. Use primary font, check each character if it can be rendered in the glyphs available in primary font. Use approximation of style if needed (though this is not a problem usually for English fonts).
2. For remaining characters, check each font specified in font set in order and use if matched. Use approximation of style if needed.

Basically, just need to have the priority of Font Set ordering (with primary settings) > style availability in PDF Font declaration.

If the current behavior is as expected, can we have option to have the above way of rendering for PDF Exporting?

PDF icon simpletest.pdf84.89 KB
cutebluangel's picture
Joined: Sep 23 2012 - 8:45pm
Last seen: 16 hours 49 min ago



This is the template file used

Binary Data simpletest.jrxml13.62 KB

As I cannot upload the jar file because of its size, this is the font family declaration inside the jar file.

File fontsfamily1524657160496.xml1.14 KB