Help with Different Fonts for Mac and Windows

I am new to the Xojo programming language.

Is it possible to have different fonts one for windows program and one for mac?
If this is possible, how would i code this?

Thanks in advance!

#If TargetMacOS then Label1.TextFont = "Helvetica" #ElseIf TargetWindows then Label1.TextFont = "Arial" #Endif

Thank you Michel.

Would I put this in the app open event?

[quote=430476:@Sam Ohlsson]Thank you Michel.

Would I put this in the app open event?[/quote]

Note I make reference to a control, Label1, which means it must exist to make reference to it. This code would fit nicely in a window Open event.

Note that in general, the default “system” font has been picked to render best on each platform. Unless you have definite reasons to pick a different font, System is the safest.

Thank you Michel

If you have a lot of same labels, it’s better to subclass it and add this to it on Open Event

in theory you should be able to use a constant in the TextFont property in the IDE itself