On Thursday 21 September 2006 15:50, Lidong Liu wrote: > Thank you very much for your excellent work on iText, which gives me a lot > of help! > > Here is a work around to use fonts with names in Asian encodings in RTF > documents. Wish it can be merged in to main source: I have looked at your code contribution, but unfortunately cannot comprehend how it is supposed to work. I see you setting the charset explicitly and for the default font, but where is it used? Where are you using the charset to deal with Asian encodings differently than normal?
Greetings,
Mark
>
> #######################
> # DIFF START
> #######################
> Index: D:/Devt/itext/src/com/lowagie/text/rtf/style/RtfFont.java
> ===================================================================
> --- D:/Devt/itext/src/com/lowagie/text/rtf/style/RtfFont.java (revision
> 2)
> +++ D:/Devt/itext/src/com/lowagie/text/rtf/style/RtfFont.java (revision
> 4)
> @@ -248,6 +248,11 @@
> this.fontName = fontName;
> }
>
> + public RtfFont(String fontName, float size, int style, Color color,
> int charset) {
> + this(fontName, size, style, color);
> + this.charset = charset;
> + }
> +
> /**
> * Special constructor for the default font
> *
> @@ -270,6 +275,7 @@
> if(font != null) {
> if(font instanceof RtfFont) {
> this.fontName = ((RtfFont) font).getFontName();
> + this.charset = ((RtfFont) font).getCharset();
> } else {
> setToDefaultFamily(font.getFamilyname());
> }
> @@ -574,6 +580,14 @@
> super.setStyle(style);
> fontStyle = style();
> }
> +
> + public int getCharset() {
> + return charset;
> + }
> +
> + public void setCharset(int charset) {
> + this.charset = charset;
> + }
>
> /**
> * Gets the font number of this RtfFont
> #######################
> # DIFF END
> #######################
--
People are beginning to notice you. Try dressing before you leave the house.
My GPG public key is available at:
http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc
pgpg5jhvVlDYh.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
