On 16/06/2011 10:10, Siegfried Raab wrote:

Hallo,

I try to embed the java.awt.Font "Symbol"


java.awt? Are you using PdfGraphics2D?
If not, please don't mention java.awt!

using the following code

/FontFactory.registerDirectories();/

/com.itextpdf.text.Font fTtf = FontFactory.getFont(f.getFontName());/


What is the value of f.getFontName()?
Is that name present when you list the names registered in the FontFactory?
If so: what type of font is it?
I assume that you're referring to the "standard Type 1 font" named Symbol.

//

/try {/

/ fTtf = FontFactory.getFont(f.getFontName(),BaseFont.IDENTITY_H, BaseFont.EMBEDDED);/

/} catch (Exception e) {}/

while /f/ is the java.awt.Font "Symbol".


Again: is it relevant that you're using java.awt.Font?
It's confusing: it may set us in the wrong track, trying to diagnose your problem. In any case: the font you're referring to is the "standard Type 1 font" named Symbol,
then using IDENTITY_H as encoding is wrong!!!

This throws an exception. Catching and replacing it with

/fTtf = FontFactory.getFont(f.getFontName(),fTtf.getBaseFont().getEncoding(), BaseFont.EMBEDDED);/

works but the Font isn't embedded and results in greek letters.


Did you read any documentation at all?
The fourteen "standard Type 1 fonts" (as defined in ISO-32000-1) are NEVER embedded by iText,
UNLESS you provide a pfb containing the glyph description of that font.

I already searched the mail archive and found [iText-questions] Cannot get glyphs rendering from the Symbol Font into the PDF file <http://www.mail-archive.com/itext-questions@lists.sourceforge.net/msg10568.html>with the advice "Use the encoding "Symbol" for the Symbol font.". But it doesn't work also.


Standard Type 1 fonts are NEVER embedded.
Symbol has a CUSTOM encoding.
You shouldn't use IDENTITY_H for a standard Type 1 font.
iText shows the documented behavior, but you claim it's wrong.
Please read the documentation ( http://itextpdf.com/book/ ) before saying "it doesn't work".
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to