From: John Stone (johns_at_ks.uiuc.edu)
Date: Sat Aug 12 2006 - 03:42:53 CDT

Hi,
  Taking this much further, I just spent a couple hours rewriting large
parts of the color scale bar plugin and it should work MUCH more nicely
now. The new version will let you format the labels in decimal or
scientific notation, will automatically "update" (e.g. delete
and recreate) any existing color scale, will autoscale or use user-supplied
range values, and it is now generally more robust. And of course, the
numbers are correctly justified and displayed with the updates I made
to the Hershey romans font used in VMD itself. I should mention that
the old color scale bar scripts also contain a couple of bugs relating to
the use of hard-coded color ID values, which will show up on VMD 1.8.5
since it provides a block of user-defined colors twice as large as older
versions did. The next VMD 1.8.5 beta build I do will include this new
version.

  John

On Sat, Aug 12, 2006 at 12:15:58AM -0500, John Stone wrote:
>
> I have just modified the Hershey romans font in VMD to give fixed
> with character spacing for the digits 0-9, ' ', and '.', which should
> cure this problem in VMD 1.8.5 and subsequent versions.
>
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Fri, Aug 11, 2006 at 11:15:27PM -0500, John Stone wrote:
> >
> > Hi,
> > I believe the root of the problem here is twofold:
> > 1) The Hershey font used by the "draw text" command is a proportional
> > font and not a fixed font, which means that the widths of the various
> > characters are slightly different, and thus even with justified text you
> > can get different spacings. In particular, the width of the "." and " "
> > characters differ from the width of the numeric characters. The numeric
> > characters are all the same, so we might be able to cure this by hacking
> > the Hershey font and modifying the width of the " " and "." characters
> > to match the width of the numbers in a future version of VMD.
> >
> > 2) The result of the format command isn't quoted, so the
> > spaces may be getting eliminated by Tcl. The format command
> > is indeed working correctly and is padding with spaces however.
> >
> > Of the two, 1) is the major problem. I'll see what I can do...
> >
> > John
> >
> > On Fri, Aug 11, 2006 at 07:38:38PM -0400, Yongcheng Zhou wrote:
> > >
> > > Dear folks,
> > >
> > > It seems that the color_bar plugin
> > >
> > > http://www.ks.uiuc.edu/Research/vmd/plugins/colorscalebar/
> > >
> > > can generate a color bar with right aligned numbers. However,
> > > with color_scale_bar_new.tcl, I can only generate a color bar
> > > with central aligned numbers.
> > >
> > > This is the command in this tcl file to `draw' numbers:
> > >
> > > draw text " $coord_x $coord_y $use_z" [format %6.2f $cur_text]
> > >
> > > If this was in C language, then the numbers will be right alignd by
> > > default. But it is not.
> > >
> > > Is is possible to change this tcl file to generage right aligned numbers?
> > >
> > >
> > > Thanks a lot.
> > >
> > > Yongcheng
> > >
> > > ----
> > > Zhou Yongcheng <zhouyon1_at_math.msu.edu>
> > > Department of Mathematics
> > > Michigan State University
> > > East Lansing, MI 48824
> >
> > --
> > NIH Resource for Macromolecular Modeling and Bioinformatics
> > Beckman Institute for Advanced Science and Technology
> > University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> > Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> > WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
>
> --
> NIH Resource for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078