If the font is not found as a file path an attempt is made to load it as a 
resource. You don't have to do anything different.

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Chris Bredesen
> Sent: Tuesday, November 29, 2005 4:20 PM
> To: bruno
> Cc: [email protected]
> Subject: RE: [iText-questions] TrueType & "extended" character sets
> 
> > > 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.
> 
> No, but I see now the error of my ways!
> 
> > > 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.
> 
> Now this makes sense.
> 
> > > 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.
> 
> I'll try this....
> 
> > >  
> > > 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.
> 
> Is there anything special I have to do to make iText aware of 
> TTF's in a Jar file?   All the register/get methods seem to 
> take a String paramete which is the disk path of the font.  
> How about classpath resources?  The fonts from Jar files 
> section discusses the use of CJK fonts (will need this in the 
> future) but seems unclear about what is special about getting 
> fonts from a Jar file.
> 
> Having the fonts available in a jar file is of particular 
> interest to me (provided it doesn't violate any licensing) 
> because it is one less thing we have to do to prepare a Linux 
> box to run our app.
> 
> Thanks for your immediate feedback and great product, Bruno.
> 
> Cheers,
> 
> Chris
> 
> 
> 
> -------------------------------------------------------
> 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=ick
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
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