#1197 postscript terminal: bad vertical centering of text

Ethan Merritt

The postscript terminal currently sets an offset used for vertical centering of text only once, in the prolog:
\vshift -<foo> def
This shift is only approximate to begin with and is not adjusted later when the current font changes.

Possible fix (quick-and-dirty): overwrite the vshift definition every time the font is changed using the same approximation used currently.
Better fix: re-write the Lshow/Rshow/Cshow commands to query the current font from inside the PostScript engine rather than using vshift.


  • I have been thinking about this for a while.

    The two possibilities I see for querying the current font are:

    1. Use the font bounding box for centering.

    This might not fit the current string.

    1. Extract the metrics of all glyphs in the string.

    How should the vertical centering be done? Using the lowest height, or the largest height, the median, ...?

    For Latin fonts I would correct by the half of the lowest height (with respect to the base line). But I don't know if this would also fit cyrillic, japanese and other fonts.

    If I find some time, I could come up with a proposal patch.