> AFAIK WinAnsi contains german umlauts. When you look at the 
> generated widths
> for the individual glyphs the offset seem to be correct. For 
> example the
> last shown width at offset 252 (which is 614) maps exactly to 
> ANSI umlaut ΓΌ
> (http://www.alanwood.net/demos/ansi.html).


You say umlaut, I say "diaeresis".  Lets call the whole thing off.

Hmm.  Probably not the encoding then, no.  Still, if you want to give 
Identity-H a shot, you'd have to...

(checks docs)

Ah yes.  If you want to control awt.Font->BaseFont conversion, you need to 
customize a FontMapper, and use one of the createGraphics2D() overrides that 
will accept it as a parameter.

Looking at the source to DefaultFontMapper (FontMapper is an interface), I see 
that CP1252 (winansi) is hardcoded as the requested encoding:

(At line 167 of 
http://itext.svn.sourceforge.net/viewvc/itext/trunk/src/core/com/itextpdf/text/pdf/DefaultFontMapper.java?revision=4141&view=markup)

I also see that you can write BaseFontParameters into a mapper prior to using 
it.  So you should be able to whip up your own DefaultFontMapper, and add a new 
BaseFontParamters instance for LucidaWhastis.  Something Like This:

FontMapper myMapper = new DefaultFontMapper();
BaseFontParamters fontParams= new BaseFontParameters( "LucidaWhatsis" );
fontParams.encoding = BaseFont.IDENTITY_H;
myMapper.putName( "LucidaWhatsis", fontParams );

Graphics2D myGraphics = myPdfContent.createGraphics( wid, hei, myMapper );


Another option would be to disable embedding (with fontParams.embeeded=false) 
**instead**of** changing the encoding.  Identity-H fonts are always embedded 
subsets, and override the requested embedding.  You've got an embedded subset 
there, so there could be funkiness as a result.  It's theoretically possible 
that the double-dot-u needs a regular 'u' present in order to draw, which is in 
fact missing from this subset.  

OTOH, If that were the case I'd have expected this sort of problem to crop up 
fairly regularly in countries where such characters are used.  YMMV.

--Mark Storer 
  Senior Software Engineer 
  Cardiff.com

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

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to