Re: Metapost - text alignment

On 1/23/07, Lars Clausen <lars raeder dk> wrote:
Young, Robert said:
> I'm willing to spend a little time trying to fix this.
> Lars - should I implement a draw_text and draw_text_line method for the
> Metapost export? Or what would you recommend?
> I can't promise to make this "perfect", but I would like the centre,
> left, and right aligned text to be honoured once again.

It would be an excellent idea to implement draw_text_line.  You should
then be able to drop draw_text entirely and have draw_string call
draw_text_line like in diagdkrenderer.

The old Metapost export code had issues with precise vertical
placement of text.  This was due to the fact that the Metapost text
writing command used aligned according to the bounding box instead of
the text baseline.  Metapost does have a slightly lower level command
which could be used to fix this problem.  However, if you do so, you
must calculate the horizontal positioning yourself (left justified,
right, centered).  Now would probably be a good time to address this

(If this problem has already been addressed, I apologize for the noise)

I don't remember the exact details of the fix, but I've posted on it
before.  Search the archives for messages from me, or if you can't
find it, ask me and I'll look it up.

Thanks for everyone's work,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]