Segoe UI Font

running the tool gives this:

System look and feel: com.apple.laf.AquaLookAndFeel
Current look and feel: [Aqua Look and Feel for Mac OS X - com.apple.laf.AquaLookAndFeel]
LookAndFeel set to system
MenuItem.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
Menu.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
RadioButtonMenuItem.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
CheckBoxMenuItem.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=14]
ComboBox.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
RadioButton.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
CheckBox.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
Button.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
Label.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
TabbedPane.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
Panel.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
TitledBorder.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
List.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=12]
Table.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=12]
TableHeader.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=11]
Tree.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=12]
TextArea.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
PasswordField.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]
TextField.font: com.apple.laf.AquaFonts$DerivedUIResourceFont[family=Lucida Grande,name=Lucida Grande,style=plain,size=13]

Johan, I believe your point, why this is changed, (although we could discuss, if this should happened in a minor release, but oke…)
but the problem is, that it is MUCH reflecting our solution L&F

So giving us a property where we can set this, makes us all happy! :)

yes that gives me the result that i thought, Apple has by default bigger fonts and especially for the menu items…
And i just looked a bit closer, and the change for the mac is that we don’t do anything, by default the apple look and feel defines the fonts (so what you see in your output there is what by default the mac uses)
So the question is what should i do for the mac by default? I can change it that we take the Table.font (so point 12) and set that one for everything
What is the best point size for that Lucida Grande font that looks quite nice on the mac, and is not that alien on the mac? (so it does still blend in quite nicely?)
I see a couple of options Menu.font is 14 which is to big, Label.font is 13, Table.font is 12 and then we also have TableHeader.font which is 11 (which i think is to small to set as default for everything)

So what is the best default option for the mac? 13 or 12?
Then i can do the same as i do now on windows and that is take one of the default set fonts (the best one on windows is the menuitem.font) and use that for everything,
so i can do the same for the mac, take one Table.font for example and use that one for everything.

To override everything currently you can do this, with this script you can control every default font there is just create the fonts as you like.

function setDefaultFont()
{
	var uiDefaults = Packages.javax.swing.UIManager.getDefaults();
	var font = new Packages.javax.swing.plaf.FontUIResource("Tahoma",0,11);
	uiDefaults.put("MenuItem.font", font);
	uiDefaults.put("Menu.font", font);
	uiDefaults.put("RadioButtonMenuItem.font", font);
	uiDefaults.put("CheckBoxMenuItem.font", font);
	uiDefaults.put("ComboBox.font", font);
	uiDefaults.put("RadioButton.font", font);
	uiDefaults.put("CheckBox.font", font);
	uiDefaults.put("Button.font", font);
	uiDefaults.put("Label.font", font); 
	uiDefaults.put("TabbedPane.font", font);
	uiDefaults.put("Panel.font", font);
	uiDefaults.put("TitledBorder.font", font);
	uiDefaults.put("List.font", font);
	uiDefaults.put("Table.font", font);
	uiDefaults.put("TableHeader.font", font);
	uiDefaults.put("Tree.font", font);
	uiDefaults.put("TextArea.font", font);
	uiDefaults.put("PasswordField.font", font);
	uiDefaults.put("TextField.font", font);
	
	var frames = Packages.java.awt.Frame.getFrames();
	for(var i=0;i<frames.length;i++)
	{
		Packages.javax.swing.SwingUtilities.updateComponentTreeUI(frames[i]);
	}
}
  1. Style sheets can’t be applied to beans. Legacy issue that could have used improvement a long time ago in my opinion.
  2. Some beans don’t even have a design-time font property exposed much less allow you to change programmatically.
  3. Tree view bean can’t change font programmatically (bug report filed). So no way for us to match it up to our style sheet fonts for a particular operating system (and user setting which we can discover). But fixing #1 would even be better.
  4. Popup menu plugin can’t set the font at design time or as a preference or functionally. Can only set font with html per individual menu item.
    4.1) You cannot set font size with html to popup menu items, you can only adjust relatively (+1, +2, -3, etc). So setting a font size in the popup menu plugin to match your solution is hacky as hell: figure out the user’s system font/size setting, compare to what size you need it to be, apply relative font size adjustment to every popup menu item in your entire solution individually, and hope you’re close.
    4.bonus) While we’re only popup menu issues, assigning tooltips to popup menu items broke at some early version of Servoy 5.

