cannot generate bitmap through python interface
Pierre Hanser <[email protected]> Mon, 30 May 2016 20:07:42 +0200
| Newsgroups | gmane.comp.fonts.fontforge.devel |
|---|---|
| Message-ID | <[email protected]> |
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.
hello
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
font.regenBitmaps(u)
print "regenerated"
font.generate("u.bdf", bitmap_resolution=100)
for name in sys.argv[1:]:
do1file(name)
------------
and the output is:
(262167, 25) <type 'tuple'>
before ()
Traceback (most recent call last):
File "./any2bdf.py", line 30, in <module>
do1file(name)
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.
--
Pierre
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
http://fontforge.10959.n7.nabble.com/Developer-f3.html