[gl2ps] text alignment for ps/pdf

Christophe Geuzaine geuzaine at acm.caltech.edu
Sat Jul 10 23:35:06 CEST 2004


Micha Bieber wrote:

> Look for gl2psTextOpt and GL2PS_TEXT_C etc. in the gl2ps header. It's
> undocumented and not part of the official API. It might be still from
> some help for you. If you look for an example - my project at
> http://qwtplot3d.sf.net exploits the function.
> 

Actually, as Shai pointed out, gl2psTextOpt() currently only affects the 
alignment for LaTeX output.

The good news is that I already have the code to do the alignment stuff 
in PostScript as well in my development version. Does anyone know how to 
do the same stuff in PDF? In PostScript I use either the "stringwidth" 
function for TEXT_BL and TEXT_BC, or the less efficient "charpath 
flattenpath pathbbox" sequence for TEXT_C, TEXT_CL, TEXT_CR, TEXT_T, 
TEXT_TL, TEXT_TR.

Best,

Christophe


PS: Micha - do you use/need the color argument in gl2psTextOpt()?  Why 
not simply set the color the usual way using OpenGL? (If we decide to 
make gl2psTextOpt() public, I would prefer to remove it...)

-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org