ARROW_LINES and ARROW_EQUILATERAL stroke caps were accepted by the schema and round-tripped from .fig files, but the renderer mapped every cap to Butt, so imported arrows lost their heads and arrows could not be drawn locally. Add a pure arrow-cap geometry module to scene-graph (open-endpoint collection with per-vertex cap overrides, weight-scaled head geometry) and draw heads in the stroke color for LINE nodes and open VECTOR centerline strokes, including the dashed-centerline path. Fold the head reach into strokeOverflow and the node picture margin so heads are not cropped by visual bounds, caches, or culling. Round-trip per-vertex stroke caps through the .fig vector style override table so one-ended Figma arrows import correctly. Expose both caps in the stroke inspector cap picker with localized labels, and cover the renderer with an arrow-stroke-caps Playwright canvas snapshot. Claude-Session: https://claude.ai/code/session_012zjEbyLSBYyPpJP4fu1XNB |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsconfig.test.json | ||
| tsdown.config.ts | ||
@open-pencil/fig
.fig file-format package for OpenPencil.
The package owns the outer .fig archive boundary and is the staged home for Figma-specific
SceneGraph conversion policy. Production SceneGraph read/write remains available through
@open-pencil/core/io while conversion modules move behind this package's public API.
Current ownership:
- Complete
.figarchive parsing throughparseFigBuffer() .figarchive assembly throughwriteFigArchive()- Canvas payload and image resource handling
readFigContainer()/writeFigContainer()helpers for rawfig-kiwipayloads.figsource and archive result types- NodeChange-to-SceneGraph property conversion, including styles, plugin metadata, text, paint, vector, and font policy, through
@open-pencil/fig/node-change - Component-property, symbol-override, derived-symbol-data, and instance synchronization policy through
@open-pencil/fig/instance-overrides - Effective raw-metadata precedence and invalidation over SceneGraph's format-neutral edited-field tracking
- SceneGraph-to-
NodeChangeexport conversion with an explicit glyph-outline runtime service - Package-local archive, conversion, instance, export, and dist smoke tests
Planned ownership:
- Oracle-backed
.figfixtures
Non-goals:
- Generic Kiwi schema/runtime internals — use
@open-pencil/kiwi - Format-neutral IO registration, export targeting, CanvasKit thumbnails, or browser workers — use
@open-pencil/core/io - Editor actions, renderer behavior, Vue/app UI, CLI formatting, or MCP transport
This follows the existing @open-pencil/pen pattern: a format package owns its source model/parser
and SceneGraph policy, while core registers it in the shared IO system.
Checks
cd packages/fig
bun run check