Mail Archives: geda-user/2018/07/11/23:59:41
Vladimir:
> On Mon, Jul 02, 2018 at 02:55:28PM +0200, karl AT aspodata DOT se wrote:
> > I'm trying to make arrows to be used when writing about electronic
> > design and theory.
...
> > c, use same line width as horiz. line, and use round cap style, i.e.
> > patch gschem/lepton-schematic so that they honor the cap style entry
> > which is currently completely ignored and and an undocumented cap
> > style is used instead (called "miter" in postscript), see [3].
>
> You can mitigate the issue a bit by using a smaller line
> width. The smallest width is 1, since 0 means "default width"
> which is really 10. E.g. use the following path definition line:
>
> H 3 1 0 0 -1 -1 1 -1 -1 -1 -1 -1 4
Having 0 beeing greater that 1 is not sane, better is to set a width > 0
for lines and not allowing 0, and only allow 0 in filled paths.
Another reason for setting line width to > 0 is so that when printed,
the nets and pins have the same line widths.
> > I'd prefer c to happen, since that would solve other line corner to
> > straight line situations.
> >
> > How difficult is that to implement and would such a patch be accepted ?
>
> Dunno. I implemented capstyle support for lines a few years ago
> though some things have changed since then. Please look at
> edacairo.c. You can see how it is currently done for lines, and
> the eda_cairo_path function is the one to play with in this case,
> I believe. You'll probably have to read some docs of how things
> are done with cairo. Your patch will be accepted if it works
> properly.
Seems cairo is used somewhat like postscript, set linewidth etc.
make a path, stroke it.
instead of
cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
in line 385, add
switch (cap) {
case CAIRO_LINE_CAP_BUTT:
cairo_set_line_join (cr, CAIRO_LINE_JOIN_BEVEL);
break;
case CAIRO_LINE_CAP_SQUARE:
cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
break;
case CAIRO_LINE_CAP_ROUND:
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
break;
}
after switch (line_end) { ... }, or perhaps merge thoose two switch
statements. Any preference ?
Since "lines" doesn't have joints, the join setting is only relevant for
paths; and using multiple lines to build up e.g. a triangle, will make
their corners look ugly with the default butt caps style.
> Just open a PR as described at [1] or send it here.
> [1] https://github.com/lepton-eda/lepton-eda/blob/master/CONTRIBUTING.md
That would require me to get a github account and accepting:
https://help.github.com/articles/github-terms-of-service/
https://help.github.com/articles/github-privacy-statement/
I haven't read thoose, and I don't like beeing forced to make a
contract just so I can help.
Wouldn't it be sufficient just publish any patches in the mailing list.
Regards,
/Karl Hammar
-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57
- Raw text -