Class OpenTypeOffsetTable
The OpenType offset table (the first 12 bytes of every sfnt-based font file). It describes the font's table directory and is used to locate each font table.
Inherited Members
Namespace: DRIT.Drawing.Font.IO
Assembly: DRIT.Drawing.dll
Syntax
public sealed class OpenTypeOffsetTable
Constructors
OpenTypeOffsetTable(uint, ushort, ushort, ushort, ushort)
Initializes a new OpenTypeOffsetTable with the specified values.
Declaration
public OpenTypeOffsetTable(uint sfVersion, ushort numTables, ushort searchRange, ushort entrySelector, ushort rangeShift)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | sfVersion | The sfnt version. |
| ushort | numTables | Number of tables in this font. |
| ushort | searchRange | Pre-computed binary search value. |
| ushort | entrySelector | Log₂ of the maximum power of 2 ≤ NumTables. |
| ushort | rangeShift | NumTables × 16 − SearchRange. |
Fields
SfVersionAppleTrue
0x74727565 — "true" — Apple TrueType.
Declaration
public const uint SfVersionAppleTrue = 1953658213
Field Value
| Type | Description |
|---|---|
| uint |
SfVersionAppleTyp1
0x74797031 — "typ1" — Legacy Apple Type 1 wrapper (rare).
Declaration
public const uint SfVersionAppleTyp1 = 1954115633
Field Value
| Type | Description |
|---|---|
| uint |
SfVersionCff
0x4F54544F — "OTTO" — OpenType font with CFF/Type 2 outlines.
Declaration
public const uint SfVersionCff = 1330926671
Field Value
| Type | Description |
|---|---|
| uint |
SfVersionTrueType
0x00010000 — Standard TrueType / OpenType with TrueType outlines.
Declaration
public const uint SfVersionTrueType = 65536
Field Value
| Type | Description |
|---|---|
| uint |
Properties
EntrySelector
Log₂ of the maximum power of 2 ≤ NumTables. Pre-computed binary search value; informational only.
Declaration
public ushort EntrySelector { get; }
Property Value
| Type | Description |
|---|---|
| ushort |
IsCff
True when the sfnt container holds CFF (Type 2 charstring) outlines.
Declaration
public bool IsCff { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsTrueType
True when the sfnt container holds TrueType outlines (glyf table).
Declaration
public bool IsTrueType { get; }
Property Value
| Type | Description |
|---|---|
| bool |
NumTables
Number of tables in this font.
Declaration
public ushort NumTables { get; }
Property Value
| Type | Description |
|---|---|
| ushort |
RangeShift
NumTables × 16 − SearchRange. Pre-computed binary search value; informational only.
Declaration
public ushort RangeShift { get; }
Property Value
| Type | Description |
|---|---|
| ushort |
SearchRange
(Maximum power of 2 ≤ NumTables) × 16. Pre-computed binary search value; informational only.
Declaration
public ushort SearchRange { get; }
Property Value
| Type | Description |
|---|---|
| ushort |
SfVersion
The sfnt version, also called the 'sfVersion' or 'sfntVersion' field.
Compare against the SfVersion* constants above.
Declaration
public uint SfVersion { get; }
Property Value
| Type | Description |
|---|---|
| uint |
Methods
ToString()
Returns a string representation of this offset table.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |