# Font

Font functions.

Summary

Font | Font functions.
Font | Creates the font and optinally, sets it for the control.
DrawText | Draws text using specified font on device context or calculates width and height of the text.
About |

### Font

> Font( | HCtrl | = | "",
> | Font | = | "",
> | BRedraw | = | 1 | )

Creates the font and optinally, sets it for the control.

#### Parameters

hCtrl | Handle of the control. If omitted, function will create font and return its handle.
Font | AHK font defintion (“s10 italic, Courier New”). If you already have created font, pass its handle here.
bRedraw | If this parameter is TRUE, the control redraws itself. By default 1.

#### Returns

Font handle.

### DrawText

> Font_DrawText( | Text, |  |
> | DC | = | "",
> | Font | = | "",
> | Flags | = | "",
> | Rect | = | "" | )

Draws text using specified font on device context or calculates width and height of the text.

#### Parameters

Text | Text to be drawn or measured.
DC | Device context to use. If omitted, function will use Desktop’s DC.
Font | If string, font description in AHK syntax. If number, font handle. If omitted, uses the system font to calculate text metrics.
Flags | Drawing/Calculating flags. Space separated combination of flag names. For the description of the flags see http://msdn.microsoft.com/en-us/library/ms901121.aspx.
Rect | Bounding rectangle. Space separated list of left,top,right,bottom coordinates. Width could also be used with CALCRECT WORDBREAK style to calculate word-wrapped height of the text given its width.

#### Flags

CALCRECT, BOTTOM, CALCRECT, CENTER, VCENTER, TABSTOP, SINGLELINE, RIGHT, NOPREFIX, NOCLIP, INTERNAL, EXPANDTABS, AHKSIZE.

#### Returns

Decimal number. Width “.” Height of text. If AHKSIZE flag is set, the size will be returned as w%w% h%h%

### About

- Version 1.0 by majkinetor.
- Licensed under BSD http://creativecommons.org/licenses/BSD/.

> Font( | HCtrl | = | "",
> | Font | = | "",
> | BRedraw | = | 1 | )

Creates the font and optinally, sets it for the control.

> Font_DrawText( | Text, |  |
> | DC | = | "",
> | Font | = | "",
> | Flags | = | "",
> | Rect | = | "" | )

Draws text using specified font on device context or calculates width and height of the text.
Close