From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue May 23 2006 - 13:59:41 CDT

Hi,
  The "text" drawing command has a size parameter, but doesn't presently
provide a thickness parameter (i.e. a control over OpenGL line thickness),
though that would probably be easy to add:
  draw text { 0 0 0 } "foo" size 10

The font itself is a Hershey font, and it is actually compiled into the
VMD source code. Many years back, before it was ported to non-Unix platforms
VMD used to use X-Windows bitmap fonts. With the current interest in adding
dynamically changing text labels into VMD trajectory movies, it may be
worth revisiting the way VMD handles fonts in order to make things like
what you're doing easy to accomplish with simple scripts like the one
below (that's actually an example I wrote), rather than having to use
other software to add labels like these into movies. I'll add this to
the TODO list as a possibility. In the mean time I'm afraid you'll have
to use the built-in Hershey font as there's currently no alternative.

  John Stone
  vmd_at_ks.uiuc.edu

On Tue, May 23, 2006 at 02:40:02PM -0400, Gustavo Seabra wrote:
> Hi all,
>
> I am using a script to show a time label on the trajectory. It is a
> simple script that I got from an old post (sorry, don't remember the
> author) and modified just slightly. It works fine, but the text could
> be a bit better.
>
> My question is: Would anyone know how to make the font bold? and
> possibly how to change the font? I've been googling this for a while
> but still could not find anything that works.
>
> Thanks,
>
> Gustavo Seabra.
>
> ====================================
> Here is the script. If you want to try, notice that the text is being
> written in black, so use a light background (or change the text color
> here.)
>
> ###################################################################
> ## timestamp.tcl is a VMD script that adds a time label to the
> ## displayed structure.
> ##
> ## To use this script:
> ## 1) load your trajectory
> ## 2) source timestamp.tcl
> ## 3) enabletrace
> ## 4) do your thing :-)
> ## 5) disabletrace
> ##
> ## Remember to adjust the values of 'proc drawcounter' accordingly!
> ####################################################################
>
>
> proc enabletrace {} {
> global vmd_frame;
> trace variable vmd_frame([molinfo top]) w drawcounter
> }
>
> proc disabletrace {} {
> global vmd_frame;
> trace vdelete vmd_frame([molinfo top]) w drawcounter
> }
>
> proc drawcounter { name element op } {
> global vmd_frame;
>
> draw delete all
> # puts "callback!"
>
> ## Label text color
> draw color black
>
> ## number of ps per frame
> set psperframe 0.005
>
> ## Sets the 'time' (string with the time and units)
> set time [format "%8.3f ps" [expr $vmd_frame([molinfo top]) * $psperframe]]
>
> ## Finally, draw the text
> draw text {30 38 35} "$time" size 3
> }

-- 
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