-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for global and per-layer metadata (#359)
- added low-level property management commands: `propset`, `propget`, `proplist`, `propdel`, `prop clear` - introduced system properties: - `vp:color` (`color`): the color to be used for the layer - `vp:pen_width` (`float`): the pen width to be used for the layer - `vp:name` (`float`): the name of the layer (in the `inkscape:label` SVG attribute sense) - `vp:page_size`: the page size (formerly stored as an instance attribute to the `vp.Document` class - The `show` and `write` command now take into account the above layer system properties. - The page size related commands (`pagesize` and `layout`) now act on the `vp:page_size` global system property. - New, high-level commands are introduced to interact with the new layer system properties: - `name`: sets the name of a given layer - `color`: changes the color for a given layer - `penwidth`: changes the pen-width of a given layer - `pens`: apply a pre-defined set of per-layer name, color, and/or pen width to the pipelines, based on a template defined in a config file (`rgb` and `cmyk` templates are bundled in the new config file) - In addition to populating the system properties (when possible), the `read` command now extracts a number of SVG attributes and stores them as properties (prefixed with `svg:`). - Optionally, the `write` command can attempt to restore those properties when possible. Note: since properties are per layer, SVG attributes are saved only if they are shared by *all* the geometries contained in a given layer. - The layer operation commands are updated to handle metadata: - When a single source layer is specified and `--prob` is not used, the `lcopy` and `lmove` commands now copy the source layer's properties to the destination layer (possibly overwriting existing properties). - When `--prob` is not used, the `lswap` command now swaps the layer properties as well. - These behaviours may be disabled with the `--no-prop` option. - API changes: `vpype.Document` and `vpype.LineCollection` have been extended to support operation on their metadata (through the use of a mix-in class) - the bundled config file is renamed to `vpype_config.toml` (since it's no longer specific to HPGL features) - `stat` command now display all the metadata in the pipeline - added a warning when a layer passed to `--layer` doesn't exist - tests: added a few SVG test cases - doc: several addition/changes relative to metadata - doc: some minor fixes Fixes #145 and #213
- Loading branch information
Showing
42 changed files
with
1,955 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,3 +146,5 @@ cython_debug/ | |
/my_work | ||
/pip-wheel-metadata | ||
/test_report_img_sim/ | ||
/*.svg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.