Skip to content

Bug: Swatches, Symbols, and Styles libraries fail to import #3349

Open

Description

@mattiapascal

Libraries.zip

Describe the bug

The asset libraries for Swatches, Symbols, and Styles do not import correctly into VectorCraft. When attempting to load or apply them, they do not appear in the interface or fail to load entirely.

Steps to reproduce

  1. Open VectorCraft.
  2. Go to the respective panel (Swatches, Symbols, or Styles).
  3. Attempt to import or load a library.
  4. Notice that the assets are missing and you find a default set instead of the imported library.

Expected behavior

The libraries should successfully import, and the corresponding Swatches, Symbols, and Styles should be fully accessible within their respective panels.

Environment

  • VectorCraft Version: 0.14.0
  • Operating System: Windows 10

Activity

  1. ticket-craft commented on Oct 21, 2026

    @ticket-craft

    Thanks for the report! To look into this, we need a sample file that shows the problem and a screenshot or the exact error message. Please add them in a comment here, or open a new ticket with the details.

    Possibly related: #536, #831 and #745.

  2. mattiapascal commented on Oct 21, 2026

    @mattiapascal
    Author

    This is a comparison between the library imported into Illustrator and the same library imported into VectorCraft

    Image Image
  3. added a commit that references this issue on Oct 29, 2026
  4. mattiapascal commented on Nov 11, 2026

    @mattiapascal
    Author

    Follow-up on VectorCraft 0.23.0 for Windows. My symbol library now opens correctly. The Graphic Styles library lists its entries, but 10 of the 11 imported entries have zero fills, zero strokes, and zero effects. The remaining entry imports only a white fill. Applying an empty entry reports success and clears the selected rectangle’s fill and stroke, making it invisible. I reproduced this through Graphic Styles → Other Library's engine commands (graphicStyle.loadLibrary, graphicStyle.library, graphicStyle.addFromLibrary, and document.inspect).

    Proposed fix. The importer in crates/eps/src/import/ai/style.rs reads the filter tree of /ActiveStyle, but it does not read the paint operators in /SimpleStyle → /Paint when there are no filters. In that case style() returns a valid-looking empty ArtStyle, which the library importer exposes as an applicable style. Parse the simple paint block using the existing paint-operator reader and use Xd to enable the stroke and fill independently. Keep intentionally unpainted styles distinct from styles whose paint could not be read, so an unsupported import cannot silently clear artwork. There is a second gap for gradients in this sample: appearance_from_art_style() rejects StyleItem::Gradient for standalone styles. Resolve the named Bg gradient from the file’s definitions and store its placement relative to the target object’s bounds, as native graphic styles do.

    Minimal regression case. Put the following hand-written style in the existing no-layer AI fixture from a_graphic_style_library_in_a_ai_file_without_layers_loads_its_styles and list its name in BeginArtStyleList. On 0.23.0 it imports by name with strokes: 0 and clears the rectangle when applied. The regression test should assert one red stroke, 2 pt wide, no fill, and the same appearance on a rectangle after applying it. A second case can cover a named gradient fill plus a solid stroke.

    /KnownStyle :
    (Synthetic red outline) /Name ,
    /SimpleStyle :
    0 R
    0 1 1 0 K
    0 J 0 j 2 w 10 M []0 d
    1 0 Xd
    /Paint ;
    /Def ;
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions