In my application, I am using multiple fonts representing symbols, Latin and non Latin characters. Fonts are MSMincho, Arial and Wingdings.
Thus, I need to set the encoding for some fonts to CP1252 eg Wingdings and the others to IDENTITY_H eg MSMincho.
HashMap hmBaseFonts = defaultFontMapper.getMapper();
Iterator itr = hmBaseFonts.values().iterator();
Iterator itrKeys = hmBaseFonts.keySet().iterator();
while (itr.hasNext())
{
DefaultFontMapper.BaseFontParameters bf = (DefaultFontMapper.BaseFontParameters) itr.next();
String sFontName = (String) itrKeys.next();
BaseFont baseF = defaultFontMapper.awtToPdf(new Font(sFontName, 1, 12));
if(baseF.getFontType() != 3)
{
bf.encoding = com.lowagie.text.pdf.BaseFont.CP1252;
}
else
{
bf.encoding = com.lowagie.text.pdf.BaseFont.IDENTITY_H;
}
}
When I do this it is setting the encoding for all the fonts to CP1252, thus I do not see any non Latin characters in my pdf file but do see the Wingdings symbol.
Any feedback will be highly appreciated.
Regards,
Vishal Jain.
