Use the Light Version of a Font

How can I use the light version of a font? Say I want my label to be Helvetica Neue Light or “System Font” light?

This applies to Mac and PC.

Xojo uses the family name - not the individual font names
So short of using NSFont on OS X (and whatever else on Windows & Linux I dont think you’re going to find an easy way to get at it)

On Mac

HelveticaNeue Fonts

HelveticaNeue
HelveticaNeue-Medium
HelveticaNeue-Light
HelveticaNeue-Thin
HelveticaNeue-UltraLight
HelveticaNeue-Italic
HelveticaNeue-MediumItalic
HelveticaNeue-LightItalic
HelveticaNeue-ThinItalic
HelveticaNeue-UltraLightItalic
HelveticaNeue-Bold
HelveticaNeue-BoldItalic
HelveticaNeue-CondensedBold
HelveticaNeue-CondensedBlack

see more here

a version to see what’s available (OSX)
Fonts

Awesome Axel and thank you!

[quote=217163:@Stephen Dodd]How can I use the light version of a font? Say I want my label to be Helvetica Neue Light or “System Font” light?

This applies to Mac and PC.[/quote]

In xDev magazine 13.4, I talk about WWDC 2015 and include code for the new “El Capitan” function that allows you to get the system font of different weights. It is “El Capitan” only, but it’s a starting point.

http://www.xdevmag.com

Ah, perfect. So while I can’t assign it in the IDE, I can simply say

me.TextFont = “HelveticaNeue-Light” // Mac
me.TextFont = “Segoe UI Light” // PC

Thanks! :slight_smile:

Except this will only look correct on Yosemite, Mavericks and El Capitan both use different fonts (although I’m not sure that a normal user can tell the difference between Yosemite & El Capitan).

So, this will work correctly but won’t match the system default other than on Yosemite?

El Capitan uses San Francisco as default which isn’t available on older OS’s

Mavericks is Lucida Grande?

[quote=217358:@Stephen Dodd]So, this will work correctly but won’t match the system default other than on Yosemite?

El Capitan uses San Francisco as default which isn’t available on older OS’s

Mavericks is Lucida Grande?[/quote]
Correct, so if you grab the code from the magazine, you’ll see that I wrap up the function calls so that it’ll return the font of weight on El Capitan, the standard system font on Mavericks & Yosemite. At least this way, you’ll get the correct font on El Cap, and going forwards. Although to be honest the likelihood of them changing the system font again is minimal.

Thanks Sam!

Axel,

On macOS Sierra I can not uncompress the file “FontPopupN3.zip” :
I get “FontPopupN3.zip.cpgz” and nothing else…

Broking link ?

https://xojo.io/9499891b7c37

Thank you in advance.

That’s a corrupt zip file.

Greg:

change the file extension from zip to html and you will eventually understand.

The data inside the zip file are html (code), not zip archive data.

Emile,

You are right.
Thanks a lot for your help