New modes of text rendering
|Target version:||Candidate for next minor release|
In PostScript, there are three operations for working with paths - fill, stroke and clip. Using the charpath command, you can get a path for an arbitrary text. The figure font.eps shows the result of applying basic operations and their combinations to text contours. Variants 2-6 can be considered basic, since the rest can be obtained by overlaying them in various combinations. GMT supports variants 1 ([size],[family],-=[width],[line]), 4 ([size],[family],[fill]), and 7 ([size],[family],[fill]=[width],[line]). Variant 8 is also supported, but not documented ([size],[family],[fill]=~[width],[line]). Clipping is not supported in any way.
Variants 7 and 8 are implemented in GMT by overlapping 1 and 4 each other in different order. This works if the colors are opaque. In the case of transparent colors, there is a difference between 1+4 and 3+4, see the figure test.pdf.
I suggest implementing clipping support by adding, for example, the =+ and =- operators. Then variant 2 can look like [size],[family],-=-[width],[line], 3 - [size],[family],-=+[width],[line], and 3+4 as [size],[family],[fill]=+[width],[line].
I also suggest adding the modifier +e[i|n] to the -F option of the text module (similar to the +e modifier for the -A option of contour module), which will implement variants 5 and 6.
I added the =+ and =- functionality in the attached patch. The test script and its output are also attached. In the last two lines of the test output, you can see the new bug of the GMT.