Hello,

I have just started using the FontFactory to deal with fonts, and I came 
across some unexpected behavior.  I am trying to register fonts with an alias, 
and then get those fonts later using the same alias.  The relevant lines of 
code look something like this (I am using iTextSharp):

FontFactory.Register("C:\\windows\\fonts\\verdana.ttf", "Normal");
FontFactory.Register("C:\\windows\\fonts\\verdanab.ttf", "Bold");
...
Font f = FontFactory.GetFont("Normal", BaseFont.WINANSI, 8);

The problem I encounter is that the font retrieved is not Verdana.  I looked 
into the code a little bit and found that when GetFont tries to look up a font 
based on name in the trueTypeFonts map, it first converts the name to 
lowercase.  But when you Register a font with an alias, it does not convert 
that alias to lowercase when putting the font into the trueTypeFonts map.

My workaround is to convert my alias to lowercase before registering, but this 
seems like a bug in iTextSharp.

--Jason



-------------------------------------------------------
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_id=7637&alloc_id=16865&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to