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

Class TtfHmtxTable

Parsed OpenType "hmtx" table (horizontal metrics). Stores advance width and left side-bearing for every glyph. The first numberOfHMetrics glyphs each have their own advance width; glyphs beyond that index share the last advance width value. Ref: OpenType spec §5.2.4.

Inheritance
object
TtfTableBase
TtfHmtxTable
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 TtfHmtxTable : TtfTableBase

Fields

TableTag

The table tag for the hmtx table.

Declaration
public const string TableTag = "hmtx"
Field Value
Type Description
string

Methods

GetAdvanceWidth(int)

Returns the advance width for glyphIndex, in design units. Glyphs with index ≥ numberOfHMetrics return the last recorded advance width.

Declaration
public ushort GetAdvanceWidth(int glyphIndex)
Parameters
Type Name Description
int glyphIndex
Returns
Type Description
ushort

GetLsb(int)

Returns the left side-bearing for glyphIndex, in design units.

Declaration
public short GetLsb(int glyphIndex)
Parameters
Type Name Description
int glyphIndex
Returns
Type Description
short

Parse(byte[], ushort, ushort)

Parses the "hmtx" table from its raw bytes.

Declaration
public static TtfHmtxTable Parse(byte[] rawBytes, ushort numberOfHMetrics, ushort numGlyphs)
Parameters
Type Name Description
byte[] rawBytes

Raw table data.

ushort numberOfHMetrics

Value from NumberOfHMetrics. Determines how many full (width+lsb) entries are present.

ushort numGlyphs

Total glyph count from NumGlyphs. Determines how many extra LSB-only entries follow.

Returns
Type Description
TtfHmtxTable
Back to top

DR-IT Software documentation

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

Generated by DocFX