Contract to Import AI Files Update
24. november 2024 17:39
To allow the import of Adobe Illustrator files into Inkscape, we are developing a Python extension. This post outlines the progress in the 1st month of the project, October 2024. Work is carried out inside the git repository [extension-ai](https://gitlab.com/inkscape/extras/extension-ai/).
Below, you can find a list of what Manpreet has worked on in October 2024:
Duplicate Objects
AI files often contain multiple definitions of the same object, each defined in a different way. The tricky part was determining if a subsequent definition refers to the same object or represents a completely new object. The current approach assumes an object's definition ends when:
- It’s container (group or layer) ends
- An Art-dictionary is encountered
Styles
AI files feature two types of styles: inline styles and known styles.
Known styles are predefined in the document setup section and are applied to objects using the XW opearator. This functionality is now working as intended. Inline styles are mostly functional, but difficulties arise with duplicate definitions of objects and styles.
The following style attributes have been implemented:
- Stroke: stroke-color, stroke-dash, line-join, line-cap, miter-limit, stroke-width.
- Fill: fill-color, fill-rule
- Blend: opacity
Star Shape
The AI Import extension supports importing star shapes with most properties implemented, including the number of points, rotation angle, clockwise / anti-clockwise, corner types, inner and outer radii and corner radii. Out of the two corner rounding types (absolute and relative), only absolute rounding is currently implemented.
Text
The extension currently supports importing basic text elements, placing them approximately in the correct position. Some text styles like font-size, bold, italic, superscript, subscript, small-caps, underline, line-through and justification have also been implemented.