Older Newer
Thu, 18 Nov 2021 04:42:55 . . . . SyneRyder [Initial function definition]


Changes by last author:

Added:
= createFont =

Requires FilterMeister 1.0 Beta 9.1 (Feb 2009) or newer

== Syntax ==

bool createFont(int i, int size, bool bold, bool italic, char *fontname)

== Arguments ==

:i

::The index number of the font (from 0 - 31) to create.

:size

::The size (height) of the font, in logical units.

:bold

::Set to true if the font should be bold, false otherwise

:italic

::Set to true if the font should be in italics, false otherwise

:fontname

::Pointer to a string with the font name, as embedded in the font file

== Return ==

Returns true if creating the font succeeded, false otherwise.

== Description ==

Creates a font that can be used in your plug-in user interface with setCtlFont. The font must already be installed on the user's computer, so it is best to choose fonts that come installed with Windows. You can use up to 32 different fonts, and the fonts are deleted automatically when FM exits. if a font already exists at the given index number, it is deleted and replaced with a pointer to the newly created font.

== Comment ==

Behind the scenes, this function is mostly a wrapper around the [CreateFont] Win32 GDI API function.

== Example ==

<code>

%fml

// Create some text to display on the interface

ctl[10]: STATICTEXT, Size=(100, 40), Text="The Text Appears Here"

OnFilterStart: {

// Create font #1 as Segoe Print in height 40

createFont(1, 40, false, false, "Segoe Print");

// Set control #10 to use our newly created Segoe Print 40

setCtlFont(10, 1);

return true;

}

</code>

== See Also ==

:setCtlFont, setCtlFontColor, deleteFont