> -----Original Message----- > From: Paul Warren [SMTP:[EMAIL PROTECTED]] > Sent: Monday, May 13, 2002 13:56 > To: [EMAIL PROTECTED] > Subject: [iText-questions] Unicode fonts via PDFGraphics2D > > I am trying to generate graphics for inclusion in PDFs which contain > the infinity symbol (unicode 0x221E). > > I can get this to work in a normal paragraph: > > BaseFont myFont = BaseFont.createFont( > "/home/shared/drop/fonts/arialuni.ttf", > BaseFont.IDENTITY_H, > BaseFont.EMBEDDED); > > document.add( > new Paragraph( > "Infinity: \u221e", > new com.lowagie.text.Font(myFont, 12, > com.lowagie.text.Font.NORMAL))); > > but I can't get this to work via the Graphics 2D interface. From > looking at other mails on this list I understand that I need to tweak > the font mapper: > > DefaultFontMapper mapper = new DefaultFontMapper(); > mapper.insertDirectory("/home/shared/drop/fonts"); > DefaultFontMapper.BaseFontParameters pp = > mapper.getBaseFontParameters("Arial Unicode MS"); > if (pp != null) { > pp.encoding = BaseFont.IDENTITY_H; > } > > What I can't do is actually select and use this font via the Graphics 2D > interface. I found part of a thread in the mailing list archives (which > is where I got the above code) but I couldn't find the beginning of the > thread. > The purpose of the FonfMapper is to map a PDF font to a awt font. This implies that there is a awt font to start with. You'll have to find out how are the fonts registered in Unix. In Windows, all the system fonts are automatically registered and I suspect that it's the same in Unix with the X fonts. If you can't register the font you may replace any awt font with: mapper.putName("sansserif", pp); > A non-itext related problem that I have is that we will not be able to > distribute the MS Arial Unicode font as part of our application. Can > anyone suggest an alternative source for a font containing the infinity > symbol? > All the standard Windows fonts have that symbol. Best Regards, Paulo Soares > cheers, > > Paul > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions