Hi Bob,
I did a few tests on revision 8957 from SVN.
The font scaling with zoom and window resize seems to work very well and
really is a big improvement!
Two points I noticed:
1) The axes labels did not scale.
2) The initial font size was not identical for all labels. Although I
didn't change the default font size and all labels were attached to
alpha carbon atoms some of them had only about half the size than
others. While scaling this difference was preserved.
The label section of the state and 2 example labels looked like this:
# label defaults;
select none;
color label none;
background label none;
set labelOffset 4 4;
set labelAlignment left;
set labelPointer off;
font label 13.0 SansSerif Plain;
...
select ({3952});
label " TOPOISOMERASE_I_EUK :%c";
select ({1593});
label " Exon 1.13 :%c";
...
The "TOPOISOMERASE_I_EUK" label was about twice as big as the "Exon
1.13" label.
Regards,
Rolf
Bob Hanson wrote:
> 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
>
>
>
-------------------------------------------------------------------------
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