| Customize Help
| Save Settings

MgraFont



Function Map
Synopsis
Associate a text font with a 2D graphics context.
Syntax
void MgraFont(
MIL_ID ContextGraId, //in
MIL_INT64 FontName //in
)
Description

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

To change the font for graphics already added to a 2D 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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextGraId

Specifies the identifier of the 2D 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 2D graphics context
Click to summarizeValue Description
Click to summarize M_DEFAULT

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

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

(summarize)
Click to summarize MIL 2D graphics context identifier

Specifies a valid 2D 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
Click to summarizeValue Description
Click to summarize
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.

Click to summarize M_FONT_DEFAULT

Same as M_FONT_DEFAULT_SMALL.

Click to summarize M_FONT_DEFAULT_LARGE

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

Click to summarize M_FONT_DEFAULT_MEDIUM

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

Click to summarize 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