Font Editor in custom plugin

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.

Any guidance would be appreciated.

Font names:
Font(index) As String
FontCount As Integer

That should give you font names, from the system.

You might be able to parse it to the plugin or handle it differently. Not sure if this help you for coding a Plugin .

Hey Derk,

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.

How it looks in the inspector now:

How I’d like it to be if possible:

you want to re-draw the IDE using a self coded plugin ?
Or do you want to make a Control using a Plugin for font selection?

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)

@Norman Palardy might have insight.

Yes you can
Make sure you have

   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

So, the “proposed” desing is wrong IMHO.

You should try it Emile
Subclass canvas
Add those properties
Make sure you reveal them in the property inspector in the group as I noted

Thank You Norman! I was missing the the TextUnit. This is fantastic!