Hi David,

Some feedback:
1: As of Servoy 6 the API for plugin/beans have access to the Stylesheet of the Form they’re on, so creators of beans can start supporting CSS styling on their beans. The beans we provide will utilize this extended API offcourse
2: If you are talking about beans we provide (DBTreeView, DBTreeTableView, Treeview), please register the relevant cases for it.
3: As there’s already a bug report filed, it’ll be looked at.
4: Have you registered a case for this already?
4.1: Have you registered a case for this already?
4.bonus: Have you registered a case for this already?

Paul

Yes, Lucida Grande is the system font.

Regards,

david:
Servoy Developer on Mac 10.5.8. So Lucida Grande is the system font I’m pretty sure.

Johan

Where do you get the idea from that Tahoma is a Windows font? What do you mean by Windows font? See links below

List of fonts included by default in Mac OS X:

http://en.wikipedia.org/wiki/List_of_ty … h_Mac_OS_X

I remember having used this font back in the old Mac OS 9, 8, 7 days, but I am not sure any more how they came into the Mac fonts foleder then …

Regards,

jcompagner:
But tahoma is a windows font, on which font did it map then for osx?
So currently what you have now is exactly what people also see in all other apps on osx?
Weird thing is that if servoy did change the font for the mac to something that is not the default when setting Tahomo,11 (thats really a windows XP font) then osx does map that on something and that something could also display japanese chars.
That we did set it in the first place was just a bug… We shouldnt have set Tahoma on the mac, Servoy shouldnt dictate fonts over different os.
That we did set it was purely because Kunstoff look and feel, displayed fonts in bold… thats the only reason back then.

What does the preferences say now (or previously) when you open the look and feel preference panel in the client?

I attached a picture of my setup, left is Segoe right is Tahoma, you see there is a little bit difference, the Seqoe is just a bit sharper,darker and a little bit bigger (but you only see that when you are really comparing)

Robert Huber:
Johan

Where do you get the idea from that Tahoma is a Windows font? What do you mean by Windows font? See links below

http://www.fontco.com/font-facts/tahoma.php

Tahoma was created and made by MS. Maybe now other os also include it but back then it was really a windows font.
It was created i guess to be the XP’s default font.

Thanks for the info Johan, regards,

jcompagner:

Robert Huber:
Johan

Where do you get the idea from that Tahoma is a Windows font? What do you mean by Windows font? See links below

http://www.fontco.com/font-facts/tahoma.php

Tahoma was created and made by MS. Maybe now other os also include it but back then it was really a windows font.
It was created i guess to be the XP’s default font.

jcompagner:
To override everything currently you can do this, with this script you can control every default font there is just create the fonts as you like.

Thanks for this code snippet. It works well. A couple of comments:

1- This function must be called in the solution’s onOpen method. Or at least before any forms are loaded that have splitpane beans on them (bordering for splitpane is reset to default). An added benefit of calling it in the onOpen is that any styles you may have applied to your form are still considered.
2- For the real menu bar, if items are added after the font function is called, they retain the system font.[attachment=0]window fonts.png[/attachment]
3- Styles are the way to go. So I’m only using the font function for the things that can’t be controlled with styles yet. On a Mac, the following are what I have found to be the necessary UI defaults: Menu.font, MenuItem.font, CheckBoxMenuItem.font, RadioButtonMenuItem.font, Label.font (to set the status area font), List.font (needed for checkboxes), TableHeader.font, Tree.font. YMMV, depending on your use of styles.

yes the best thing to do is do it in the on open

That stuff that are added after the font function is called are still wrong is very weird
Because what you do with that function is override/set the system font (its exactly the same code that we do…)
So somehow the font is set differently, need to check it out.

EDIT: found it, those menu items are all pre generated for forms that have show in menu enabled (default all in developer), but not in the menu at the time we call that updateUI()
So for you in the client this is not really a problem because as far as i see you dont have many forms enabled to show in the menu?

EDIT2: fixed it. Made sure that those menu items are updated when used.

jcompagner:
So for you in the client this is not really a problem because as far as i see you dont have many forms enabled to show in the menu?

Correct. We have one form enabled to show.

pbakker:
1: As of Servoy 6 the API for plugin/beans have access to the Stylesheet of the Form they’re on, so creators of beans can start supporting CSS styling on their beans. The beans we provide will utilize this extended API offcourse

Most excellent news.

