CreateTextFont Method
Description
Create the font for adding text using the method AddText.
| ActiveX Edition | Plug-in Edition | Mac Edition |
|---|---|---|
| Since V7.0 | Since V7.0 | Since V7.0 |
Syntax
Boolean ObjectName.CreateTextFont(Int Height, Int Width, Int Escapement, Int Orientation, Int Weight, Byte Italic, Byte Underline, Byte StrikeOut, Byte CharSet, Byte OutputPrecision, Byte ClipPrecision, Byte Quality, Byte PitchAndFamily, String FaceName)
Parameters
Int Height: Specifies the desired height (in logical units) of the font.The absolute value of nHeight must not exceed 16,384 device units after it is converted. For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size or the smallest font if all the fonts exceed the requested size.
Int Width: Specifies the average width (in logical units) of characters in the font. If Width is 0, the aspect ratio of the device will be matched against the digitization aspect ratio of the available fonts to find the closest match, which is determined by the absolute value of the difference.
Int Escapement: Specifies the angle (in 0.1-degree units) 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 (in 0.1-degree units) 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 (in inked pixels per 1000). The described values are approximate; the actual appearance depends on the typeface. Some fonts have only FW_NORMAL, FW_REGULAR, and FW_BOLD weights. If FW_DONTCARE is specified, a default weight is used.
Byte Italic: Specifies an italic font if set to TRUE.
Byte Underline: Specifies an underlined font if set to TRUE.
Byte StrikeOut: A strikeout font if set to TRUE.
Byte CharSet: Specifies the font's character set. The OEM character set is system-dependent. Fonts with other character sets may exist in the system. An application that uses a font with an unknown character set must not attempt to translate or interpret strings that are to be rendered with that font. Instead, the strings should be passed directly to the output device driver. The font mapper does not use the DEFAULT_CHARSET value. An application can use this value to allow the name and size of a font to fully describe the logical font. If a font with the specified name does not exist, a font from any character set can be substituted for the specified font. To avoid unexpected results, applications should use the DEFAULT_CHARSET value sparingly.
Byte 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.
Byte ClipPrecision: Specifies the desired clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. To use an embedded read-only font, an application must specify CLIP_ENCAPSULATE. To achieve consistent rotation of device, TrueType, and vector fonts, an application can use the OR operator to combine the CLIP_LH_ANGLES value with any of the other nClipPrecision values. If the CLIP_LH_ANGLES bit is set, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed. (For more information about the orientation of coordinate systems, see the description of the Orientation parameter.) If CLIP_LH_ANGLES is not set, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system.
Byte Quality: Specifies the font's output quality, which defines how carefully the GDI must attempt to match the logical-font attributes to those of an actual physical font.
Byte PitchAndFamily: The pitch and family of the font.
String FaceName: the typeface name, the length of this string must not exceed 32 characters, including the terminating null character.
Return value
Boolean.
TRUE indicates success. FALSE indicates failure.
Remarks
When an error occurs and IfThrowException property is TRUE, an exception will be thrown.
When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.
Sample
A JavaScript sample is provided.
<script language="javascript" type="text/javascript">
Webcam = document.getElementById("iDynamicWebcam");//iDynamicWebcam is the id of the Dynamic Webcam on the page (An object or an embed).
function btnCreateTextFontt_onclick() {
Webcam.CreateTextFont(50,30,0,0,10,0,0,0,0,0,0,0,0,"Arial");
);
}
</script>
