I’m using dot to re-create handwritten trees, and there are two little things that would make it better:
Can I change the text color within a node? (Edit: Yes! with HTML-like labels.)
I want to add special characters, like schwa and vowels with macrons. (I checked HTML resources, and it doesn’t look like it has encodings for those characters.) Are there codes for special characters besides the three line-breaks? And if so, do I have to choose between special characters and HTML-like labels?
That would be great. I’m gonna need specifics; I’ve tried a lot of things and none of them work. What (Windows) program do I use to edit the source file and how do I make sure it’s a UTF8 format?
digraph nota {
rankdir=LR
{ rank=same
A [label="Entered using Notepad"]
B [label="schwa using html encoding: Ə and ə"]
D [label="Masron examples: Ā ē ū ǡ Ӣ "]
x1[label="https://en.wikipedia.org/wiki/%C6%8F"]
x2[label="https://en.wikipedia.org/wiki/Macron_(diacritic)"]
}
}
As noted, you can use special, non-ascii characters without using HTML-like labels. You can use the UTF-8 encoding explicitly, but as some of the bytes are not ascii, this can be cumbersome depending on the text editor you use. You can avoid non-ascii characters entirely either by using the numeric representation as shown by steveroush above or. if available, a descriptive form. For example, lower-case beta can be represented as either β or β . See the Character Encoding section in the dot lang page.
Note that, by default, Graphviz assumes the input character encoding is UTF-8. The programs can usually infer if this isn’t the case and report it. Also note that for all this to work, the font used in rendering must supply the glyphs you want.
For whatever reason, pasting characters into Notepad and saving works now. The references on this page also work: Character Entities | Graphviz (That page links to two pages on w3.org: the first has the same information, but the second (“an official version of this reference”) is not the same at all and not useful for GV.)
At any rate, problem solved! Thanks for all your help.