FontSpec#

Import

from scenet import FontSpec

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.11

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.FontSpec[source]#

Bases: Strict

The font files a panel is lettered in, each a path relative to the document.

Paths, never names: a font is a declared file and never a system lookup, so a document letters the same on every machine. They are read relative to the folder the document is in, and an absolute one is refused; see scenet.paths.

Example

>>> from scenet import FontSpec, parse_panel
>>> font = parse_panel("lettering: {font: fonts/Comic.ttf}").lettering.font
>>> isinstance(font, FontSpec), font.regular
(True, 'fonts/Comic.ttf')

See also

LetteringSpec, whose font takes one. FontMetrics, a font read for measuring.

regular: str#

The font file dialogue and spoken captions are lettered in, relative to the document. Written alone, as font: fonts/Comic.ttf, it letters every face.

italic: str | None#

The font file every caption but a spoken one is lettered in. Left out, they are set in regular.

bold_italic: str | None#

The font file a stressed word, _word_, is lettered in. Left out, it is italic, or regular when there is no italic, and a note says so.

display: str | None#

The font file sound effects are lettered in. Left out, the shipped display face, Bangers, whatever the other faces are.