Measure Path: Add more layout options for text
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Wishlist
|
su_v |
Bug Description
Interface
=========
The proposed change displays existing and new options for each of the two already existing text layout variants in a separate tab of a notebook inserted into the 'Measure' page of the main notebook.
Usage
=====
The script will use the layout variant of the tab which is current when the extension is live-previewed or applied.
Options
=======
1) Tab 'Text on path'
* Position along path: start|middle|
* Custom position: numeric input, used if Position is 'custom'
* Text anchor: left|center|right
2) Tab 'Fixed text'
* Position: start of path|center of geometric bbox
* Angle
The core features of the extensions are not modified.
Motivation
==========
Earlier commits introduced changes to the text layout which (in my opinion) are less beneficial for some basic use cases of the extension:
1) Length:
The text label for a measured length is no longer center-aligned at the midpoint of the measured path it is put on (the text is currently left-aligned i.e. it starts at the midpoint, apparently to avoid bent text when measuring polylines). This is visually displeasing when using the 'Measure Path' extension e.g. in combination with the 'Dimensioning' extension, or in general when measuring the length of lines with just one segment. The proposed change adds options to allow more fine-grained control of the position and alignment of the text put-on-path.
2) Area:
The text label for a measured area is no longer inserted near the center of the measured path (it can be positioned as 'text-put-on-path', see 1), or as "text with fixed angle" near the start node of the measured path). The proposed change adds an option to insert the text with fixed angle at the center of the geometric bounding box of the measured path.
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Tested on Windows XP, Inkscape trunk rev. 14206.
Very nice improvements!
Some comments: self.options. startOffsetCust om)
1. Depending on the settings, a text can be truncated or hidden. Example: with Length, Text on Path, position to Start, anchor to Center (truncated) or Right (hidden) .
2. Since we already have a function to calculate the center of mass, maybe we could use it as an option to position fixed text.
3. The custom position option fails with the following error:
----
File "measure.py", line 231, in effect
startOffset = '{}%'.format(
ValueError: zero length field name in format
----