PdfEx.Font.Surgery (pdf_ex v0.1.0)

Copy Markdown View Source

TrueType font surgery (Tier 3, T3.4). subset_truetype/2 produces a smaller valid sfnt that retains a glyph set (+ composite dependencies) and empties all other outlines. Glyph ids are preserved (cmap/hmtx untouched). CFF/OTTO is refused. Not wired into PDF embedding (a separate integration layer).

Summary

Functions

True if the font's head.checkSumAdjustment matches a fresh whole-font checksum.

Functions

subset_truetype(font, keep_ids)

@spec subset_truetype(binary(), [non_neg_integer()]) ::
  {:ok, binary()} | {:error, atom()}

valid_checksum?(font)

@spec valid_checksum?(binary()) :: boolean()

True if the font's head.checkSumAdjustment matches a fresh whole-font checksum.