Font outline in GMT5
|Category:||-||Estimated time:||2.00 hours|
|Target version:||Candidate for next bugfix release|
In GMT4, pstext had the option "-S<font>" that provided an outline around the text. For example, to help black text show up on a dark background, you could add "-S2p,white", which would give a nice outline that was drawn underneath the text. This option seems to have been replaced by -F+f<font>=<line>, where the line specification after the "=" gives the outline.
However, this outline now seems to be drawn after the text, which can make the text itself become very thin (or masked altogether) if the outline is wide. For example:gmt pscoast -JM4i -R-10/10/-10/10 -Df -Sgray30 -Ggray -Na -V -K -P > test.ps echo "0 0 hello" | gmt pstext -J -F+f12p,Helvetica-Bold,black=3p,white -R -O -V >> test.ps
Is there a way to make this outline be drawn before/underneath the text, so that the text still shows up? A workaround is to just send the text command twice, but that seems inelegant.
Yes, we can confirm that we broke the compatibility with GMT4 on this one.
This is the result of a change in the PostScript code that we output in this case. The GMT5 code does not write the text twice, as GMT4 automatically did to achieve the result you were used to. Your suggestion of the workaround does exactly that.
We agree with you that the GMT5 implementation is inelegant, and should be changed. Thus, we will work on a fix that hopefully avoids having to write the text twice.
Revert behavior of outlined text in PSL_plottext to the way it was in GMT4 (yet keeping the option to do it the way it was before in GMT5).
This fixes issue #721.
Add option to use -F+f<font>==<pen> which produces the original outline font prior to fixing issue #721