defcon icon indicating copy to clipboard operation
defcon copied to clipboard

Make shallow loading API public.

Open typesupply opened this issue 9 years ago • 0 comments

In the UFO 3 branch, the glyph object loads contours shallowly to try to reduce the initial loading time. This is done here:

https://github.com/typesupply/defcon/blob/ufo3/Lib/defcon/objects/glyph.py#L410

With this:

https://github.com/typesupply/defcon/blob/ufo3/Lib/defcon/pens/glyphObjectPointPen.py#L40

When contours are needed, the contour objects are fully created:

https://github.com/typesupply/defcon/blob/ufo3/Lib/defcon/objects/glyph.py#L431

This could be made public with something like glyph.wake(). It would also be useful to make the reverse possible: compact the fully loaded contours back into shallow form with glyph.sleep().

typesupply avatar Jul 04 '16 23:07 typesupply