• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class TtfKernTable

Parsed OpenType "kern" table — horizontal kerning adjustments between glyph pairs.

Inheritance
object
TtfTableBase
TtfKernTable
Inherited Members
TtfTableBase.Tag
TtfTableBase.RawBytes
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
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

Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX