I need to find the width, in pixels, of a string displayed with some font. I know that I can do:
dzen2-textwidth \ -adobe-times-medium-r-normal--8-80-75-75-p-44-iso8859-1 \ "A Tale of Two Cities"
(this command comes from the
However, this doesn't support Xft. I want to be able to use the Xft font format, like "Droid Sans:size=12".
Is there a program that let me do this?
(It goes without saying that it should support Unicode, because I'm not using English. But I guess that anything that supports Xft is modern enough to support Unicode.)
I understand that I could write a program myself (using Ruby / Python / Haskell / NodeJS) if I have GTK/Pango/Whatever bindings, but first I want to see if there's a ready made program (A program in C/C++ is always better for me as I'm using a relatively slow computer and for scripts there's a long starting time (for this reason, BTW, Java is out of the question).