typerig.proxy.gs3.gui.thumbnail · declarations 001
Back to typerig.proxy.gs3.gui.thumbnail
THUMB
module-attribute
THUMB
contour_path
contour_path(contour, path=None)
Append a contour (nodes with x / y / type, plus closed) to path. Returns (path, [on-curve (x, y)]). Off-curves after the last on-curve of an open contour are dropped.
iter_contours
iter_contours(source)
Yield every contour held by source (see module header).
outline_paths
outline_paths(source)
source -> (fill path: closed contours, stroke path: open contours, [on-curve (x, y) of the open contours]).
save_png
save_png(image, file_path, scale=2)
Write an NSImage to PNG at scale x its size (tests, docs).
thumb_image
thumb_image(source, size=None, tone='label', context=None, fit=None, nodes=None, outline=False)
Draw source into a square NSImage.
size : edge in pt; default UI.THUMB.SIZES[UI.THUMB.SIZE_INDEX] tone : colour of source (UI.THUMB.TONES key, NSColor method name or NSColor) context : drawn behind source in the 'muted' tone and fitted with it — e.g. the whole glyph behind a copied part fit : (xmin, ymin, xmax, ymax) font units to fit instead of the drawn bounds; pass the same box to a set of thumbnails to keep their relative scale. xmin == xmax: centre x on the drawing, e.g. (0, descender, 0, ascender) nodes : dots on on-curve nodes of open contours; None = when there are any outline : stroke closed contours instead of filling them