GenericMappingTools / GenericMappingTools/gmt

Ability to change line cap and join on a per-pen basis

Open
#5,335 0 comments 0 reactions 1 assignee Claimed by @PaulWessel View on GitHub
feature request
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

**Description of the desired feature**

See this forum [example](https://forum.generic-mapping-tools.org/t/legend-questions/1793/2) to illustrate a current weakness: Inability to switch PostScript line cap and join settings for given pens within a module, since these are under the control of GMT settings **PS_LINE_CAP** and **PS_LINE_JOIN**. The only real solution for getting this to work well is for the pen specification _width_[,_color_][,_style_] to acquire a way to indicate a change in cap or join.

To recap (no pun intended), we have

**PS_LINE_CAP**: **b**utt, **r**ound, **s**quare [**b**]
**PS_LINE_JOIN**: **m**iter, **r**ound, **b**evel [**m**]

Perhaps one way would be to extend the style argument to take optional modifiers **+ab**|**r**|**s** and **+jm**|**r**|**b**?

An example would be `-W4p,orange,0_8+ar`, yielding

![GMT_linecap](https://user-images.githubusercontent.com/26473567/122111153-18961700-cdbb-11eb-8c31-27618224cbd6.png)

This means the internal GMT pen structure will need to carry these flags and call the required PostScript operators when we set a pen. Comments, @GenericMappingTools/core ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.