library for text rendering that supports text-on-p

2019-02-20 14:54发布

问题:

I need a good, reliable library or toolchain for programatically rendering text to png, with different sizes, fonts, weights, etc. It also needs to be able to render text in an arc or to a path. I would like it to be fast, because I'd be running it as on a server.

I've tried using SVG and librsvg, but that doesn't render <textPath> elements.

I've tried pycairo, but again, the text to path doesn't work great, and everywhere in the cairo documentation it mentions that text-to-path is a "toy" and shouldn't be used for serious applications.

Python bindings would be best, because the server runs python. But I'll take any suggestion.

回答1:

Qt has a SVG module, i believe it supports the textPath element.

http://doc.trolltech.com/4.1/qtsvg.html