Jmol Developers -- I need testers. I have uploaded 11.5.4 code that
(1) allows for the fonts in labels and 3D echos to scale with zoom and
window resizing, and
(2) generates proper-sized fonts when an image is created at a different
size than the current window.
This was rather tricky to implement, and I'm not convinced it is
correct. But here is the basic idea:
1) Use
set fontScaling TRUE
to initiate font scaling for labels and 3D echo text. This does not
affect any labels or echo text already in place, and it does not affect
2D echo text at all.
Now zoom to some desired level and create a label or 3D echo:
select atomno=1;label
set echo myecho {1 1 1};echo "testing"
Now zoom some more. You should see the fonts scaling properly.
Resize the window. The fonts should scale.
Use
write image 1000 1000 t.jpg
to create an image. Check it -- the fonts should be scaled properly.
Items to check include axes, unitcells, MO titles, quaternion frame
titles -- anything with text.
Note that because the fonts have to appear the way they always would
before, we have to use the same notation as before for indicating fonts.
(I've expanded that to fractional points, though.) And because fonts
have to scale, there is a "reference" scale for them. This reference is
based on the scale of the display, in Angstroms per pixel. This allows
fonts rendered in one window size to appear scaled properly when the
window size is scaled. The value of this reference is calculated
automatically when you introduce a label or 3D echo, and it is saved in
the state. You can see it by using
show state
In which case you will see something like this:
select ({0});
label "%e%i";
font label 20.0 Serif Plain;
set labelScaleReference 0.02;
and
set echo myecho2 {2.0 2.0 2.0}; echo "XX";
font echo 12.0 Serif Bold 0.01;
The number 0.02 indicated as a labelScaleReference and the number 0.01
at the end of the font command are the scale references, in Angstroms
per pixel. The larger this number, the larger the font. You can change
this number on the fly to set the font scaling to anything you want.
Roughly, the letter "X" of a font of scale 10.0 with a scale reference
of 0.1 will by about 1 Angstrom tall at all zoom levels.
The tricky part of all this was that I had to completely rewrite how
antialiasing of display and images affected font size. So that needs
thorough testing. You will notice some slight changes when you resize a
window. This is because the fonts are scaled in 0.1-point increments.
Also tricky was getting the background boxes and offsets correct. Please
test these, and if you see anything odd, let me know.
I'm also concerned about memory with all these extra fonts. So be on the
alert for slower processing or large memory usage.
Navigation mode is a bit odd -- the way that works is that the screen
scale is fixed, and the model passes through it. So there if navigation
mode is set, then fonts do not scale. It probably suggests I need an
additional scaling based on distance from the plane of the observer in
that case, but I'm not there yet, and I really don't know how to do that
yet.
Bob
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers