Class TrueTypeFont
Inheritance
System.Object
TrueTypeFont
Assembly: FastReport.dll
Syntax
public class TrueTypeFont : OpenTypeFontBase, IDisposable
Constructors
TrueTypeFont(FontStream, UInt32)
Constructor of TrueTypeFont object
Declaration
public TrueTypeFont(FontStream stream, uint subfont_offset)
Parameters
Type |
Name |
Description |
FontStream |
stream |
Strean with font
|
System.UInt32 |
subfont_offset |
Disposition of subfont within collection file. Non-zero for font collections
|
Fields
checksum_action
Declaration
public TrueTypeFont.ChecksumFaultAction checksum_action
Field Value
Properties
Ascender
Declaration
public float Ascender { get; }
Property Value
Type |
Description |
System.Single |
|
baseLine
Declaration
public float baseLine { get; }
Property Value
Type |
Description |
System.Single |
|
Bold
Declaration
public bool Bold { get; }
Property Value
Type |
Description |
System.Boolean |
|
FastName
Declaration
public string FastName { get; }
Property Value
Type |
Description |
System.String |
|
FileSize
Declaration
public uint FileSize { get; set; }
Property Value
Type |
Description |
System.UInt32 |
|
FontVersion
Declaration
public uint FontVersion { get; }
Property Value
Type |
Description |
System.UInt32 |
|
Glyphs
Declaration
public GlyphTableClass Glyphs { get; }
Property Value
HMetrics
Declaration
public HorizontalMetrixClass HMetrics { get; }
Property Value
I2L
Declaration
public IndexToLocationClass I2L { get; }
Property Value
Declaration
public bool IsClassicFormat { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsCollection
Declaration
public bool IsCollection { get; }
Property Value
Type |
Description |
System.Boolean |
|
Italic
Declaration
public bool Italic { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Kerning
Declaration
public KerningTableClass Kerning { get; }
Property Value
Language
Get or set current Language
Declaration
public string Language { get; set; }
Property Value
Type |
Description |
System.String |
|
LeftOffSet
Declaration
public float LeftOffSet { get; }
Property Value
Type |
Description |
System.Single |
|
LicensingRights
Declaration
public int LicensingRights { get; }
Property Value
Type |
Description |
System.Int32 |
|
OS2WindowsMetrics
Declaration
public OS2WindowsMetricsClass OS2WindowsMetrics { get; }
Property Value
Script
Get or set current script
Declaration
public string Script { get; set; }
Property Value
Type |
Description |
System.String |
|
Scripts
Declaration
public IEnumerable<string> Scripts { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
Type
Declaration
public FontType Type { get; set; }
Property Value
Methods
DrawGSUBTable(Int32, Int32, Single, GlyphSubstitutionClass.LookupTypes[])
Declaration
public Dictionary<string, List<FastGraphicsPath>> DrawGSUBTable(int lineHeight, int columnWidth, float fontSize, GlyphSubstitutionClass.LookupTypes[] types)
Parameters
Returns
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<FastGraphicsPath>> |
|
DrawString(String, PointF, Single)
Create outline for text string
Declaration
public FastGraphicsPath DrawString(string text, PointF position, float size)
Parameters
Type |
Name |
Description |
System.String |
text |
text which will be transformed to outline
|
System.Drawing.PointF |
position |
position of text
|
System.Single |
size |
font size in px
|
Returns
DrawString(UInt16[], PointF, Single)
Create outline for group of characters
Declaration
public FastGraphicsPath DrawString(ushort[] text, PointF position, float size)
Parameters
Type |
Name |
Description |
System.UInt16[] |
text |
text as array of glyph's indexes
|
System.Drawing.PointF |
position |
position of text
|
System.Single |
size |
font size
|
Returns
Finalize()
Destructor of TrueTypeFont object
Declaration
protected void Finalize()
GetFeatures(String, String)
Get available features for language and script
Declaration
public IEnumerable<string> GetFeatures(string script, string language)
Parameters
Type |
Name |
Description |
System.String |
script |
|
System.String |
language |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
GetFontData()
Declaration
public byte[] GetFontData()
Returns
Type |
Description |
System.Byte[] |
|
GetFontKey(Font)
Declaration
public static string GetFontKey(Font f)
Parameters
Type |
Name |
Description |
System.Drawing.Font |
f |
|
Returns
Type |
Description |
System.String |
|
GetFontKey(String, TrueTypeFont)
Declaration
public static string GetFontKey(string familyName, TrueTypeFont f)
Parameters
Type |
Name |
Description |
System.String |
familyName |
|
TrueTypeFont |
f |
|
Returns
Type |
Description |
System.String |
|
GetFullRawFontData()
Return full raw image of the font
Declaration
public byte[] GetFullRawFontData()
Returns
Type |
Description |
System.Byte[] |
Array of font bytes
|
GetGlyph(Char, Int32, PointF)
Create glyph outline assigned to specific position
Declaration
public FastGraphicsPath GetGlyph(char ch, int size, PointF position)
Parameters
Type |
Name |
Description |
System.Char |
ch |
unicode character which will be drawn
|
System.Int32 |
size |
size of the character
|
System.Drawing.PointF |
position |
position of outline
|
Returns
GetGlyph(UInt16, Single)
Declaration
public FastGraphicsPath GetGlyph(ushort ch, float size)
Parameters
Type |
Name |
Description |
System.UInt16 |
ch |
unicode charter
|
System.Single |
size |
outline image size
|
Returns
GetGlyphIndices(String, Single, out UInt16[], out Single[], out Single[], Boolean)
Translate text to positions of glyphs in glyph tables and glyphs width
Declaration
public int GetGlyphIndices(string text, float font_size, out ushort[] glyphs, out float[] widths, out float[] kernings, bool rtl)
Parameters
Type |
Name |
Description |
System.String |
text |
|
System.Single |
font_size |
size in px
|
System.UInt16[] |
glyphs |
|
System.Single[] |
widths |
|
System.Single[] |
kernings |
|
System.Boolean |
rtl |
|
Returns
Type |
Description |
System.Int32 |
|
GetLanguages(String)
Get available languages for script
Declaration
public IEnumerable<string> GetLanguages(string script)
Parameters
Type |
Name |
Description |
System.String |
script |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
GetOutlineTextMetrics(ref TrueTypeFont.OutlineTextMetric)
Emulation of Uniscribe GetOutlineTextMetrics
Declaration
public void GetOutlineTextMetrics(ref TrueTypeFont.OutlineTextMetric TextMetric)
Parameters
GetRawFontData()
Return raw image of the font
Declaration
public byte[] GetRawFontData()
Returns
Type |
Description |
System.Byte[] |
Array of font bytes
|
PackFont(ref Dictionary<UInt16, GlyphChar>, TrueTypeFont.FontPackOptions)
Cut some information from TTF file to reduce its size
Declaration
public byte[] PackFont(ref Dictionary<ushort, GlyphChar> dict, TrueTypeFont.FontPackOptions options)
Parameters
Returns
Type |
Description |
System.Byte[] |
|
PrepareCommonTables()
Parse font supplement tables which store properties of the font
Declaration
public void PrepareCommonTables()
PrepareIndexes()
Prepare tables for drawing, subsetting and so on
Declaration
public bool PrepareIndexes()
Returns
Type |
Description |
System.Boolean |
always true
|