From: Ethan A M. <merritt@u.washington.edu> - 2006-12-23 00:12:11
|
On Thursday 21 December 2006 14:49, m sutton wrote: > > > > Do you have an actual demo bug that this patch fixes? > > The change is needed because PNG_put_text uses png_state.charh to > compute the position of text. The effect of this is most noticeable > when using a font different from the font used with 'set term png'. > The label should be centered vertically at 0. > Without the fix the bottom of the label is just a hair below zero. I am going to have to think about this for a while. I am not sure that your expectations for vertical centering are matched by core code. If nothing else, I can easily demonstrate that the postscript driver exhibits the same effect, and always has. Consider this script, run through either 4.0 or the current cvs code. In the t1 case the terminal is opened with a small default font, while in the t2 case it is opened with a large default font. Then a single large-font "f+g" is printed at the origin. Only the t2 case comes out vertically centered. ################################################ set label 1 "f+g" at 0,0 font "Times,30" center set grid back set format xy "" plot sin(x) # set term post solid color eps font "Times,3" set output 't1.eps' replot # set term post solid color eps font "Times,30" set output 't2.eps' replot # set term post solid color eps font "Times,3" enhanced set output 't3.eps' replot # set term post solid color eps font "Times,30" enhanced set output 't4.eps' replot ################################################ On the other hand, putting the terminal into enhanced text mode (t3,t4) changes the behaviour to be more like your patched png terminal. That may be what we want, but if so there is more to it than patching gd.trm -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |