FontSpec

data class FontSpec(val family: KiteFontFamily, val bold: Boolean, val italic: Boolean, val name: String = "", val language: String? = null)(source)

Platform-neutral descriptor for picking a substitute system font when a document font ships no embedded outlines (e.g. the PDF Standard-14, or a CSS font with no @font-face file). Render backends map family + bold + italic to a host typeface, and language to a face that draws that language's own glyph forms. No PDF (or other format) types cross the canvas seam, so every document handler (PDF, EPUB, ...) feeds the same FontSpec.

Constructors

Link copied to clipboard
constructor(family: KiteFontFamily, bold: Boolean, italic: Boolean, name: String = "", language: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The CJK script language is written in, or null for a language outside CJK or none.

Link copied to clipboard
Link copied to clipboard

Family names of host faces that draw language in family, most wanted first, for a canvas that picks its face by name. The list spans macOS, iOS, Windows and Linux, so a host has a few of them at most. Empty when cjkScript is null, since a generic face of the host already draws such a language.

Link copied to clipboard
Link copied to clipboard

The BCP 47 tag of the language the text is written in, such as ja, or null when the document does not say. One Han character has a Japanese, a Simplified Chinese, a Traditional Chinese and a Korean form, and a generic serif face draws only one of them, so a substitute for a CJK font needs a face of its own language. A PDF CIDFont names it through the character collection of its CIDSystemInfo (ISO 32000-1, 9.7.3, #472): Adobe-Japan1 is ja, Adobe-GB1 zh-Hans, Adobe-CNS1 zh-Hant and Adobe-Korea1 ko.

Link copied to clipboard

A character that only a face of language draws, for a canvas that asks the host for any face with that character, or null when cjkScript is null. Kana for Japanese, Hangul for Korean, and a Han character that Simplified and Traditional Chinese write differently.

Link copied to clipboard

Original font name (e.g. "Helvetica-Bold"), for diagnostics only.