Hi,
I'm using the "Microsoft Sans Serif" true type font in my code and I want to
emulate bold or italic. I use Graphics2D to paint my text and I don't use chunk.
I found this message in the forum what exactly describes the problem but the
solution is unclear to me.
http://threebit.net/mail-archive/itext-questions/msg04147.html
I create the awt font from file and use the name to register it to pdf.
For the pdf font mapping pseudo code;
String formName = "somelocation/fonts/MICROSS.TTF";
PdfTemplate template = contentByte.createTemplate(rect.width(), rect.height());
DefaultFontMapper mapper = new DefaultFontMapper();
FontFactory.register(fontName);
BaseFont pdfFont = BaseFont.createFont(fontName, BaseFont.IDENTITY_H,
BaseFont.EMBEDDED);
Object allNames[] = {pdfFont.getPostscriptFontName(),
pdfFont.getFamilyFontName(), pdfFont.getFullFontName()};
mapper.insertNames(allNames, fontName);
Graphics2D g2d = template.createGraphics(rect.width(), rect.height(), mapper);
When I watch the Set of FontFactory.getRegisteredFamilies() I see the styles
missing compared to Arial.
arial=[Arial, Arial Bold, Arial Italic, Arial Bold Italic]
microsoft sans serif=[Microsoft Sans Serif]
How can I set these styles using FontFactory to emulate bold or italic?
Hopefully this is possible,
:Peter
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/