| MIL 10 Reference
| Customize Help
| Save Settings

MgraFont



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Associate a text font with a graphics context.
Syntax
void MgraFont(
MIL_ID ContextGraId, //in
MIL_INT64 FontName //in
)
Description

This function associates a character font with the specified graphics context for use with subsequent MgraText() function calls.

To change the font for graphics already added to a graphics list, use MgraControlList().

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextGraId

Specifies the identifier of the graphics context with which to associate the character font. This parameter must be set to one of the following values:

function map For specifying the graphics context
CollapseValue Description
Collapse M_DEFAULT

Specifies that the default graphics context of the current MIL application is used.

Note that there is a different default graphics context for each thread.

(summarize)
Collapse MIL graphics context identifier

Specifies a valid graphics context identifier, which you have allocated using MgraAlloc().

FontName INQ

Specifies the font with which to write text. This parameter can be set to one of the following:

function map For specifying the font
CollapseValue Description
Collapse
MIL_FONT_NAME(
MIL_TEXT_PTR * Font
)

Specifies the font. In this case, MgraText() will use TrueType and Unicode features to draw text. This allows you to draw text using different sizes and TrueType fonts installed on your computer. This also allows you to draw any Unicode text (depending on the font).

(summarize)
Parameters

Specifies either a font and its features or a path to a font.

M_FONT_DEFAULT_TTF

Specifies the default TrueType font of your operating system.

MIL_TEXT("FontFamily:Weight:Slant") 1

Specifies the font according to the following format, Family: Weight: Slant.

Family must be set to the name of the font's family, such as Arial, Times New Roman, and Wingdings.

Weight can be set to one of the following: Book, Thin, ExtraLight, UltraLight, Light, Normal, Regular, Medium, SemiBold, DemiBold, Bold, ExtraBold, UltraBold, Heavy, Black, ExtraBlack, or UltraBlack.

Slant can be set to one of the following: Italic, Oblique, or Roman.

You can omit Weight and Slant; also, you can provide the Weight and Slant in any order.

MIL_TEXT("FontFile") 1

Specifies a full path to a TrueType file name.

Collapse M_FONT_DEFAULT

Same as M_FONT_DEFAULT_SMALL.

Collapse M_FONT_DEFAULT_LARGE

Specifies a large bitmap font, where each character is drawn in a 16x32 pixel area.

Collapse M_FONT_DEFAULT_MEDIUM

Specifies a medium bitmap font, where each character is drawn in a 12x24 pixel area.

Collapse M_FONT_DEFAULT_SMALL

Specifies a small bitmap font, where each character is drawn in a 8x16 pixel area.

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT FONT DEFAULT TTF FONT DEFAULT FONT DEFAULT LARGE FONT DEFAULT MEDIUM FONT DEFAULT SMALL