VMD-L Mailing List
From: Gustavo Seabra (gustavo.seabra_at_gmail.com)
Date: Tue May 23 2006 - 13:40:02 CDT
- Next message: John Stone: "Re: How to make bold font?"
- Previous message: John Stone: "Re: change default drawing and coloring method"
- Next in thread: John Stone: "Re: How to make bold font?"
- Reply: John Stone: "Re: How to make bold font?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
}
- Next message: John Stone: "Re: How to make bold font?"
- Previous message: John Stone: "Re: change default drawing and coloring method"
- Next in thread: John Stone: "Re: How to make bold font?"
- Reply: John Stone: "Re: How to make bold font?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]