May - AI Extension 2023
3. Juni 2023 16:03
To allow the import of Adobe Illustrator files into Inkscape, we develop a Python extension. This post outlines the progress in the 3rd month of the project, May 2023. Work is carried out inside the git repository extension-ai. To read more about the progress in April, read the last blog post.
Nicco Kunzmann
Nicco made a short video on the progress, using the Inkscape 1.3 alpha release.
Since we created a structure for a new and faster parser in April, a big part of may has been used to port existing features. However, we made some progress on parsing colors. At the current state, rectangles and paths can be imported and the page (viewbox) is correctly positioned and sized.
Here is an outline of Nicco's work:
- Creating more tests for the parser. In total, we run over 2000 small test cases.
- Path were migrated from pyparsing to the new structure. These are properly closed, receive a stroke and a fill.
- Objects like paths are parsed first. Then the object structure that represents the AI document is used to create the SVG file. Adobe illustrator uses several coordinate systems and thus the coordinates need to be transformed accordingly.
- Unit information (cm, mm, pixels, ...) is read from the ai files but not yet used in the SVG files.
- Paths now receive styles - fill and stroke. We can be quite sure that we know all the color representations (RGB, CMYK, gray, ...) that Adobe Illustrator uses.
- Rectangles are created. Some of them can be represented as a <rect> in SVG, some others will be paths with Fillet/Chamfer LPE.