Is there any way I can use settextcolor to change text color for certain characters within a line of text. That is, certain words need to be a different color.
When I print one section of text, I terminate the print statement with a ";". That means that the //settextcolor command that follows to change the color for the next section of text is at the end of the line, and is not acted upon as a PDFX command.
The trick for changing GDI settings (color, font, etc.) in the middle of a line is somewhat buried in the documentation ( Writing GDI Directives - 6th bullet point), but it is similar to UNIX shell prompt syntax, i.e. ending a line with a backslash holds the position:
Code
//;test changing color in middle of line
//SETMAPMODE,LOENGLISH
//SETTEXTCOLOR,0,0,255
This is blue, \
//SETTEXTCOLOR,255,0,0
this is red, \
//SETTEXTCOLOR,0,0,255
back to blue.
//SETTEXTCOLOR,0,0,0
And this is black.
Perhaps it would be nice to implement some kind of HTML/CSS-like shortcut to make it a bit simpler to toggle betweeen effects in the middle of a line?