Class Font
Represents a font that can be passed to text rendering functions.
Namespace: OpenCV.Net
Assembly: OpenCV.Net.dll
Syntax
public class Font : SafeHandleZeroOrMinusOneIsInvalid
Constructors
| Improve this Doc View SourceFont(FontFace, Double, Double, Double, Int32, LineFlags)
Initializes a new instance of the Font class with the specified parameters.
Declaration
public Font(FontFace fontFace, double hscale, double vscale, double shear = null, int thickness = 1, LineFlags lineType = default(LineFlags))
Parameters
Type | Name | Description |
---|---|---|
FontFace | fontFace | The font name identifier. |
Double | hscale | The width scale factor for the font. |
Double | vscale | The height scale factor for the font. |
Double | shear | Approximate tangent of the character slope relative to the vertical line. A value of 0 means a non-italic font, 1.0 means around 45 degrees of slope, and so on. |
Int32 | thickness | The thickness of the text strokes. |
LineFlags | lineType | The algorithm used to draw the text strokes. |
Font(Double, Int32)
Initializes a new instance of the Font class with the specified
scale
and thickness
.
Declaration
public Font(double scale, int thickness = 1)
Parameters
Type | Name | Description |
---|---|---|
Double | scale | The scale factor for the font. |
Int32 | thickness | The thickness of the text strokes. |
Font(String, Int32)
Initializes a new instance of the Font class using Qt based glyphs.
Declaration
public Font(string nameFont, int pointSize = null)
Parameters
Type | Name | Description |
---|---|---|
String | nameFont | Name of the font. The name should match the name of a system font (such as Times). If the font is not found, a default one is used. |
Int32 | pointSize | Size of the font. If not specified, equal zero or negative, the point size of the font is set to a system-dependent default value. Generally, this is 12 points. |
Font(String, Int32, Scalar, FontWeight, FontStyle, Int32)
Initializes a new instance of the Font class using Qt based glyphs.
Declaration
public Font(string nameFont, int pointSize, Scalar color, FontWeight weight = default(FontWeight), FontStyle style = default(FontStyle), int spacing = 0)
Parameters
Type | Name | Description |
---|---|---|
String | nameFont | Name of the font. The name should match the name of a system font (such as Times). If the font is not found, a default one is used. |
Int32 | pointSize | Size of the font. If not specified, equal zero or negative, the point size of the font is set to a system-dependent default value. Generally, this is 12 points. |
Scalar | color | Color of the font. |
FontWeight | weight | Font weight. |
FontStyle | style | Font style. |
Int32 | spacing | Spacing between characters. It can be negative or positive. |
Methods
| Improve this Doc View SourceReleaseHandle()
Executes the code required to free the native Font handle.
Declaration
protected override bool ReleaseHandle()
Returns
Type | Description |
---|---|
Boolean | true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. |