Skip to content

fontlabapp.fontui.tglyph_edit · declarations 001

Back to fontlabapp.fontui.tglyph_edit

Key module-attribute

Key

delete_points

delete_points(data: GlyphData, selection: set[Key]) -> GlyphData

data without the selected points; touched contours are normalised or dropped.

draw_contours

draw_contours(contours: tuple[Contour, ...], pen: Any) -> None

Replay contours into a FontParts point pen.

handles

handles(contour: Contour, index: int) -> list[int]

Indices of the off-curve points next to the on-curve point at index.

move_points

move_points(data: GlyphData, selection: set[Key], dx: float, dy: float) -> GlyphData

data with the selected points (and their handles) shifted by (dx, dy).

normalise

normalise(points: tuple[Point, ...], closed: bool) -> tuple[Point, ...] | None

A valid contour from points, or None when no on-curve point is left.

points_in_rect

points_in_rect(data: GlyphData | None, view: View, rect: tuple[float, float, float, float]) -> set[Key]

(contour, point) keys of own points inside the screen rectangle (x0, y0, x1, y1).

toggle_points

toggle_points(data: GlyphData, selection: set[Key]) -> GlyphData

Toggle point roles, preserving coordinates and valid point-pen segments.

Open endpoints must remain on-curve. A single control becomes quadratic; two controls become cubic unless the existing segment is quadratic.

write_contours

write_contours(font: Any, name: str, layer: str, contours: tuple[Contour, ...], undo_name: str) -> None

Replace name's own contours on layer in one edit_glyph write.