Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Desktop font size effects swt layout

Hi Kelly,

The adoption of the OS-specified fonts by the SWT Controls is correct.  Invoking setFont() on each Control should change their fonts accordingly, but there are various reasons that this is not the suggested approach to take.

Your use of SWT layouts should insulate you from variations like font size, assuming that you aren't hard-coding sizes/positions that should be left to compute their own optimal values.  Proper use of SWT Layouts should enable widget layouts to adapt not only to variations like font size, but also across platforms where the available fonts and widget sizing characteristics can differ significantly.

Without seeing example code snippets it's difficult to know why your use of layouts isn't doing this for you.  It may be worth having a look at http://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html , which describes the ideal uses of Layouts.  There are also various example Layout snippets at http://www.eclipse.org/swt/snippets/ .

If you these resources don't fully answer your questions then you can ask further on the SWT forum ( http://www.eclipse.org/forums/index.php?t=thread&frm_id=100 ), and if possible provide your own runnable code snippets that demonstrate your problems.

HTH,
Grant




From:        Kelly Wiles <kellywiles@xxxxxxxxxxxxx>
To:        platform-swt-dev@xxxxxxxxxxx,
Date:        01/22/2013 08:28 AM
Subject:        [platform-swt-dev] Desktop font size effects swt layout
Sent by:        platform-swt-dev-bounces@xxxxxxxxxxx




Hi

I have looked on Google but can not find answer or I can't word it correctly to find it.

When I develop a SWT application my computers desktop font size is set to windows 7 default size.
I use mainly use Form layout with Grid layout for some windows.

My problem is that when the program is run on a windows system and the user has increased the font size of the desktop my layouts are all messed up.
If I go into windows settings and reset the font back to the default size everything looks fine again.

I have tried using setFont on all the widgets but it does not effect this problem.

What can I do about desktop font size being changed from the default?

Thanks

--
AgileMesh, Inc
1761 International Parkway
Suite 113
Richardson, TX, 75081
Phone: 972-231-2122 x 310
Fax: 972-231-2406

www.agilemesh.com_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top