[fontforge-devel] cannot generate bitmap through python interface

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[fontforge-devel] cannot generate bitmap through python interface

Pierre Hanser
Forwarded from fontforge-users were bitmap fonts seem deprecated

the question is nearly general about the python interface, as there are
many other usages for tuples in the interface.


I've a really small python script that tries to generate a BDF file from
a ttf one

#!/usr/bin/env python

import sys, fontforge

def do1file(filename):
    font = fontforge.open(filename)

    size = 23
    bpp = 4
    u = tuple((((bpp << 16) + size), 25))
    print u, type(u)

    print "before", font.bitmapSizes
    font.bitmapSizes = u
    print "after", font.bitmapSizes

    print "regenerated"

    font.generate("u.bdf", bitmap_resolution=100)

for name in sys.argv[1:]:

and the output is:

(262167, 25) <type 'tuple'>
before ()
Traceback (most recent call last):
  File "./any2bdf.py", line 30, in <module>
  File "./any2bdf.py", line 18, in do1file
    font.bitmapSizes = u
SystemError: new style getargs format but argument is not a tuple

I do not understand why my tuple is not recognized as such!

Any idea?

I use git current version of fontforge.

If I do it in graphical interface, as long as I defined LANG=C before
running fontforge, I can get the BDF correctly.

There is still the bug that if I run fontforge with LANG=fr_FR.UTF-8
the generation fails because the matching of bitmap sizes never succeed.
But this is not my current subject.


What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
fontforge-devel mailing list
[hidden email]