View Single Post
Old 03-04-2011, 09:58 AM   #1
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,731
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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?
kiwidude is offline   Reply With Quote