Working with Fonts and Calibre
I'm working on a "Generate Cover" plugin which allows all sorts of customisation of a cover that gets generated. As part of that I wanted to offer the ability for the user to choose fonts for the rendering using magick of the title, author, series.
The issue is whether it is possible to make use of the QFontDialog as a UI for selecting a font to then pass to the drawing code in the magick namespace. As far as I can tell, the magick stuff takes a physical file path, whereas a QFontDialog gives you a QFont from which you get a font family.
Is there any suggested way of reconciling the two? In a cross platform way? I saw some code via Google which queried the registry for font matches but obviously that is a windows only option.
Or should I just use a file chooser dialog and get the user to navigate to a .ttf file instead?
|