text bbox, postscript formatting problem

If anyone can offer advice, I am a little desperate. Half

    > of my plots are logscale, so I need to fix this in order
    > to generate figures for my thesis. Is there anywhere I
    > can look to learn the basics of dealing with fonts at this
    > level? Any recommendations on C++ crash courses?

I have an idea -- it may be that the freetype module and postscript
are handling kerning differently. If for some reason freetype is
applying more kerning than the postscript machine you are rendering
with, then the bounding boxes will be smaller than the rendered ps
text. Consider this example -- the only difference between the two
strings is that in the unicode version I lay out the text character by
character and manually do the kerning myself (since postscript doesn't
have unicode I do the layout glyph-by-glyph basis)

  import pylab as p
  p.text(1,2,'AVA', fontsize=80, bbox={'pad':0})
  p.text(1,1,u'AVA', fontsize=80, bbox={'pad':0})
  p.grid()
  p.axis([0,3,0,3])
  p.savefig('test.png')
  p.savefig('test.ps')
  p.show()

The important point is that only in the regular text is the bounding
box wrong, which supports my hunch that there are different levels of
kerning in the default ps text.

Is the kerning information getting embedded?

Do some research on embedded truetype fonts and postscript kerning and
see if anything turns up.

We might consider using the unicode layout engine for *all* text as a
quick fix. We would pay a performance cost to do this, and it might
break numerical superscripting temporarily....

    > I'm amazed at the amount of effort required to handle
    > fonts properly.

Deranged scientist in Chicago laughs maniacally....

JDH

It's not much appreciated that handling fonts well is one of the hardest aspects of any multiplatform plotting package (at least that's what I think).

···

On May 3, 2005, at 6:11 PM, John Hunter wrote:

    > I'm amazed at the amount of effort required to handle
    > fonts properly.

Deranged scientist in Chicago laughs maniacally....