Dynamic font color selection

I’ve been in similar situations and adopted a different approach – to use the “outline” facility in pstext which draws the outline of the characters. So do that with a white pen a few points wise, then repeat drawing the characters normally, an extract of the code:

# labels

DOTFONT="16,Times-Italic"
DOTOUTLINE="$DOTFONT,-=2p,white"

gmt pstext dots.dat -Dj4p -F+a0+f$DOTOUTLINE+j $PRJ $RNG -K -O >> $PS
gmt pstext dots.dat -Dj4p -F+a0+f$DOTFONT+j $PRJ $RNG -K -O >> $PS

and the result:

Screenshot from 2024-05-16 19-32-59

Full script here.

Cheers

1 Like