Community
Participate
Working Groups
Most heavily discussed issue with M4 on all mailing lists: The fonts used in Tree/Tables (Navigator, Tasklist) are rather large and there seems to be no way to change them.
The current table and tree are the emulated ones and their font can already be changed through API. By default we are using the system default font which is what we do on all platforms. Isn't this a problem in the Eclipse UI that it does not give access to this capability? Usually, there is a way for the user to configure the system default font (.gtkrc, .Xdefaults, Control Panel ->Display Attributes). How do you do this on the Mac? In the absence of Eclipse UI access, this is how users are advised to modify the fonts. Also, the users can modify jfacefonts_macosx.properties files found in the jface.jar in plugins/org.eclipse.jface_2.1.0. I believe the relevant line is: org.eclipse.jface.defaultfont.0=Courier-regular-12 Perhaps this setting should be made smaller by default.
Yes, on Mac OS X it becomes a problem of the Eclipse UI because there seems to be now official UI for changing system fonts in Mac OS X (or am I missing something?). I will investigate what to do....
suggestion: OS X seems to have different "system fonts" for different purposes. There is the System Font (Lucidia Grande 13) that is used for menus and window titles, and then there is the Application Font (Helvetica 12) that is used for labels and widgets. There is even a Fixed Font (Monacao 10). It seems Table/Tree should be using the Application Font. Would SWT support such a notion?
Consider for 2.2.
There is a simple fix to get at least Eclipse to display fonts at reasonable sizes (roughly the same size that all the other platforms use). http://www.prnet.de/RegEx/eclipse.txt It sets the default display to OS.SmallSystemFont and removes the special handling of tree, combo and table widgets. There is still too much space left around the items but at least you can view more than a few items in the UI.
Please change the default font discovery to go through some bottleneck. I'd propose to put it into org/eclipse/swt/graphics/Device.java as a new method int getDefaultFont() and this should return either OS.kThemeSystemFont or OS. kThemeSmallSystemFont settable via some default. This time, I have included all changes needed to have a consitent font size thoughout all the SWT controlled classe and I would be very gratefuly if you could apply it. The general behaviour will stay the same unless a "SWTUsesSmallFonts" default is set to the value "true", so there is applying this fix will not impair other SWT apps in the least. On OSX, Eclipse´s usefulness is very much impaired due a a few interface bugs - like too-large fonts and menu bar oddities and as this is a very small fix I'd really wish for you to integrate it. diff -r -c3 swtsrc_2/org/eclipse/swt/graphics/Device.java swtsrc_3/org/eclipse/swt/graphics/ Device.java *** swtsrc_2/org/eclipse/swt/graphics/Device.java Thu Mar 27 10:51:48 2003 --- swtsrc_3/org/eclipse/swt/graphics/Device.java Sun May 18 23:12:40 2003 *************** *** 492,511 **** COLOR_MAGENTA = new Color (this, 0xFF,0,0xFF); COLOR_CYAN = new Color (this, 0,0xFF,0xFF); COLOR_WHITE = new Color (this, 0xFF,0xFF,0xFF); ! /* Initialize the system font slot */ ! short id = OS.GetAppFont(); ! short style = (short)0; ! short size = OS.GetDefFontSize(); ! int[] font = new int[1]; ! if (OS.FMGetFontFromFontFamilyInstance(id, style, font, null) != 0) { ! SWT.error(SWT.ERROR_NO_HANDLES); ! } ! systemFont = Font.carbon_new (this, font[0], id, style, size); } ! /** ! * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Device</code>. It is marked public only so that it --- 492,541 ---- COLOR_MAGENTA = new Color (this, 0xFF,0,0xFF); COLOR_CYAN = new Color (this, 0,0xFF,0xFF); COLOR_WHITE = new Color (this, 0xFF,0xFF,0xFF); + + systemFont = getDefaultFont(); ! } ! /** ! * @return default base font used by all widgets. ! */ ! protected Font getDefaultFont() { ! Font defaultFont = null; ! ! if("true".equals(System.getProperty("SWTUsesSmallFonts"))) { ! /* Initialize the system font slot */ ! short id = OS.GetAppFont(); ! short style = (short)0; ! short size = OS.GetDefFontSize(); ! int[] font = new int[1]; ! if (OS.FMGetFontFromFontFamilyInstance(id, style, font, null) != 0) { ! SWT.error(SWT.ERROR_NO_HANDLES); ! } ! defaultFont = Font.carbon_new (this, font[0], id, style, size); ! } else { ! /* Initialize the system font by using the default small font */ ! byte [] family = new byte [256]; ! short [] size = new short [1]; ! byte [] style = new byte [1]; ! OS.GetThemeFont ((short) defaultThemeFont (), (short) OS.smSystemScript, family, size, style); ! short id = OS.FMGetFontFamilyFromName (family); ! int [] font = new int [1]; ! OS.FMGetFontFromFontFamilyInstance (id, style [0], font, null); ! defaultFont = Font.carbon_new (this, font [0], id, style [0], size [0]); ! } ! return defaultFont; ! } ! ! /** ! * Bottleneck routine for all the default fonts. ! * @return default theme font used by all widgets (should be small system font because all the others are too large on OSX). ! */ ! public int defaultThemeFont () { ! return OS.kThemeSmallSystemFont; } ! /** ! * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Device</code>. It is marked public only so that it diff -r -c3 swtsrc_2/org/eclipse/swt/widgets/Control.java swtsrc_3/org/eclipse/swt/widgets/ Control.java *** swtsrc_2/org/eclipse/swt/widgets/Control.java Thu Mar 27 10:52:36 2003 --- swtsrc_3/org/eclipse/swt/widgets/Control.java Sun May 18 23:11:22 2003 *************** *** 490,497 **** return display.getSystemColor (SWT.COLOR_BLACK); } ! int defaultThemeFont () { ! return OS.kThemeSystemFont; } void deregister () { --- 490,497 ---- return display.getSystemColor (SWT.COLOR_BLACK); } ! int defaultThemeFont () { ! return getDisplay().defaultThemeFont(); } void deregister () { diff -r -c3 swtsrc_2/org/eclipse/swt/widgets/Table.java swtsrc_3/org/eclipse/swt/widgets/ Table.java *** swtsrc_2/org/eclipse/swt/widgets/Table.java Tue Mar 11 18:38:28 2003 --- swtsrc_3/org/eclipse/swt/widgets/Table.java Sun May 18 22:14:51 2003 *************** *** 330,339 **** return display.getSystemColor (SWT.COLOR_LIST_FOREGROUND); } - int defaultThemeFont () { - return OS.kThemeViewsFont; - } - /** * Deselects the item at the given zero-relative index in the receiver. * If the item at the index was already deselected, it remains --- 330,335 ---- diff -r -c3 swtsrc_2/org/eclipse/swt/widgets/Tree.java swtsrc_3/org/eclipse/swt/widgets/ Tree.java *** swtsrc_2/org/eclipse/swt/widgets/Tree.java Thu Apr 24 12:22:24 2003 --- swtsrc_3/org/eclipse/swt/widgets/Tree.java Sun May 18 22:14:23 2003 *************** *** 326,335 **** return display.getSystemColor (SWT.COLOR_LIST_FOREGROUND); } - int defaultThemeFont () { - return OS.kThemeViewsFont; - } - /** * Deselects all selected items in the receiver. * --- 326,331 ----
Created attachment 6136 [details] Reduces the theme font size to use kThemeSmallSystemFont The font size for the tree and table items in the main window is way too large. Especially on an iBook, there is hardly any space left for the code. This patch adds a new method defaultThemeFont() on Display, reduces the overall font size to use the small system font and instructs tables and tree to also use it. So defaultThemeFont() is now a bottleneck that could easily be modified to check a system default that restores the previous behaviour. Please apply this patch. There are numerous bug reports about the font size being to big and they have been outstanding a long while now.
Thanks for the patch. Could you please create the patch with Eclipse's Create Patch command? You can find it in the Navigator's context menu under "Team > Create Patch..." It will result in a patch that doesn't use absolute path names and is easier to apply.
Created attachment 7276 [details] Patch for SWT Re-packaged patch to be used via "Apply patch..." Looks much better! I would even say that screen estate utilisation matches windows with this patch.
Cool! The first useful Christmas present... :-)
*** This bug has been marked as a duplicate of 56558 ***