By Date: <-- -->
By Thread: <-- -->

Font problem



It's entirely possible that your FontFactory doesn't know about your system fonts yet.  Whenever the factory is asked for a font it has never heard of, it returns a default font (you guessed it, Helvetica).
 
Have a look at the Register Fonts example on the itext website:
http://itextdocs.lowagie.com/examples/com/lowagie/examples/fonts/getting/RegisterFont.java
 
In addition to the FontFactory.register() function for individual fonts, there's also a FontFactory.registerDirectory() which will grab all the fonts in the given path (but not subdirectories, just the path you pass in).
 
 
See also:
http://itextdocs.lowagie.com/tutorial/fonts/getting/index.html

--Mark Storer
  Senior Software Engineer
  Cardiff.com

#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;

-----Original Message-----
From: itext-questions-bounces (at) lists.sourceforge.net [mailto:itext-questions-bounces (at) lists.sourceforge.net]On Behalf Of Venkat Tubati
Sent: Wednesday, January 31, 2007 10:24 PM
To: itext-questions (at) lists.sourceforge.net
Subject: [iText-questions] Font problem

Hello Team,
 
I cant able to render different fontstyles in the PDF file(like: MonotypeCorsiva) in this case it is assigning the default style(HELVETICA)to the text.
I am using this code please look at for the reference and let me know where i need to change my code.
 
___________________________________________________________________________________________________________________
 
//renderedStringInfo is the string which i am rendering
 
font = iTextSharp.text.FontFactory.GetFont(renderedStringInfo.Font.Name, renderedStringInfo.Font.Size , Convert.ToInt32(renderedStringInfo.Font.Style), iTextSharp.text.Color.BLACK);

font.Color = new iTextSharp.text.Color(brushColor);

baseFont = font.GetCalculatedBaseFont(false);      

pdfContentByte.SetFontAndSize(baseFont, renderedStringInfo.Font.Size);

___________________________________________________________________________________________________________________
 
 
Thanks in advance,
 
T.Venkat.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/