An addition to the bug "2. Zoom: no zooming effect on node editors"

http://sourceforge.net/tracker/?func=detail&aid=2800933&group_id=7118&atid=107118

> I tried, but this bug isn't easy to fix IMHO. Perhaps in a future  version
of SimplyHTML.

This has nothing to do with the version of SimplyHTML. This has to do with
how SimplyHTML is called from FreeMind. I am using basically the same
version of SimplyHTML, yet in my FreeMind the fonts are shown in SimplyHTML
zoomed correctly.

The critical part is the following one in the class "EditNodeWYSIWYG":

            Font font = node.getTextFont();
  191 //            font = Tools.updateFontSize(font,
this.getView().getZoom(), font.getSize());
  192             final Color nodeTextBackground = node.getTextBackground();
  193             rule += "font-family: "+font.getFamily()+";";
  194             rule += "font-size: "+font.getSize()+"pt;";

Here, it matters that the font added to the style rules is the zoomed one.

What I have in my FreeMind is the following:

rule += "font-size: "+node.getFont().getSize()+"pt;";

I call "node.getFont" instead of "node.getTextFont()", where "node" is a
NodeView.

node.getFont is the native method of the JLabel, which returns the font in
which JLabel is actually shown; this should be already zoomed. By contrast,
"node.getTextFont()" is likely a method that returns the non-zoomed font of
nodeview.

So the first thing I would try is to replace "node.getTextFont()" with
"node.getFont()".

If that won't work, you can adjust the font in the code for zooming using
the following code snippet, presuming you have a reference to "map":

 if (map.getZoom() != 1F) {
                font = font.deriveFont(font.getSize()*map.getZoom()); }

--Dan
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Freemind-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemind-developer

Reply via email to