setFont vs setFontFamily?
I'm not sure if this is me missing something or if it's due to unclear documentation, but I seem to have problems understanding what setFontFamily does. The function accepts all fonts that are returns by queryFonts, however it fails to render properly in some cases (not all). See below screenshots.
setFontFamily

setFont

You could argue that Courier-10-Pitch-Bold is not a font-family; Courier-10-Pitch is the font family and bold is just a variant (dependent on setFontStyle I suppose). But then why is Courier-10-Pitch not rendered correctly either? And why is Courier-10-Pitch-Bold accepted?
I don't really know.
I've just read the upstream documentation for the underlying library here and I still don't really know.
Could you post the code for your example, and if I get a chance I'll dig into it to have a look.
Theoretically, it should be the same as using font vs font-family in SVG drawings, as SVG is used as the intermediate format that all the drawing commands use before being rendered to pixel based formats.
Code can be found here: https://gist.github.com/ameenross/e8192222a5414b7de4e99c4bb500a253
Change setFont to setFontFamily for the "broken" one.