Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>createfont()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CreateFont()
Makes a new font
------------------------------------------------------------------------------

Syntax
CreateFont( <aFont> )   -->   hFont

Arguments
<aFont> is an array specifying the characteristics of the new
font.  This array must have 14 elements.  (The purpose of each
element is indicated by the LF_* values defined in FONT.CH.)

Returns
If successful, a handle to the new font is returned (a non-
zero numeric).  Otherwise, zero is returned.

Description
This function can be used to create an application-specific
font.  As fonts are rather complex to design, you are
recommended to use the ChooseFont() function to fill in the
<aFont> array.

Any font created must be freed using the DeleteObject()
function.

Example
aFont = array(14)
aFont[ LF_FaceName ] = "Arial"
aFont = ChooseFont( aFont, , , @nColour )
if aFont != nil
     hFont = CreateFont( aFont )
     if hFont != 0
          // use the font and/or colour
          // . . .
          // when done, de-select the font using SelectObject()
     endif
     DeleteObject( hFont )
endif


See Also: ChooseFont() DeleteObject()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson