Is there any way to use the native Xojo font options inside of a custom plugin?
For example, I have a property called TextFont and it appears in the proper section in the Inspector. However, as opposed to the drop-down list of fonts that Xojo native controls produce, I simply have a text input to write in the value.
Thanks for the quick reply. I understand how to find the current font inside of standard functions and methods. I’m trying to find out if it’s specifically possible to replicate the font options in the Inspector for a custom plugin.
I have a custom plugin I’ve written. It’s a control and it allows the end user to adjust the font used, text size, etc. Similar to many of the baked in Xojo controls.
Xojo handles the presentation of these attributes with a very clean editor in the Inspector. There is a dropdown menu for all available font choices, an input for the text size, checkboxes for bold and italic, etc.
It is unclear if there is a way to frame my properties of TextFont, TextSize, etc in a way that will allow the Inspector to take control of those values with the Inspector’s Font Editor (picture 2)
Public Property TextSize as Integer
Public Property Bold as boolean
Public Property Italic as boolean
Public Property TextFont as String
Public Property TextUnit as FontUnits
Public Property Underline as boolean
And that in your property definitions you put them all in a group named “Font”
That should be all you need
Bold, Italic and Underline ( ) are no more styles (on macOS, I do not know for Linux and Windows): you have to have these fonts to be able to use them.
They usually appears as:
Times The regular Font
Times-Bold The regular Font in Bold
Times-Italic The regular Font in Italic
Times-Underline The regular Font in Underline