denham2010
July 29th, 2008, 08:04 AM
Hi,
I am trying to do some image manipulation in Python by adding text to existing images.
I am using the imported modules Image, ImageDraw and ImageFont.
Now adding the text to the image is the easy part. The problem I am having is I need to allow the user to select a font, using the gtk.FontSelectionDialog widget. With this, I am able to get the name of the selected font, but not the path to the selected font's .ttf file.
To set the font using ImageFont, I need the path to the .ttf font file.
I have searched for hours on google and a variety of forums, but have not been able to find a solution.
Hoping someone can help me to work out how to get the selected font's path (from a gtk.FontSelectionDialog) in python so I can pass it to ImageFont.
Thanks for your assistance.
I am trying to do some image manipulation in Python by adding text to existing images.
I am using the imported modules Image, ImageDraw and ImageFont.
Now adding the text to the image is the easy part. The problem I am having is I need to allow the user to select a font, using the gtk.FontSelectionDialog widget. With this, I am able to get the name of the selected font, but not the path to the selected font's .ttf file.
To set the font using ImageFont, I need the path to the .ttf font file.
I have searched for hours on google and a variety of forums, but have not been able to find a solution.
Hoping someone can help me to work out how to get the selected font's path (from a gtk.FontSelectionDialog) in python so I can pass it to ImageFont.
Thanks for your assistance.