Skip to main content

MgraFont

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Associate a text font with a 2D graphics context.

Syntax

void MgraFont(
AIL_ID ContextGraId, //out
AIL_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.

Parameters

ContextGraId (out, AIL_ID)

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:

For specifying the 2D graphics context

ValueDescription
M_DEFAULTSpecifies that the default 2D graphics context of the current Aurora Imaging Library application is used.

Note: Note that there is a different default 2D graphics context for each thread. | | 2D graphics context identifier | Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc. |

FontName (in, AIL_INT64)

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

For specifying the font

ValueDescription
M_FONT_DEFAULTSame as M_FONT_DEFAULT_SMALL.
M_FONT_DEFAULT_LARGESpecifies a large bitmap font, where each character is drawn in a 16x32 pixel area.
M_FONT_DEFAULT_MEDIUMSpecifies a medium bitmap font, where each character is drawn in a 12x24 pixel area.
M_FONT_DEFAULT_SMALLSpecifies a small bitmap font, where each character is drawn in a 8x16 pixel area.
M_FONT_DEFAULT_TTFSpecifies the default TrueType font of your operating system.
"FontFamily:Weight:Slant"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. | | "FontFile" | Specifies a full path to a TrueType file name. |

Copyright © 2026 Zebra Technologies.