RFE: 'hairline' stroke-width

Bug #1016763 reported by stelt
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
New
Wishlist
Unassigned

Bug Description

In some graphical programs you can use a so-called hairline.
That is a stroke-width with a special meaning.

In the settings one could define the actual stroke-width with units per drawing (defaulted from general settings).
In the SVG code it would mean using the value defined for the hairline, with 'hairline' mentioned in the metadata for every use.

At 'my' fablab there's a lasercutter that can burn the surface of the material you put in a little, depending on which grey-value you 'print'.
If however you use a hairline (of in this case 0.01mm) , it cuts through the material.

A different 'printerdriver' for a different machine might use a different value for recognizing the hairline.

Tags: printing win32
Revision history for this message
su_v (suv-lp) wrote :

Duplicate of Bug #448286 “non-scaling stroke width”?
<https://bugs.launchpad.net/inkscape/+bug/448286>

Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
stelt (1k7ntz9af-g4t) wrote :

I'd say they're related, but not the same

Revision history for this message
su_v (suv-lp) wrote :

(tags added based on discussion on #inkscape (irc channel):
 Possibly related to bug #966244 and bug #630639)

tags: added: printing win32
Revision history for this message
Hans L (thehans) wrote :

I know for example that Postscript and PDF support "hairline" by setting stroke width to 0. When viewed in most PS/PDF viewers this displays the line as 1pixel wide no matter how zoomed you are.

When you import a PDF with hairlines into inkscape, the hairlines are not shown, and if you re-save the file, the hairlines appear to be deleted in the result.

It seems that inkscape is geared mostly towards SVG which does not support hairlines, but it would be nice to be able to support this very useful feature for vector file formats that allow it.

I have attached a pdf of a protractor which I have generated using python PyX library. All the lines are set as hairlines for laser cutter usage. The hairlines view as expected in adobe Reader 9 and evince on Ubuntu 13.04. I wanted to use inkscape to combine this with another vector logo file, but cannot use it due to the above mentioned issue.

Revision history for this message
Alvin Penner (apenner) wrote :

- was this originally a pdf file or a svg file? If it was originally an svg file, would it be possible to assign it a non-zero stroke width like 0.01 mm? Inkscape will display narrow line widths of this type. In order to see them easily you may need to use Outline mode display. Click on the menu item View->Display Mode->Outline. In this mode, the Fill will not show, but the Stroke will.

- In Inkscape's outline mode the above imported protractor.pdf shows the hairline strokes completely as far as I can tell. The problem is they have no stroke width and no color. A typical hairline stroke in this diagram has the style property given by

fill:none;stroke:none

In order to display this normally in Inkscape, it would be necessary to edit the line so that it looked something like this:

fill:none;stroke:#000000;stroke-width:0.008;

Could this be done in your Python program?

Revision history for this message
Hans L (thehans) wrote :

Alvin, the pdf was generated directly from python script, it was not an svg beforehand. The PyX library I am using outputs only to PDF, PS and EPS file formats.

I can change the script to draw a very small width line instead of 0, but I'm not 100% sure the laser cutter driver will interpret this how I need it to. The hairline strokes I am using do have a color assigned to them by the way, if you load them in evince or acrobat for example you can see this.

Revision history for this message
Alvin Penner (apenner) wrote :

I just realized the behaviour in recent Inkscape trunk is somewhat different than in Inkscape 0.48.4. Attached is the svg file obtained when importing into Inkscape rev 12287. The thin line color appears to be correct and the hairlines have a line width of 1 px. As far as I can tell, the 1 px linewidth is the default that is used if no linewidth is specified. In this case, it would probably be worthwhile to specify a width explicitly.

Revision history for this message
Rick-firefang (rick-firefang) wrote :

It's not quite the hairline feature you're asking for, but I created a patch for a new display mode that makes "hairlines" (anything smaller than half a pixel on screen) more visible: https://gitlab.com/inkscape/inkscape/merge_requests/365

I also submitted a patch to win32 Cairo so that it properly sends anything smaller than the device's smallest unit size as a hairline (0.001" works) so you can print directly to laser printers now: https://lists.cairographics.org/archives/cairo/2018-October/028767.html

Revision history for this message
Rick-firefang (rick-firefang) wrote :

I've submitted a merge request for this feature here: https://gitlab.com/inkscape/inkscape/merge_requests/846

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.