FindReplaceDialog

From Inkscape Wiki
Jump to navigation Jump to search

'Find and replace' dialog specification

Synopsis

A function to find an object with defined properties and change these properties to some other ones is quite important in design and drafting workflow.

Several examples:

  • find all text objects where Times New Roman is used, substitute it with DejaVu Serif and move all these text object to a layer called "Text";
  • find all rectangles with horizontal/vertical radius between 50 and 70 and change it to 75;
  • find all stars of a given color with 25+ spikes and randomize them;
  • find all ellipses with given flat fill color and randomize that fill color between a given range of RGB/HSV/CMYK values;
  • find all guides with non-even values and round them.

Defining values

It should be possible to find:

  • an object by its ID;
  • all objects of a precisely given value;
  • all objects with a precisely given value plus a given amount of digits in the fraction;
  • all object below a given value;
  • all object above a given value;
  • all objects between two values.

It should be possible to replace found values with:

  • a precisely given value;
  • a value which a current value + user defined shift (e.g. in guides)
  • a random value in a given range of possible values (all values above X, any value between X and Y).
  • a rounded value with user defined precision.

It should also be possible to:

  • move all found objects to a user defined layer.

Types of replacement actions

Some actions can be performed to any object (such as changing fill/stroke), some are object specific (e.g. a rectangle has no spoke ratio).

Generic actions

  • change fill/stroke;
  • change width/height.
  • change initial XY position.

Object specific actions

All non-path objects

  • object/stroke to path

Path

  • combine/break apart;
  • inset/outset;
  • create dynamic/linked offset;
  • simplify;
  • reverse.

Rectangle

  • change horizontal/vertical radius

3D box

  • toggle VP between finite and infinite in XYZ directions;
  • change angle of PLs in XYZ direction.

Ellipse

  • change start/end angles ('make whole' as preset);
  • switch between segment/arc;

Star

  • toggle polygon/star;
  • change amount of corners;
  • change spoke ratio;
  • change rounding;
  • change randomization.

Spiral

  • change amount of turns;
  • change divergence;
  • change inner radius.

Text

  • change font family;
  • change font style (bolder/lighter in a given number of steps or precisely defined name of style);
  • change font size (a combobox to choose unit measure should be available);
  • change alignment;
  • toggle horizontal/vertical direction;
  • unflow;
  • remove from path;
  • remove manual kerns.

Connector

  • change spacing;
  • change length.

Guide

  • (relative) shift;
  • change angle;
  • delete.

Layer

TODO

User interface

Because it should be possible to define several criteria, suggested is a tiles based GUI, where every tile is a criterion. Or this could be a UI similar to Banshee's smart playlists.

Tiles can be copied and pasted into new ones, so that it should be possible to construct complex criteria like "do something with all text objects with font size between 8 and 10 pt and all text objects with font size over 44 pt".

It should be possible to store criteria as reusable presets. Since in SDI interface model it usually means "rewrite all of my precious settings I've just created and already loved", suggested is a web-browser-like tabbed interface (or Gedit-like, if you prefer), where every preset is opened in a new tab and can be closed.

Inkscape should provide several presets for those who just want to do very simple replacements: replace text to text, replace color to color etc. (this will eliminate at least two existing extension effects).

Since in a complex query number of tiles has all chances in the world to grow in height and width, it could be a good idea to be able to temporarily collapse criteria to a small button or expander or the like.

UI mockup is in works. Patience is a virtue :-)