Chris Bredesen wrote:

Hi All,
I have some data that are stored in UTF-8 but use glyphs that are not part of the standard Latin1 fonts that PDF specifies. I can successfully get these characters to render when I directly load the font using its disk path, but not when I access the font by name. To recap, this works: BaseFont.createFont("c:\\windows\\fonts\\Arial.TTF", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

You did do something like FontFactory.register("c:\\windows\\fonts\\Arial.TTF"); before executing the line that follows, did you? Otherwise iText won't find the font.

But this doesn't:
FontFactory.getFont("Arial", BaseFont.IDENTITY_H, 10)
Neither throws an Exception, it's just that the second one skips over the non Latin1 characters (example: ĞaŞ).

Helvetica is used instead of the font that wasn't found.

Is there a way to get these characters to render without having to know the path to the font? We develop on Windows and deploy on Linux. We have the MS TTF's installed on our Linux boxes but I have not even attempted to try this yet because I want to avoid having to know the path to the fonts.

Look at the registerDirectories method in FontFactory.

Is there another method I should be trying? Possibly jar-ing up the TTF's and deploying them with the app?

That would be a solution too.
br,
Bruno


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to