Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 5.0.2
-
Fix Version/s: 5.0.3
-
Component/s: None
-
Labels:None
-
Environment:JAI
-
Salesforce Case Reference:
Description
Here is the user's description of the issue:
I have two fonts: "GRR Fonts" and "GRR Fonts 2". Both fonts could not be found during image rendering and Lucida Bright was used as substitution.
The following are the ICEPdf logs that I found:
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager findFont
FINER: ----> Found font: lucidabright family: Plain for: lucidabright- Plain
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager getInstance
FINE: Font Substitution: Found java font: LucidaBright for named font GRR\u00onFonts2
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager findFont
FINER: ----> Found font: lucidabright family: Plain for: lucidabright- Plain
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager getInstance
FINE: Font Substitution: Found java font: LucidaBright for named font GRR\u00onFonts
The following items are attached:
1. PDF document that contains characters in GRR Fonts and GRR Fonts 2
2. ICEPdf log
I have two fonts: "GRR Fonts" and "GRR Fonts 2". Both fonts could not be found during image rendering and Lucida Bright was used as substitution.
The following are the ICEPdf logs that I found:
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager findFont
FINER: ----> Found font: lucidabright family: Plain for: lucidabright- Plain
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager getInstance
FINE: Font Substitution: Found java font: LucidaBright for named font GRR\u00onFonts2
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager findFont
FINER: ----> Found font: lucidabright family: Plain for: lucidabright- Plain
May 31, 2013 4:10:48 PM org.icepdf.core.pobjects.fonts.FontManager getInstance
FINE: Font Substitution: Found java font: LucidaBright for named font GRR\u00onFonts
The following items are attached:
1. PDF document that contains characters in GRR Fonts and GRR Fonts 2
2. ICEPdf log
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
The font name is represented as a name object "/GRR#20Fonts#202". Name objects have special escaping for certain characters like ( or ' but can also represent unicode values.
The Name code that we currently had would convert #20 hex to /u0020 in unicode but instead the code should have been converting the #20 to (char)32 or a space. I've updated the conversion code to convert anything < 127 to a character code and everything else Uniocde.
The patch makes sure that in this case the #20 gets correctly converted to a space and for substitution, the space is removed when comparing to the font properties names.