Skip to content

FontSetter

yex.control.fontsetter #

A class of controls to select a font.

FontSetter(font, name, control_name=None) #

Bases: yex.control.control.Unexpandable

When you use \font to define a font, it puts one of these into the controls table. Then when you call it, it changes the current font.

If you subscript it, you can inspect the dimens of the font.

Source code in yex/control/fontsetter.py
21
22
23
24
25
26
27
28
29
def __init__(self, font, name, control_name = None):

    if not isinstance(font, yex.font.Font):
        raise ValueError(
                f"Needed a font (and not {font}, which is a {type(font)}")

    self.font = font
    self.name = name
    self.control_name = control_name or name