Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Scaling fonts in draw2d Graphics


I think a graphics.dispose() method will be required for Font disposal.  A workaround for WSWB might be to launch a runnable on the Display with a timeout of 2 seconds or so.  Then have that runnable dispose the Fonts, and reset a "clean" flag.  If for some reason you new up another font after 2 seconds on the same Graphics object (unlikely), launch another "cleanup" runnable.

I think we will get rid of the font-metric methods on Graphics.  There is now way to obtain a Graphics during layout, so these methods are not useful.  Equivalent methods can be found on FigureUtilities.  Obviously this doesn't affect you on WSWB, but you can assume that none of the default draw2d Figures will call those methods, and leave out the implementation in your scaled graphics.

-Randy Hudson



"Tomas Pinos" <tomas.pinos@xxxxxxxx>
Sent by: gef-dev-admin@xxxxxxxxxxx

10/17/2002 04:12 PM
Please respond to gef-dev

       
        To:        <gef-dev@xxxxxxxxxxx>
        cc:        
        Subject:        Re: [gef-dev] Scaling fonts in draw2d Graphics

       


We use WSWB GEF (still the "old" one, with com.ibm.etools package names).
How (~ when and where) do you want to handle the releasing of the resources for the scaled font? I introduced "Graphics.dispose" method for that purpose.
And how about the question with font-metrics, which you asked a while ago. Have you made up your mind already?

Thanks for the code, hopefully I'll check it at the weekend. What more do you plan to add there?

Regards,
Tomas Pinos

----- Original Message -----
From: Randy Hudson
To: gef-dev@xxxxxxxxxxx
Sent: Thursday, October 17, 2002 4:11 PM
Subject: Re: [gef-dev] Scaling fonts in draw2d Graphics


I'm assuming this is possible.  You could always ask the SWT folks.

I have a scaled graphics class already.  I just released it in the org.eclipse.draw2d.test project.  It isn't complete yet, but I am handling Font scaling.  I still need to manage and release the OS resource for the scaled font.  Are you developing on Eclipse GEF or WSWB GEF?  Would you like to contribute to this class' implementation?


-Randy Hudson



"Tomas Pinos" <tomas.pinos@xxxxxxxx>
Sent by: gef-dev-admin@xxxxxxxxxxx

10/17/2002 04:44 AM
Please respond to gef-dev

       
       To:        <gef-dev@xxxxxxxxxxx>

       cc:        

       Subject:        [gef-dev] Scaling fonts in draw2d Graphics


     



Hi,

I'm currently implementing scaling (~ zooming) for our diagram editor and
I'd like to ask how to handle the fonts. Randy tried to discuss some
"advanced" features like greeking, I have rather basic question.

How to scale a font?

Now I read the font data, scale the font height and create a new font with
the scaled height (if I haven't done it already). Is it possible to do this
for any font? If not, how else should I proceed?

Thanks,
Tomas


_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/gef-dev



Back to the top