Skip to content

fontlab.Interval · declarations 001

Back to fontlab.Interval

d instance-attribute

d: Any

double d

The length of the interval: t1 - t0. A convenient way to check how much of the contour is covered by this interval.

Source: FontLab Proteus API documentation

isEmpty

isEmpty() -> bool

bool isEmpty()

Returns True if t0 == t1 (a zero-length interval that covers no curve area). An empty interval typically results from querying a point that lands exactly on a node.

Source: FontLab Proteus API documentation

key instance-attribute

key: Any

uint key

An integer hash code that uniquely identifies this (t0, t1) pair. Used internally for caching interval-based computations.

Source: FontLab Proteus API documentation

middle

middle() -> float

double middle()

Returns the midpoint of the interval: (t0 + t1) / 2. A quick way to find the centre of the selected stretch of curve.

Source: FontLab Proteus API documentation

reversed

reversed() -> Any

Interval reversed()

Returns a new interval with t0 and t1 swapped. The reversed interval covers the same portion of the contour but in the opposite traversal direction. Useful when iterating a selection backwards.

Source: FontLab Proteus API documentation

setT0T1

setT0T1(t0: float, t1: float) -> None

void setT0T1(double t0, double t1)

Sets both t0 and t1 simultaneously. Preferred over setting them one at a time to avoid momentarily invalid states where t0 > t1.

Source: FontLab Proteus API documentation

t0 instance-attribute

t0: Any

double t0

The start of the interval. 0.0 means the very beginning of the contour arc.

Source: FontLab Proteus API documentation

t1 instance-attribute

t1: Any

double t1

The end of the interval. The interpretation depends on whether you are using per-segment parametrisation (0..1 per segment) or full-contour parametrisation.

Source: FontLab Proteus API documentation

toAbsolute

toAbsolute(v: float) -> float

double toAbsolute(double v)

Converts a value v expressed as a fraction of this interval (0 = start, 1 = end) to an absolute parametric value on the contour. For example, if the interval is [0.25, 0.75], then toAbsolute(0.5) returns 0.5 (the midpoint of the full contour).

Source: FontLab Proteus API documentation

toInterval

toInterval(absv: float) -> float

double toInterval(double absv)

The inverse of toAbsolute. Converts an absolute parametric value absv to a 0..1 fraction relative to this interval. Useful when you have a global contour position and want to know where it falls within a given interval.

Source: FontLab Proteus API documentation