OpenTypeParser
in package
FinalYes
Parser for OpenType fonts with CFF outlines (sfVersion "OTTO").
Reuses the same table-level parsing as TrueType (head, hhea, OS/2, maxp, hmtx, cmap, name, post) since these tables have identical format in both TrueType and OpenType-CFF. The CFF table data is extracted as raw bytes for embedding (we don't parse CFF charstrings).
The parsed result is an OpenTypeData object containing metrics, glyph widths, Unicode mappings, and raw CFF bytes.
Table of Contents
Methods
- __construct() : mixed
- fromBytes() : self
- Create a parser from raw font bytes instead of a file path.
- parse() : OpenTypeData
Methods
__construct()
public
__construct(string $path) : mixed
Parameters
- $path : string
fromBytes()
Create a parser from raw font bytes instead of a file path.
public
static fromBytes(string $fontBytes) : self
Parameters
- $fontBytes : string
Return values
selfparse()
public
parse() : OpenTypeData