That empty string parameter in your createFont call is, I'll wager
(yep), the desired encoding.  The default is code page 1252
(WinAnsiEncoding, whatever you want to call it).  It's a single-byte
encoding that was the default on MS OS's for years.

If you want access to every conceivable character in a font, use
BaseFont. IDENTITY_H.  With it, you're not even restricted to Unicode...
though how you'd ask for a non-Unicode character using a Unicode-base
java.lang.String is an interesting question.

Anyway... use BaseFont.IDENTITY_H.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 

> -----Original Message-----
> From: Werner Aernouts [mailto:[email protected]]
> Sent: Wednesday, June 23, 2010 2:13 PM
> To: [email protected]
> Subject: [iText-questions] Characters missing when using.pfm font
> 
> Dear,
> I am construction a font from a .pfm file as it says in the book, i.e.
> 
> font_normal_10 = new Font(
>
BaseFont.createFont("C:\\Windows\\Fonts\\Sun5____.pfm","",BaseFont.EMBED
DE
> D),
> 10 );
> 
> When I add text using this font to the PDF, it works fine for most
> (ASCII) characters, but when I have special characters, like the euro
> sign (\u20AC) or eastern-european characters (\u00E7) they are missing
> from my text.
> 
> I have checked with Character Map, and these characters do seem to be
> included in the font, so I guess there is something wrong with the
> encoding of the font. I have experimented with some encodings but to
no
> avail.
> 
> In the same PDF I use the same characters without any problem with a
> Verdana TTF that I included as follows
> FontFactory.register("C:\\Windows\\Fonts\\verdana.TTF", "Verdana");
> font_verdana_10 = FontFactory.getFont("Verdana", "winansi", true, 10,
> Font.NORMAL);
> 
> Anyone any suggestions?
> 
> Best regards,
> Werner
> 
>
------------------------------------------------------------------------
--
> ----
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.829 / Virus Database: 271.1.1/2958 - Release Date:
06/23/10
> 04:11:00

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to