472,334 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,334 software developers and data experts.

Problem loading true-type font with PIL

After switching from Python 2.3 to 2.4 (Enought),
PIL throws an exception that did not occur formerly
(under Python 2.3) when executing

ImageFont.truetype(font, size)

where font = "C:/Windows/Fonts/comic.TTF".

Here is the traceback that results:

Traceback (most recent call last):
File "Gen\gen.py", line 808, in ?
mylabeler = labeler.Labeler(szNavigFont, iNavigFontSize)
File "E:\Homepage\Gen\labeler.py", line 11, in __init__
self._font = ImageFont.truetype(font, size)
File "C:\Python24\lib\site-packages\PIL\ImageFont.py", line 202, in
truetype
return FreeTypeFont(filename, size, index, encoding)
File "C:\Python24\lib\site-packages\PIL\ImageFont.py", line 120, in
__init__
import _imagingft
ImportError: No module named _imagingft

A module seems to be missing: do I have to install something
in addition to PIL in order to be able to load true-type fonts?

Could someone (more knowledgeable than myself as regards PIL
and this true-type font loading business) please point me
in the right direction?

Many thanks in advance,
Christian Stapfer

Sep 1 '06 #1
5 3053
Christian Stapfer" <ni*@dev.nulwrote in message
news:e3***************************@news.hispeed.ch ...
After switching from Python 2.3 to 2.4 (Enought),
^^^^^
I mean: Python Enthought Edition--Python 2.4.3 for Windows,
sorry for that.

I see in the documentation for PIL that an additional
module is needed: but I don't see where I can get
it from. I'd expected that the Python Enthought Edition
--Python 2.4.3 for *Windows* would include that module....

Regards,
Christian STapfer

Sep 1 '06 #2
Christian Stapfer wrote:
After switching from Python 2.3 to 2.4 (Enought),
PIL throws an exception that did not occur formerly
(under Python 2.3) when executing

ImageFont.truetype(font, size)
<snip/>
A module seems to be missing: do I have to install something
in addition to PIL in order to be able to load true-type fonts?
<snip/>

Problem "solved" by rudely installing PIL 1.1.5 for Windows and
Python 2.4 from http://www.pythonware.com/products/pil/
right on top of my existing "Python Enthought Edition--Python
2.4.3 for Windows". This might have destroyed the consistency
of the overall installation, of course. I'm well punished
for installing Enthought Python 2.4.3: Next time I will again
install all packages that I need myself, as I did for Python
2.3, instead of using a prepackaged distribution like Enthought
Python.

Regards (and sorry for having bothered you with my silly
posts about this problem),
Christian Stapfer

Sep 2 '06 #3
Christian Stapfer wrote:
Problem "solved" by rudely installing PIL 1.1.5 for Windows and
Python 2.4 from http://www.pythonware.com/products/pil/
right on top of my existing "Python Enthought Edition--Python
2.4.3 for Windows". This might have destroyed the consistency
of the overall installation, of course. I'm well punished
for installing Enthought Python 2.4.3: Next time I will again
install all packages that I need myself, as I did for Python
2.3, instead of using a prepackaged distribution like Enthought
Python.
Since the truetype extension is quite popular, and from what I'm told
worked just fine in earlier Enthought releases, this is probably just an
accidental omission. I'm sure the Enthought people will fix this if you
report it to them.

</F>

Sep 3 '06 #4
Fredrik Lundh wrote:
Christian Stapfer wrote:
>Problem "solved" by rudely installing PIL 1.1.5 for Windows and
Python 2.4 from http://www.pythonware.com/products/pil/
right on top of my existing "Python Enthought Edition--Python
2.4.3 for Windows". This might have destroyed the consistency
of the overall installation, of course. I'm well punished
for installing Enthought Python 2.4.3: Next time I will again
install all packages that I need myself, as I did for Python
2.3, instead of using a prepackaged distribution like Enthought
Python.

Since the truetype extension is quite popular, and from what I'm told
worked just fine in earlier Enthought releases, this is probably just an
accidental omission. I'm sure the Enthought people will fix this if you
report it to them.
https://svn.enthought.com/enthought/ticket/864

The person who builds the Enthought Edition releases is out on vacation this
week, so a new release will probably wait until he comes back. In the meantime,
installing Fredrik's binaries on top of ours should work just fine.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Sep 3 '06 #5
Robert Kern wrote:
Fredrik Lundh wrote:
>Christian Stapfer wrote:
>>Problem "solved" by rudely installing PIL 1.1.5 for Windows and
Python 2.4 from http://www.pythonware.com/products/pil/
right on top of my existing "Python Enthought Edition--Python
2.4.3 for Windows". This might have destroyed the consistency
of the overall installation, of course. I'm well punished
for installing Enthought Python 2.4.3: Next time I will again
install all packages that I need myself, as I did for Python
2.3, instead of using a prepackaged distribution like Enthought
Python.

Since the truetype extension is quite popular, and from what I'm told
worked just fine in earlier Enthought releases, this is probably just an
accidental omission. I'm sure the Enthought people will fix this if you
report it to them.

https://svn.enthought.com/enthought/ticket/864

The person who builds the Enthought Edition releases is out on vacation
this week, so a new release will probably wait until he comes back. In the
meantime, installing Fredrik's binaries on top of ours should work just
fine.
Great! - if it does. (Your words in God's ear...) Sorry about leaving out
some details about the release I installed. Maybe the following helps?

C:\Python24\Enthought\Doc>python
Python 2.4.3 - Enthought Edition 1.0.0 (#69, Aug 2 2006, 12:09:59) [MSC
v.1310 32 bit (Intel)] on win32

Perhaps not. Since I have already deleted the Windows installer, and do not
know of any other way to get Enthought-specific version info, this is all I
can
offer at the moment... (I had downloaded the installer from
http://code.enthought.com/enthon/
on August 31, around 06:00 GMT. I suppose this means that it was
enthon-python2.4-1.0.0.exe, but cannot verify anymore whether it was this
specific installer that I used - or not.)

Best regards and thanks for your reply,
Christian Stapfer

Sep 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Merlin | last post by:
Hi there, I have a problem with opening new windows with JS. If the webpage did not complete loading due to any reason a click on a link which is...
9
by: tym | last post by:
HELP!!! I'm going round the twist with this... I have a VB6 application which is using DAO to access a database (Please - no lectures on ADO,...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My...
0
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the...
3
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the...
18
by: Derek Martin | last post by:
Hi there, this is probably really dumb, but I am using a dialog as my main form and my startup form is my splash screen - which implements some...
15
by: Mike Fellows | last post by:
im running the code below when a new item is selected within a combobox the code runs fine but when it gets to me.close it crashes - it doesnt start...
1
by: Santosh | last post by:
Dear all I am writting following code for binding data to the header template of the datagrid on the button click event. but it gives me an error...
6
by: Shigun | last post by:
On a website I am working on I am trying to load another page into a div on the the page the user does his work from. What I have works correctly in...
0
by: ndedhia1 | last post by:
I am having trouble loading a property file and keep getting this error when running my shell script that loads and runs my jar files, etc: no...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.