Class TtfKernTable
Parsed OpenType "kern" table — horizontal kerning adjustments between glyph pairs.
Inherited Members
Namespace: DRIT.Drawing.Font.Ttf.Tables
Assembly: DRIT.Drawing.dll
Syntax
public sealed class TtfKernTable : TtfTableBase
Remarks
Only OpenType kern version 0, format 0 (ordered pairs) subtables are loaded. Format 2 (class-pair) subtables and Apple kern version 1 (AAT) tables are silently skipped; PairCount will be zero for those fonts.
Ref: https://learn.microsoft.com/en-us/typography/opentype/spec/kern
Fields
TableTag
The table tag for the kern table.
Declaration
public const string TableTag = "kern"
Field Value
| Type | Description |
|---|---|
| string |
Remarks
Only OpenType kern version 0, format 0 (ordered pairs) subtables are loaded. Format 2 (class-pair) subtables and Apple kern version 1 (AAT) tables are silently skipped; PairCount will be zero for those fonts.
Ref: https://learn.microsoft.com/en-us/typography/opentype/spec/kern
Properties
PairCount
Total number of kerning pairs loaded from format 0 subtables.
Declaration
public int PairCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Only OpenType kern version 0, format 0 (ordered pairs) subtables are loaded. Format 2 (class-pair) subtables and Apple kern version 1 (AAT) tables are silently skipped; PairCount will be zero for those fonts.
Ref: https://learn.microsoft.com/en-us/typography/opentype/spec/kern
Methods
GetKerning(ushort, ushort)
Returns the kerning value (in design units) for the given glyph pair, or 0 if no kern value is defined for the pair. A negative value means the glyphs are moved closer together.
Declaration
public short GetKerning(ushort leftGlyphId, ushort rightGlyphId)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | leftGlyphId | |
| ushort | rightGlyphId |
Returns
| Type | Description |
|---|---|
| short |
Remarks
Only OpenType kern version 0, format 0 (ordered pairs) subtables are loaded. Format 2 (class-pair) subtables and Apple kern version 1 (AAT) tables are silently skipped; PairCount will be zero for those fonts.
Ref: https://learn.microsoft.com/en-us/typography/opentype/spec/kern
Parse(byte[])
Parses the "kern" table from its raw bytes.
Declaration
public static TtfKernTable Parse(byte[] rawBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | rawBytes |
Returns
| Type | Description |
|---|---|
| TtfKernTable |
Remarks
Only OpenType kern version 0, format 0 (ordered pairs) subtables are loaded. Format 2 (class-pair) subtables and Apple kern version 1 (AAT) tables are silently skipped; PairCount will be zero for those fonts.
Ref: https://learn.microsoft.com/en-us/typography/opentype/spec/kern