Cairo text functions discrepancies

I am testing the different text drawing functions in Cairo.jl: show_text, text, and text_path. The text function is the only one that produces the wrong size and is positioned at a distance from the insertion point (see below).

Is this a Cairo bug or a feature?

The Cairo manual says that toy functions are not meant for serious work, but they seem to exhibit the expected behavior. I also noticed that Makie uses the toy functions instead of text.

image

This is more likely something to do with Pango, because Cairo.text() passes all text layout tasks to pango_layout_set_text (). I expect a Pango layout will look slightly different to a single line of text drawn with the Toy text API.

In Makie we compute the glyph layout separately, then it doesn’t really matter if I use the pro or toy API to draw the glyphs one by one.