mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-09 21:14:51 +00:00
The editing copy of a PDF-compatible .ai wrote an object's live effects as their result (geometry effects) or left them out (the others). Objects with effects the .ai reader reads are now written as art styles: - An object is written as its drawn look (a group of its vector art as its geometry effects leave it, without shadows, glows or feathers, with the object's transparency after it), then the object itself on %_ lines (its points painted with nothing, or with its gradient fill placed on the outline it draws; a group with its members), its name and opacity mask, and 1 (style) XW naming its style. - Styles are written in a non-printing block after the symbols, in %AI9_BeginArtStyles: a chain of the stack of fills and strokes (with the contents where the appearance puts them), the effects and the object's transparency. Objects of the same appearance share a style. - The effects written are the ones the reader reads on objects, with their settings in the units it reads them in: Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Convert to Shape, Offset Path, Outline Object, Outline Stroke and Pathfinder > Add. - Each style is read back before it is written, by a new reader function, read_art_style, which runs the reader's style parser and its reading of a graphic style with the object's own gradient. An object whose style reads back differently (several fills or strokes, fills or strokes with transparency or effects of their own, pattern fills, other effects), a filled object that fills by the even-odd rule (a style's fill fills by the non-zero rule), a group whose effects change its members' outlines while a member is written on another outline (strokes as filled outlines, pattern fills as tiles, gradients that fit their object), or one in a container whose own effects change its members, is written as its drawn look with the warning, and a style that is not written leaves no gradient definition behind. Graphic styles and links to them are left out with a warning. No art style is written on a large canvas. Appearance attributes: https://helpx.adobe.com/illustrator/using/appearance-attributes.html Tests: the round trip of objects with each effect, a gradient fill, a group with transparency and a mask, Pathfinder > Add and a hidden effect; the same bytes on a second write; the forms written; the objects the reader would not read; a large canvas; the warning for graphic styles; filled even-odd objects; a gradient placed on the outline Offset Path draws; a style that is not written; effects in a pattern a drawn look uses; the reader's check of a style; fuzz cases for damaged written styles. Docs: docs/file-format-parity.md.