phpdftk API Documentation

MathKern
in package

Read onlyYes
FinalYes

One corner kern table from a {@see MathKernRecord}.

Per OpenType MATH spec, a kern table is a piecewise function of Y position: n correction heights (breakpoints) define n + 1 height ranges, each carrying a kern value.

  • For Y < correctionHeights[0]: kern = kernValues[0]
  • For correctionHeights[i-1] <= Y < heights[i]: kern = kernValues[i]
  • For Y >= correctionHeights[n-1]: kern = kernValues[n]

The painter walks correction heights and picks the kern value matching the sub/super Y attachment height.

Table of Contents

Properties

$correctionHeights  : array<string|int, mixed>
$kernValues  : array<string|int, mixed>

Methods

__construct()  : mixed
valueAt()  : int
Look up the kern value for a given Y offset above baseline.

Properties

$correctionHeights

public array<string|int, mixed> $correctionHeights

$kernValues

public array<string|int, mixed> $kernValues

Methods

__construct()

public __construct(array<int, int> $correctionHeights, array<int, int> $kernValues) : mixed
Parameters
$correctionHeights : array<int, int>

FUnit Y breakpoints, strictly increasing per spec.

$kernValues : array<int, int>

FUnit horizontal kerning at each range. Always length correctionHeights + 1.

valueAt()

Look up the kern value for a given Y offset above baseline.

public valueAt(int $heightFunits) : int
Parameters
$heightFunits : int
Return values
int

        
On this page

Search results