fontlabapp.studios.kerning_studio.model · declarations 001
Back to fontlabapp.studios.kerning_studio.model
CURVE_STEPS
module-attribute
CURVE_STEPS
LEFT
LEFT
NATIVE_SIDES
module-attribute
NATIVE_SIDES
PREFIXES
module-attribute
PREFIXES
RIGHT
RIGHT
candidates
candidates(data: MasterData, left: str, right: str) -> list[Pair]
Possible records for a pair, most specific first (glyph/glyph ... class/class).
check_range
check_range(value: float, upm: Any, master: str, pair: Pair) -> None
Refuse a value outside FontLab's save/reopen range of twice units per em.
class_key
class_key(data: MasterData, left: str, right: str) -> Pair
The pair's class-level record: each glyph side replaced by its group, if any.
display
display(name: str) -> str
public.kern1.A -> @A; glyph names unchanged.
effective
effective(data: MasterData, left: str, right: str) -> tuple[float, Pair | None]
The value the pair gets and the record it comes from ((0, None) if none).
extents
extents(recording: Sequence[tuple[str, tuple]], height: float, name: str, layer: str) -> tuple[tuple[float, float], int]
Min/max x where closed contours cross height; also the open-contour count.
from_native
from_native(pairs: Mapping[Pair, float], classes: Mapping[str, tuple[Any, str]]) -> MasterData
Convert core.scripting reads (@class keys, side roles) to UFO keys.
Class names map as Fontport's native groups do: the side prefix is added unless the native name already carries it.
glyph_pairs
glyph_pairs(masters: Mapping[str, MasterData], glyph: str) -> list[Pair]
Every record, on any master, whose left or right side is glyph or its group.
group_peers
group_peers(groups: Mapping[str, Sequence[str]], glyph: str, order: Sequence[str]) -> dict[str, list[str]]
Other members of the glyph's visual-side groups, in font order.
L is the left side of the glyph (its kern2 group, used when it is a
pair's second glyph); R is its right side (kern1).
is_group
is_group(name: str) -> bool
kern_to_max
kern_to_max(left_width: float, right_width: float) -> int
Minus half the narrower advance, truncated toward zero.
overrides
overrides(data: MasterData, key: Pair, left: str, right: str) -> list[tuple[Pair, float]]
Existing records more specific than key that keep overriding it.
parse_side
parse_side(text: str, side: int) -> str
User text (A or @A) -> a UFO key for side; blank refused.
parse_text
parse_text(text: str, cmap: Mapping[int, str]) -> list[list[str]]
Split preview text into words of glyph names; /name tokens end at space or /.
side_groups
side_groups(groups: Mapping[str, Sequence[str]], glyph: str) -> tuple[str | None, str | None]
The (kern1, kern2) groups containing glyph; more than one per side refused.
steal_value
steal_value(widths: Sequence[float], spans: Sequence[tuple[float, float]], reference: float) -> tuple[int, float, float]
Kerning for pair 1 so its gap matches pair 2 (kerned by reference).
target_key
target_key(data: MasterData, left: str, right: str) -> Pair
The record an edit writes: the most specific existing one, else the class record.
text_pairs
text_pairs(words: Iterable[Sequence[str]]) -> list[Pair]
Adjacent pairs inside each word, first occurrence order, no repeats.