Either you didn't read the font from the dir or you are not calling the font by the full name. Check the names available with DefaultFontMapper.getMapper().
Best Regards, Paulo Soares > -----Original Message----- > From: Wolfram Rittmeyer [SMTP:[EMAIL PROTECTED] > Sent: Monday, February 24, 2003 9:08 > To: [EMAIL PROTECTED] Sourceforge. Net > Subject: AW: [iText-questions] still a problem with > unicode-characters in Graphics2-texts > > Hi Paulo, > > I tried the code-snippet you sent me, but the problem is, that the > BaseFontParameters always *are* null. So where are the Parameters set. > Where > have I to insert the snippet or what else have I to do before that so that > I > am able to set the encoding of the then existing BaseFontParameters? > > Greetings, > > Wolfram Rittmeyer > > > > -----Urspr�ngliche Nachricht----- > > Von: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Auftrag von Paulo > > Soares > > Gesendet: Freitag, 21. Februar 2003 12:25 > > An: 'Wolfram Rittmeyer'; [EMAIL PROTECTED] Sourceforge. Net > > Betreff: RE: [iText-questions] still a problem with unicode-characters > > in Graphics2-texts > > > > > > The problem is that DefaultFontMapper maps the fonts with the winansi > > encoding by default. You'll have to change the encoding to an > > encoding with > > the russian characters or better yet, use the encoding Identity-H > > to support > > all the encodings in that particular font. Assuming that you want > > to change > > the encoding to Arial: > > > > mapper.insertDirectory("c:\\windows\\fonts"); > > DefaultFontMapper.BaseFontParameters pp = > > mapper.getBaseFontParameters("Arial"); > > if (pp != null) > > pp.encoding = BaseFont.IDENTITY_H; > > > > Best Regards, > > Paulo Soares > > > > > > > -----Original Message----- > > > From: Wolfram Rittmeyer [SMTP:[EMAIL PROTECTED] > > > Sent: Friday, February 21, 2003 11:00 > > > To: [EMAIL PROTECTED] Sourceforge. Net > > > Subject: [iText-questions] still a problem with unicode-characters in > > > Graphics2-texts > > > > > > Hi, > > > > > > yesterday I already posted a message about problems with using a > > > Graphics2-objects method "g.drawString(xyz)". > > > > > > Now I found the method cb.getGraphics(width, height, fontMapper). And > I > > > used > > > a mapper to map my BaseFont-object (created using > > BaseFont.EMBEDDED) to an > > > awt-Font-object. > > > > > > But yet I do not get the expected results. Though in other parts all > > > russian > > > characters are displayed in a correct manner, the > g.drawString()-method > > > does > > > yield inacceptable results. It displays western text but instead of > > > printing > > > russinan characters it just prints blanks. > > > > > > Why that? What else have I to add? > > > > > > Part of my code: > > > baseFont = BaseFont.createFont(UNICODE_FONT, BaseFont.IDENTITY_H, > > > BaseFont.EMBEDDED); > > > cb.setFontAndSize(baseFont, 6); > > > FontMapper mapper = new DefaultFontMapper(); > > > PdfTemplate mapTemplate = cb.createTemplate((int)(realWidth - (2 * > > > (mapPadding)) - 2), mapHeight - (2 * (mapPadding))); > > > Graphics2D g2 = mapTemplate.createGraphics((int)(realWidth - (2 * > > > (mapPadding)) - 2), mapHeight - (2 * (mapPadding)), mapper); > > > awtFont = mapper.pdfToAwt(baseFont, 6); > > > g2.setFont(awtFont); > > > painter.paint(g2, 0, 0, (int)(realWidth - (2 * (border + > > > mapPadding)) - 2), > > > mapHeight - (2 * (mapPadding))); > > > > > > The painter uses g2.drawString() but does not set a font itself... > > > > > > Another strange thing with g2.drawString: > > > If I look at the font-list of the AcrobatReader it does *not* show > > > "embedded" with the given Font, though this is displayed with > > every other > > > Font created with BaseFont.EMBEDDED. > > > > > > Thanx for any help, > > > > > > Wolfram Rittmeyer (from Germany) > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > > > The most comprehensive and flexible code editor you can use. > > > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. > > > www.slickedit.com/sourceforge > > > _______________________________________________ > > > iText-questions mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > > The most comprehensive and flexible code editor you can use. > > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. > > www.slickedit.com/sourceforge > > _______________________________________________ > > iText-questions mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
