DefaultPdfExportView doesn't support asian font
-----------------------------------------------
Key: DISPL-348
URL: http://jira.codehaus.org/browse/DISPL-348
Project: DisplayTag
Type: Bug
Versions: 1.1
Reporter: Dureek Wu
Priority: Minor
All "get*Font" methods defined in
"displaytag-1.1\displaytag\src\main\java\org\displaytag\render\ItextTableWriter.java"
are assuming the font is "HELVETICA". This will be a problem when you want to
display aisan characters. IMHO, pdf font should be configable, since this is an
important part in todays i18n applications.
Currently, I add follow metho in ItextTableWriter:
--
private Font getFont(float size, int style, Color color) {
Font font = null;
try {
font = new Font(BaseFont.createFont("STSong-Light"/*
"Helvetica" */,
"UniGB-UCS2-H"/* BaseFont.WINANSI */,
false), size, style,
color);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (font == null) {
font =
FontFactory.getFont(FontFactory.HELVETICA, size, style,
color);
}
}
return font;
}
and then change all get*Font methods to use above method. For example:
...
protected Font getTableFont() {
return getFont(10, Font.NORMAL, new Color(0x00, 0x00, 0x00));
}
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
_______________________________________________
displaytag-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel