Bug #721

Font outline in GMT5

Added by Remko over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:2015-06-30
Priority:NormalDue date:
Assignee:Remko% Done:


Category:-Estimated time:2.00 hours
Target version:Candidate for next bugfix release
Affected version:5.2-svn Platform:


This is a bug report related to forum question http://gmt.soest.hawaii.edu/boards/1/topics/2239 by Eric.

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.

Associated revisions

Revision 14454
Added by Remko over 1 year ago

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.

Revision 14456
Added by Remko over 1 year ago

Add option to use -F+f<font>==<pen> which produces the original outline font prior to fixing issue #721

Revision 14488
Added by Remko over 1 year ago

Revert part of r14454. That is: restore PSL_plottext to the way GMT5 has been dealing with outlined text for years, but added mode==3 to allow compatibility with GMT4.
This addresses issue #721.

Revision 14489
Added by Remko over 1 year ago

Replaced option -F+f<font>==<pen> by -F+f<font>=~<pen>. Reverts font outline to what it was in GMT5, use =~ for GMT4 style.
This addresses issue #721


#1 Updated by Remko over 1 year ago

r14454 fixed this in GMT 5.1.x
r14455 fixed this in GMT 5.2.x
GMT 5.2.x will be given a feature to be able to obtain the previous "inelegant" behaviour.

#2 Updated by Remko over 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

#3 Updated by Remko over 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

r14456 implements (in GMT 5.2) the "inelegant" solution we had before.

#4 Updated by Remko over 1 year ago

Note that r14488 and r14489 revert the font outlining to what it was in GMT5 (i.e. partially overlapping the font fill).
r14489 adds the option to use the GMT4 behavior to pstext by using -F+f<font>=~<pen> (in GMT5.2 only).

#5 Updated by Remko over 1 year ago

  • Status changed from Resolved to Closed
  • Affected version changed from 5.1.x to 5.2-svn

Also available in: Atom PDF