Inkscape.org
Beyond the Basics Command Line 'inscape --with-gui' on Windows 10 returns error: 'gadget with negative dimensions'
  1. #1
    ML ML @em1000
    *

    Command Line 'inkscape --with-gui' on Windows 10: 'gadget with negative dimensions'
    Short Answer: Close Dialogs and Side Panels

    #1 -- Inkscape is glorious and beautiful. Same goes for this forum. Thanks to all involved.

    #2 -- I am trying to run some rudimentary batch operations from the command line. Specifically, I aim to call '--verb=StrokeToPath' on a folder full of svgs. When I attempt to open the GUI using '--with-gui' or '-g', I get a verbose stream of errors, referencing 'GdlSwitcher' (details pasted at bottom).

    I updated to Inkscape 1.0.2, to see if that would help. I am on Windows 10 (64-bit). I have tried using both 'inkscape' and 'inkscape.com'. I have simplified my command down to 'inkscape -g test.svg', or even just 'inkscape -g' and I still get the same error.

    Should I be adding an extra argument for '--with-gui' to work? Console output is included below. Many thanks!

    C:\Users\Student>inkscape --with-gui
    (org.inkscape.Inkscape:5968): Gtk-WARNING **: 18:15:06.415: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node notebook owner GdlSwitcher)
    ...
    (org.inkscape.Inkscape:5968): Gtk-CRITICAL **: 18:15:08.858: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GdlSwitcher
    ^C
    C:\Users\Student>

     

  2. #2
    inklinea inklinea @inklinea⛰️
    🔧

    Either of these two command lines should work if you run the command in the same folder as the svgs

    However, always make a folder and use copies of your svgs to use with the batch command, just in case they happen to get overwritten :)

    inkscape --batch-process --actions="EditSelectAllInAllLayers;StrokeToPath;export-type:svg;export-do;" *.svg

    inkscape --batch-process --actions="select-all;StrokeToPath;export-type:svg;export-do;" *.svg

    Inkscape in version 1.02+ will create new svg files with the filename appended with    _out.svg

    However, always make a folder and use copies of your svgs to use with the batch command, just in case they happen to get overwritten :)

     

  3. #3
    Patrick Storz Patrick Storz @Ede_123
    🐸

    These are warnings/errors from gtk, indicating that some widgets could not be layout properly in the sidebar.

    As you want to export on console you don't need to care for those. If you want to get rid of them just launch Inkscape once normally and close all opened dialogs, afterwards the warnings should be gone.

  4. #4
    ML ML @em1000

    Ah-haa!! Thank you both inklinea and Patrick Storz for these very helpful responses! I am now pointed in the right direction, and the wall that impeded my progress has been torn asunder. Many thanks!

  5. #5
    ML ML @em1000
    *

    I have advanced significantly in my modest font-building project. Below you can see what my glyphs looked like before and after receiving assistance from Patrick Storz and inklinea on this forum.


    BEFORE -- Characterized by grotesque blotches on some of the glyphs.


    AFTER -- Nice, clean glyphs. Blotches are gone.

    This significant improvement results from calling StrokeToPath on 175 glyphs before importing them. I used Python to find the svg files and call the command line. It took about five minutes to process all 175 files. The core engine of the operation is pasted below for reference (note that I deliberately Ungrouped twice, in case of multiple groupings). inklinea's Command Line Builder was especially helpful for generating the code below. Many thanks to the Inkscape community and this Forum!

    command_base = 'inkscape --batch-process --actions='
    act_list = [
        '"EditSelectAllInAllLayers;',
        'StrokeToPath;',
        'SelectionUnGroup;',
        'EditSelectAllInAllLayers;',
        'SelectionUnGroup;',
        'EditSelectAllInAllLayers;',
        'SelectionUnion;',
        'export-type:svg;',
        f'export-filename:{export_folder}{source}.svg;',
        f'export-do;" {import_folder}{source}.svg']
    actions = ''
    for act in act_list:
        actions = f'{actions}{act}'
    outline_command = f'{command_base}{actions}'
    os.system(outline_command)

     

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Command Line 'inscape --with-gui' on Windows 10 returns error: 'gadget with negative dimensions'