Table of Contents

Class Freetype2

Namespace
Emgu.CV.Freetype
Assembly
Emgu.CV.dll

Draw UTF-8 strings with freetype/harfbuzz.

public class Freetype2 : SharedPtrObject, IDisposable, IAlgorithm
Inheritance
Freetype2
Implements
Inherited Members
Extension Methods

Constructors

Freetype2()

Create instance to draw UTF-8 strings.

public Freetype2()

Properties

AlgorithmPtr

Native algorithm pointer

public nint AlgorithmPtr { get; }

Property Value

nint

Methods

DisposeObject()

Release all the unmanaged memory associate with this object

protected override void DisposeObject()

GetTextSize(string, int, int, ref int)

Calculates the width and height of a text string.

public Size GetTextSize(string text, int fontHeight, int thickness, ref int baseLine)

Parameters

text string

Input text string.

fontHeight int

Drawing font size by pixel unit.

thickness int

Thickness of lines used to render the text.

baseLine int

y-coordinate of the baseline relative to the bottom-most text point.

Returns

Size

The approximate size of a box that contains the specified text

LoadFontData(string, int)

Load font data.

public void LoadFontData(string fontFileName, int id)

Parameters

fontFileName string

FontFile Name

id int

Face index to select a font faces in a single file.

PutText(IInputOutputArray, string, Point, int, MCvScalar, int, LineType, bool)

Renders the specified text string in the image. Symbols that cannot be rendered using the specified font are replaced by "Tofu" or non-drawn.

public void PutText(IInputOutputArray img, string text, Point org, int fontHeight, MCvScalar color, int thickness, LineType lineType, bool bottomLeftOrigin)

Parameters

img IInputOutputArray

Image.

text string

Text string to be drawn.

org Point

Bottom-left/Top-left corner of the text string in the image.

fontHeight int

Drawing font size by pixel unit.

color MCvScalar

Text color.

thickness int

Thickness of the lines used to draw a text when negative, the glyph is filled. Otherwise, the glyph is drawn with this thickness.

lineType LineType

Line type

bottomLeftOrigin bool

When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner.

SetSplitNumber(int)

Set the number of split points from bezier-curve to line. If you want to draw large glyph, large is better. If you want to draw small glyph, small is better.

public void SetSplitNumber(int num)

Parameters

num int

Number of split points from bezier-curve to line