[reportlab-users] Pythonpoint - Fonts

Paul Okop paul_okop at mail.ru
Wed Apr 16 09:30:26 EDT 2008




> The pythonpoint demo is a bit creaky at present as not many people seem to be

> actively using it. The standard styles are set using a style object see eg the

> pythonpoint/styles directory. Then in the document you need to use your stylesheet

>

> eg

>

> <stylesheet module="standard" function="getParagraphStyles"/>

>

> that effectively defines a bunch of styles lik

>

> Heading1 BodyText etc etc.

>

> Hope this is enough to get started.

> --

> Robin Becker

>



I,ve got an XML containing utf8-text(in Cyrillic) and i've got T1 font(Cyrillic). How can I "import" my font to pythonpoint so I could get PDF-file with my font included in it. Defining font in slyle-module didn't work. Here is the error-log:

Traceback (most recent call last):
File "pythonpoint.py", line 1124, in <module>
main()
File "pythonpoint.py", line 1119, in main
process(file, notes, handout, printout, cols, verbose, options['outDir'], fx=fx)
File "pythonpoint.py", line 984, in process
return _process(rawdata, datafilename, notes, handout, printout, cols, verbose, outDir, fx)
File "pythonpoint.py", line 1006, in _process
pdfcontent = pres.save()
File "/usr/lib/python2.5/site-packages/reportlab/tools/pythonpoint/pythonpoint.py", line 449, in save
return self.saveAsPresentation()
File "/usr/lib/python2.5/site-packages/reportlab/tools/pythonpoint/pythonpoint.py", line 388, in saveAsPresentation
slide.drawOn(canv)
File "/usr/lib/python2.5/site-packages/reportlab/tools/pythonpoint/pythonpoint.py", line 560, in drawOn
frame.drawOn(canv)
File "/usr/lib/python2.5/site-packages/reportlab/tools/pythonpoint/pythonpoint.py", line 589, in drawOn
story.append(thingy.getFlowable())
File "/usr/lib/python2.5/site-packages/reportlab/tools/pythonpoint/pythonpoint.py", line 612, in getFlowable
self.bulletText
File "/usr/lib/python2.5/site-packages/reportlab/platypus/paragraph.py", line 523, in __init__
self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
File "/usr/lib/python2.5/site-packages/reportlab/platypus/paragraph.py", line 545, in _setup
style, frags, bulletTextFrags = _parser.parse(text,style)
File "/usr/lib/python2.5/site-packages/reportlab/platypus/paraparser.py", line 808, in parse
self.feed(text)
File "/usr/lib/python2.5/site-packages/reportlab/lib/xmllib.py", line 101, in feed
self.goahead(0)
File "/usr/lib/python2.5/site-packages/reportlab/lib/xmllib.py", line 167, in goahead
k = self.parse_starttag(i)
File "/usr/lib/python2.5/site-packages/reportlab/lib/xmllib.py", line 342, in parse_starttag
self.finish_starttag(tag, attrdict)
File "/usr/lib/python2.5/site-packages/reportlab/lib/xmllib.py", line 379, in finish_starttag
self.handle_starttag(tag, method, attrs)
File "/usr/lib/python2.5/site-packages/reportlab/lib/xmllib.py", line 413, in handle_starttag
method(attrs)
File "/usr/lib/python2.5/site-packages/reportlab/platypus/paraparser.py", line 577, in start_para
self._stack = [self._initial_frag(attr,_paraAttrMap)]
File "/usr/lib/python2.5/site-packages/reportlab/platypus/paraparser.py", line 571, in _initial_frag
frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
File "/usr/lib/python2.5/site-packages/reportlab/lib/fonts.py", line 68, in ps2tt
raise ValueError, "Can't map determine family/bold/italic for %s" % psfn
ValueError: Can't map determine family/bold/italic for cyrveticaextra

So, is there any way to make it work?

_________
Paul Okop


More information about the reportlab-users mailing list