phpdftk API Documentation

GsubParser
in package

FinalYes

Parses GSUB (Glyph Substitution) table for ligature features.

Extracts ligature substitution rules from the "liga" (standard ligatures) and "clig" (contextual ligatures) features. Supports:

  • GSUB LigatureSubst (LookupType 4)
  • Extension lookups (LookupType 7)

Returns a map of: firstGid => [[[componentGid2, ...], ligatureGid], ...] sorted by component count descending (longest match first).

Table of Contents

Methods

parse()  : array<int, array<int, array{components: int[], ligature: int}>>

Methods

parse()

public parse(string $fontBytes, array<string, array{offset: int, length: int}> $tables) : array<int, array<int, array{components: int[], ligature: int}>>
Parameters
$fontBytes : string

Raw font file bytes

$tables : array<string, array{offset: int, length: int}>

Table directory

Return values
array<int, array<int, array{components: int[], ligature: int}>>

firstGid => ligature rules


        
On this page

Search results