CreateTextFont()

Description

Creates the font for adding text on an image using the method AddText.

Syntax

.CreateTextFont(height, width, escapement, orientation, weight, italic, underline,
strikeOut, charSet, outputPrecision, clipPrecision, quality, pitchAndFamily, faceName);

Parameters

<int> height: specifies the desired height of the font.
<int> width: specifies the average width of characters in the font.
<int> escapement: specifies the angle between the escapement vector and the x-axis of the display surface. The escapement vector is the line through the origins of the first and last characters on a line. The angle is measured counterclockwise from the x-axis.
<int> orientation: specifies the angle between the baseline of a character and the x-axis. The angle is measured counterclockwise from the x-axis for coordinate systems in which the y-direction is down and clockwise from the x-axis for coordinate systems in which the y-direction is up.
<int> weight: specifies the font weight.
<short> italic: specifies an italic font if the value is not 0.
<short> underline: specifies an underlined font if the value is not 0.
<short> strikeOut: specifies an strikeout font if the value is not 0.
<short> charSet: specifies the font's character set.
<short> outputPrecision: specifies the desired output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, and pitch.
<short> clipPrecision: specifies the desired clipping precision. The clipping precision defines how to clip characters that are partially outside of the clipping region.
<short> quality: specifies the font's output quality which defines how carefully the GDI should attempt to match the logical-font attributes to those of an actual physical font.
<short> pitchAndFamily: specifies the pitch and family of the font.
<string> faceName: specifies the typeface name, the length of this string must not exceed 32 characters, including the terminating null character.

Return value

bool

true indicates success. false indicates failure.

When false is returned, check ErrorCode or ErrorString for error information.

See also

AddText

Example

DWObject.CreateTextFont(50, 30, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, "Arial");
DWObject.AddText(0, 250, 600, 'Dynamic Web TWAIN', 0x0000ff, 0xff0000, 0.5, 0.5);
Is this page helpful?

Leave a Reply

Your email address will not be published.