pbakker:
2: If you are talking about beans we provide (DBTreeView, DBTreeTableView, Treeview), please register the relevant cases for it.
3: As there’s already a bug report filed, it’ll be looked at.
4: Have you registered a case for this already?
4.1: Have you registered a case for this already?
4.bonus: Have you registered a case for this already?

Done.

jcompagner:
To override everything currently you can do this, with this script you can control every default font there is just create the fonts as you like.

Johan, thank you sir. Fire up my work session this morning to find everything fixed. Really good stuff, cheers.

Johan,

Thanks for the default font method: function setDefaultFont()…it works great!

You may want to consider including this as a standard Servoy method.

troy:
On a Mac, the following are what I have found to be the necessary UI defaults: Menu.font, MenuItem.font, CheckBoxMenuItem.font, RadioButtonMenuItem.font, Label.font (to set the status area font), List.font (needed for checkboxes), TableHeader.font, Tree.font. YMMV, depending on your use of styles.

Addition: “Panel.font” sets the tree view bean font.

I placed a new article on http://www.servoycamp.com, today, with some more tips for tuning font’s and color’s

enjoy! :wink:

Possible to have a “popupMenu” object in style sheets?

Like field. or label. or tabpanel.

Example:

pluginsWindowPopup {
font-face:“Segoe UI”;
font-size: 10px;
}

pluginsWindowPopup.booger {
font-size: 12px;
}

– AND/OR –

function changeFont() {
plugins.pluginsWindowPopup.setFont(“Segoe UI”, “12px”);
}

Would format the pop-up menus how the developer wants ??

Same with other beans - the same idea? Bottom line: “ALLOW” the developer to handle what they want. Default = default (don’t care - as long as we can change it!)

Just my $0.02 worth…

Indeed, tuning everything in java is nice, but indeed styling standard objects, should be available in the CSS of Servoy self…

Coming with Servoy 6 if I’m reading Paul’s posts correctly.

pbakker:

  1. Style sheets can’t be applied to beans. Legacy issue that could have used improvement a long time ago in my opinion.

Hi David,

Some feedback:
1: As of Servoy 6 the API for plugin/beans have access to the Stylesheet of the Form they’re on, so creators of beans can start supporting CSS styling on their beans. The beans we provide will utilize this extended API offcourse

jcompagner:
To override everything currently you can do this, with this script you can control every default font there is just create the fonts as you like.

function setDefaultFont()

{
var uiDefaults = Packages.javax.swing.UIManager.getDefaults();
var font = new Packages.javax.swing.plaf.FontUIResource(“Tahoma”,0,11);
uiDefaults.put(“MenuItem.font”, font);
uiDefaults.put(“Menu.font”, font);
uiDefaults.put(“RadioButtonMenuItem.font”, font);
uiDefaults.put(“CheckBoxMenuItem.font”, font);
uiDefaults.put(“ComboBox.font”, font);
uiDefaults.put(“RadioButton.font”, font);
uiDefaults.put(“CheckBox.font”, font);
uiDefaults.put(“Button.font”, font);
uiDefaults.put(“Label.font”, font);
uiDefaults.put(“TabbedPane.font”, font);
uiDefaults.put(“Panel.font”, font);
uiDefaults.put(“TitledBorder.font”, font);
uiDefaults.put(“List.font”, font);
uiDefaults.put(“Table.font”, font);
uiDefaults.put(“TableHeader.font”, font);
uiDefaults.put(“Tree.font”, font);
uiDefaults.put(“TextArea.font”, font);
uiDefaults.put(“PasswordField.font”, font);
uiDefaults.put(“TextField.font”, font);

var frames = Packages.java.awt.Frame.getFrames();
for(var i=0;i<frames.length;i++)
{
	Packages.javax.swing.SwingUtilities.updateComponentTreeUI(frames[i]);
}

}

I’ve adjusted this function a bit to make it simpler and capture all ‘.font’ UIdefaults in one go:

function setDefaultFont()
{
	var uiDefaults = Packages.javax.swing.UIManager.getDefaults();
	var font = new Packages.javax.swing.plaf.FontUIResource("Tahoma",0,11);

	var keys = uiDefaults.keys();
	var key = null;

	while(keys.hasMoreElements()){
		key = keys.nextElement();
		if(utils.stringRight(key,5)=='.font'){	
			uiDefaults.put(key, font);
		}

}