BaseFont testfont = BaseFont.createFont("d:\\lte50102.ttf", BaseFont.WINANSI, BaseFont.EMBEDDED, false, null, null);
 
Paulo


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thorben Rehburg
Sent: Thursday, May 18, 2006 12:08 PM
To: [email protected]
Subject: [iText-questions] BaseFont getWidths()

Hello,

I will use com.lowagie.text.pdf.BaseFont "getWidths()" and have a problem with Fonts!

FontFactory.registerDirectory("d:/");Font font = FontFactory.getFont("LETTERGOTHIC LT", BaseFont.WINANSI, BaseFont.EMBEDDED);

font= Font  (id=44)
      baseFont= TrueTypeFont  (id=26)
           

            embedded= true
            encoding= "Cp1252"
           
            fileName= "d:\lte50102.ttf"
            fontName= "LetterGothicLT"
            …
            forceWidthsOutput= false      
...

You see it’s ok but the Font is cached and this is not what I want.

Therefore I use the BaseFont.

To produce the BaseFont I have this problem. For example:

BaseFont testfont = BaseFont.createFont("LETTERGOTHIC LT", BaseFont.WINANSI, BaseFont.EMBEDDED, false, null, null);

com.lowagie.text.DocumentException: Font 'LETTERGOTHIC LT' with 'Cp1252' is not recognized.


I think, I need the “cached” flag, because I use “getWidths()” from BaseFont, therefore I need a new Font.

I can copy and so on
Font com.lowagie.text.FontFactoryImp.getFont(String fontname, String encoding, boolean embedded, float size, int style, Color color),
but this is not my goal.

Is it possible to extend the FontFactory with a “cached” flag or is there another possibility?


Thanks in advance

Thorben



Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.

Reply via email to