Companion

Functions

Link copied to clipboard
fun load(fontBytes: ByteArray, name: String? = null, subset: Boolean = true): EmbeddedFont

Parse fontBytes (a TrueType .ttf or OpenType/CFF .otf font) for embedding. name overrides the /BaseFont name; when null it is read from the font's name table (PostScript name), falling back to "KiteFont". When subset (default) only the glyphs the document uses are embedded; pass false to embed the whole program.

fun load(fontBytes: ByteArray, name: String? = null, subset: Boolean = true, faceIndex: Int): EmbeddedFont

load for face faceIndex of a TrueType collection (.ttc), whose faces TrueTypeFont.faceCount counts. The face is embedded as a font of its own, since a PDF font program holds one font (#199).