That's wrong policy and it may not work with today's release. Either you work in the awt universe or in the pdf one. I'll release a version today that only looks at the awt spacings. It will increase/decrease the space between pdf letters so that the pdf spacing matchs the awt spacing. The result is that the spacing is the same in awt and in pdf even if the font is not the same.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of bodo teichmann > Sent: Tuesday, January 11, 2005 6:58 AM > To: [email protected] > Subject: [iText-questions] Re: why is PdfGraphics2D using > cb.showText(s) instead of cb.showTextKerned(s) ? > > well, i calculate the positions of words using iText metrics, > then i use > the result to draw the strings on awt. that way the > error-offset in awt > is small enough (exept when using kerning , as i said, i also need to > calc the offset correction of each glyph using the kerning table from > itext) > bodo > > > Paulo Soares schrieb: > > My objective was to match the awt and pdf spacing. > > > > ----- Original Message ----- > > From: "Bill Ensley" <[EMAIL PROTECTED]> > > To: "iText Mail Group" <[email protected]> > > Sent: Friday, January 07, 2005 6:48 PM > > Subject: RE: [iText-questions] Re: why is PdfGraphics2D > using cb.showText(s) > > instead of cb.showTextKerned(s) ? > > > > > > > >>Thank you for your efforts, I tried it and it looks good > for the PDF, > >>but my problem is in AWT and SWING itself and how they measure text. > >>iText has much more control. :( > >> > >>Bill Ensley > >>Bear Printing > >> > >> > >> > >>-----Original Message----- > >>From: Paulo Soares [mailto:[EMAIL PROTECTED] > >>Sent: Friday, January 07, 2005 10:04 AM > >>To: Bill Ensley > >>Subject: RE: [iText-questions] Re: why is PdfGraphics2D using > >>cb.showText(s) instead of cb.showTextKerned(s) ? > >> > >> > >>I posted a solution but the mailing list is really slow. Try this. > >> > >> > >>>-----Original Message----- > >>>From: [EMAIL PROTECTED] > >>>[mailto:[EMAIL PROTECTED] On > >>>Behalf Of Bill Ensley > >>>Sent: Friday, January 07, 2005 4:44 PM > >>>To: iText Mail Group > >>>Subject: RE: [iText-questions] Re: why is PdfGraphics2D using > >>>cb.showText(s) instead of cb.showTextKerned(s) ? > >>> > >>>I may be mistaken, but iText uses Fractional Metrics on fonts > >>>by default? > >>> > >>>Of course this is good, but AWT and Swing fart on > Fractional Metrics. > >>> > >>>I have successfully overridden methods in View that > measure the text > >>>and now have a Fractional Metrics JTextPane that outputs to iText > >>>almost exactly as seen on the screen. > >>> > >>>There is quite a bit of code to modify, so I won't post it > all here, > >>>but if anyone is interested I will be glad to forward along > >>>what I have learned. > >>> > >>>Bill Ensley > >>>Bear Printing > >>> > >>>-----Original Message----- > >>>From: [EMAIL PROTECTED] > >>>[mailto:[EMAIL PROTECTED] > Behalf Of bodo > >>>teichmann > >>>Sent: Friday, January 07, 2005 3:51 AM > >>>To: [email protected] > >>>Subject: [iText-questions] Re: why is PdfGraphics2D using > >>>cb.showText(s) > >>>instead of cb.showTextKerned(s) ? > >>> > >>> > >>>BTW: javas Graphics2D.drawString() unfortunantely ignores > kerning(). > >>>but for kerning, you can correct the the glyph position by hand: > >>>first call Font.createGlyphVector() > >>>then use kering table from the font and correct the glyph > >>>positions with > >>>the value from the kering table, then call > >>>Graphics2D.drawGlyphVector(). > >>>Bodo > >>> > >>> > >>> > >>> > >>>Paulo Soares schrieb: > >>> > >>>>Perhaps next week. I have a couple of ideas. > >>>> > >>>> > >>>> > >>>>>-----Original Message----- > >>>>>From: [EMAIL PROTECTED] > >>>>>[mailto:[EMAIL PROTECTED] On > >>>>>Behalf Of Bill Ensley > >>>>>Sent: Thursday, January 06, 2005 8:40 PM > >>>>>To: iText Mail Group > >>>>>Subject: RE: [iText-questions] why is PdfGraphics2D using > >>>>>cb.showText(s) instead of cb.showTextKerned(s) ? > >>>>> > >>>>>Is there any way to make the AWT and PDF Spacing match closer? > >>>>> > >>>>>Bill Ensley > >>>>>Bear Printing > >>>>> > >>>>>-----Original Message----- > >>>>>From: [EMAIL PROTECTED] > >>>>>[mailto:[EMAIL PROTECTED] > >>> > >>>Behalf Of Paulo > >>> > >>>>>Soares > >>>>>Sent: Thursday, December 30, 2004 6:52 AM > >>>>>To: bodo teichmann; [email protected] > >>>>>Subject: RE: [iText-questions] why is PdfGraphics2D using > >>>>>cb.showText(s) > >>>>>instead of cb.showTextKerned(s) ? > >>>>> > >>>>> > >>>>>It's a design option. The pdf and the awt spacing will not > >>>>>match in any > >>>>>case. > >>>>> > >>>>> > >>>>> > >>>>>>-----Original Message----- > >>>>>>From: [EMAIL PROTECTED] > >>>>>>[mailto:[EMAIL PROTECTED] On > >>>>>>Behalf Of bodo teichmann > >>>>>>Sent: Thursday, December 30, 2004 1:23 PM > >>>>>>To: [email protected] > >>>>>>Subject: [iText-questions] why is PdfGraphics2D using > >>>>>>cb.showText(s) instead of cb.showTextKerned(s) ? > >>>>>> > >>>>>>just wondering ,why PdfGraphics2D seems to ignore the font's > >>>>>>kerning ? > >>>>>>and why does it use > >>>>>>FontMetrics fm = getFontMetrics(); > >>>>>> double width = fm.stringWidth(s); > >>>>>>instead of this: > >>>>>> double mywidth = baseFont.getWidthPointKerned(s,fontSize); > >>>>>>or > >>>>>> double mywidth = baseFont.getWidthPoint(s,fontSize); > >>>>>> > >>>>>>bodo > >>>>>> > >>>>>> > >>>>>> > >>>>>>------------------------------------------------------- > >>>>>>The SF.Net email is sponsored by: Beat the post-holiday blues > >>>>>>Get a FREE limited edition SourceForge.net t-shirt from > ThinkGeek. > >>>>>>It's fun and FREE -- well, > >>>>> > >>>>>almost....http://www.thinkgeek.com/sfshirt > >>>>> > >>>>> > >>>>>>_______________________________________________ > >>>>>>iText-questions mailing list > >>>>>>[email protected] > >>>>>>https://lists.sourceforge.net/lists/listinfo/itext-questions > >>>>>> > >>>>> > >>>>> > >>>>>------------------------------------------------------- > >>>>>The SF.Net email is sponsored by: Beat the post-holiday blues > >>>>>Get a FREE limited edition SourceForge.net t-shirt from > ThinkGeek. > >>>>>It's fun and FREE -- well, > >>> > >>>almost....http://www.thinkgeek.com/sfshirt > >>> > >>>>>_______________________________________________ > >>>>>iText-questions mailing list > >>>>>[email protected] > >>>>>https://lists.sourceforge.net/lists/listinfo/itext-questions > >>>>> > >>>>> > >>>>>------------------------------------------------------- > >>>>>The SF.Net email is sponsored by: Beat the post-holiday blues > >>>>>Get a FREE limited edition SourceForge.net t-shirt from > ThinkGeek. > >>>>>It's fun and FREE -- well, > >>> > >>>almost....http://www.thinkgeek.com/sfshirt > >>> > >>>>>_______________________________________________ > >>>>>iText-questions mailing list > >>>>>[email protected] > >>>>>https://lists.sourceforge.net/lists/listinfo/itext-questions > >>>>> > >>>> > >>>> > >>>> > >>>>------------------------------------------------------- > >>>>The SF.Net email is sponsored by: Beat the post-holiday blues > >>>>Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > >>>>It's fun and FREE -- well, > >>> > >>>almost....http://www.thinkgeek.com/sfshirt > >>> > >>> > >>> > >>>------------------------------------------------------- > >>>The SF.Net email is sponsored by: Beat the post-holiday blues > >>>Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > >>>It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > >>>_______________________________________________ > >>>iText-questions mailing list > >>>[email protected] > >>>https://lists.sourceforge.net/lists/listinfo/itext-questions > >>> > >>> > >>>------------------------------------------------------- > >>>The SF.Net email is sponsored by: Beat the post-holiday blues > >>>Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > >>>It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > >>>_______________________________________________ > >>>iText-questions mailing list > >>>[email protected] > >>>https://lists.sourceforge.net/lists/listinfo/itext-questions > >>> > >> > >> > >> > >>------------------------------------------------------- > >>The SF.Net email is sponsored by: Beat the post-holiday blues > >>Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > >>It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > >>_______________________________________________ > >>iText-questions mailing list > >>[email protected] > >>https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
