PIL pilfont.py

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daewon YOON

    #1

    PIL pilfont.py

    Hi.

    I tried to convert a bdf file using pilfont.py script. Instead producing
    pretty font images, it complained like following.

    **
    daewian:~/fonting$ ./pilfont.py gulim24.bdf
    gulim24.bdf...
    Traceback (most recent call last):
    File "./pilfont.py", line 47, in ?
    p.save(f)
    File "/usr/lib/python2.3/site-packages/PIL/FontFile.py", line 105, in
    save1
    self.bitmap.sav e(os.path.split ext(filename)[0] + ".pbm", "PNG")
    AttributeError: 'NoneType' object has no attribute 'save'
    **

    Gulim is a korean font with KSX encoding.
    The script worked fine with a ntimb08.bdf. So I suspect the script
    doesn't like non-latin
    characters.

    Can anybody help me?

    BTW, my previous problem with truetype() was solved. Some ttf files work and
    others don't.

    --
    zooy
  • Daewon YOON

    #2
    Re: PIL pilfont.py

    Daewon YOON wrote:[color=blue]
    > Hi.
    >
    > I tried to convert a bdf file using pilfont.py script. Instead producing
    > pretty font images, it complained like following.
    >
    > **
    > daewian:~/fonting$ ./pilfont.py gulim24.bdf
    > gulim24.bdf...
    > Traceback (most recent call last):
    > File "./pilfont.py", line 47, in ?
    > p.save(f)
    > File "/usr/lib/python2.3/site-packages/PIL/FontFile.py", line 105, in
    > save1
    > self.bitmap.sav e(os.path.split ext(filename)[0] + ".pbm", "PNG")
    > AttributeError: 'NoneType' object has no attribute 'save'
    > **
    >
    > Gulim is a korean font with KSX encoding.
    > The script worked fine with a ntimb08.bdf. So I suspect the script
    > doesn't like non-latin characters.
    >
    > Can anybody help me?
    >
    > BTW, my previous problem with truetype() was solved. Some ttf files
    > work and others don't.
    >
    > --
    > zooy[/color]

    Solved by myself.
    Changed '256's in FontFile of FontFile.py to 256 * 256. Then the
    sciprt produced pretty .pbm file.

    --
    zooy

    Comment

    Working...