Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 183401 - dev-python/reportlab needs Type1 Times-Roman font
Summary: dev-python/reportlab needs Type1 Times-Roman font
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 318233
  Show dependency tree
 
Reported: 2007-06-27 13:45 UTC by Martin Mokrejš
Modified: 2010-06-22 22:09 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fonts.txt (fonts.txt,43.93 KB, text/plain)
2007-06-27 13:48 UTC, Martin Mokrejš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2007-06-27 13:45:02 UTC
To use some module for ReportLab I need some Adobe fonts, which I believe are already placed on my Gentoo box. A zip file provided by author of the package at 
http://bioinf.scri.ac.uk/lp/programs.php#genomediagram points to http://bioinf.scri.ac.uk/lp/downloads/programs/genomediagram/linfonts.zip, containing:

$ unzip -t ~mmokrejs/tmp/linfonts.zip 
Archive:  /home/mmokrejs/tmp/linfonts.zip
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/AdobeSansMM.MMM.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/AdobeSansMM.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/AdobeSerifMM.MMM.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/AdobeSerifMM.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Arial-BoldItalic.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Arial-Bold.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Arial-Italic.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Arial.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Courier-BoldOblique.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Courier-Bold.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Courier-Oblique.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Courier.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/Symbol.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/TimesNewRoman-BoldItalic.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/TimesNewRoman-Bold.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/TimesNewRoman-Italic.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/TimesNewRoman.pfb   OK
    testing: usr/lib/python2.3/site-packages/reportlab/fonts/ZapfDingbats.pfb   OK
$

The program itself gives:

$ python generate_image_from_genbank.py 
/usr/lib/python2.4/site-packages/GenomeDiagram/GDLinearDrawer.py:347: DeprecationWarning: integer argument expected, got float
  for marker in range(self.start, self.end, fragment_step):
/usr/lib/python2.4/site-packages/GenomeDiagram/GDLinearDrawer.py:529: DeprecationWarning: integer argument expected, got float
  smallticks = range(self.start, self.end, smallinterval)
Warn: Can't find .pfb for face 'Times-Roman'
Traceback (most recent call last):
  File "generate_image_from_genbank.py", line 23, in ?
    gdd.write('example1.png', 'PNG')
  File "/usr/lib/python2.4/site-packages/GenomeDiagram/GDDiagram.py", line 351, in write
    drawmethod.drawToFile(self.drawing, filename, output, dpi=dpi)
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 591, in drawToFile
    c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, showBoundary=showBoundary)
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 577, in drawToPMCanvas
    draw(d, c, 0, 0, showBoundary=showBoundary)
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 49, in draw
    R.draw(renderScaledDrawing(drawing), canvas, x, y, showBoundary=showBoundary)
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderbase.py", line 200, in draw
    self.initState(x,y)  #this is the push()
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 86, in initState
    self.applyState()
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 80, in applyState
    self._canvas.setFont(s['fontName'], s['fontSize'])
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 358, in setFont
    _setFont(self._gs,fontName,fontSize)
  File "/usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py", line 238, in _setFont
    raise RenderPMError, "Can't setFont(%s) missing the T1 files?\nOriginally %s: %s" % (fontName,s1,s2)
reportlab.graphics.renderPM.RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
Originally exceptions.TypeError: makeT1Font() argument 2 must be string, not None
$
Comment 1 Martin Mokrejš 2007-06-27 13:48:07 UTC
Created attachment 123190 [details]
fonts.txt

I have installed all kinds of font packages I have found in portage, here is the list of the files on my system. Still, no Times-Roman available? Maybe that is a configuration issue, but how can I know? Sorry.

# find /usr/ -name *.pfb > fonts.txt
Comment 2 Martin Mokrejš 2007-06-27 14:00:38 UTC
# find /usr/ -name *.pfb | while read f; do strings $f | grep Times && echo $f; done
%!PS-AdobeFont-1.0: QuasiTimes-Italic 1.07
FontDirectory/QuasiTimes-Italic known{/QuasiTimes-Italic findfont dup/UniqueID known{dup
/FullName(QuasiTimes-Italic)readonly def
/FamilyName(QuasiTimes)readonly def
/FontName /QuasiTimes-Italic def
/usr/share/texmf/fonts/type1/public/qfonts/qtmri.pfb
%!PS-AdobeFont-1.0: QuasiTimes-Regular 1.07
FontDirectory/QuasiTimes-Regular known{/QuasiTimes-Regular findfont dup/UniqueID known{dup
/FullName(QuasiTimes-Regular)readonly def
/FamilyName(QuasiTimes)readonly def
/FontName /QuasiTimes-Regular def
/usr/share/texmf/fonts/type1/public/qfonts/qtmr.pfb
%!PS-AdobeFont-1.0: QuasiTimes-Bold 1.07
FontDirectory/QuasiTimes-Bold known{/QuasiTimes-Bold findfont dup/UniqueID known{dup
/FullName(QuasiTimes-Bold)readonly def
/FamilyName(QuasiTimes)readonly def
/FontName /QuasiTimes-Bold def
/usr/share/texmf/fonts/type1/public/qfonts/qtmb.pfb
%!PS-AdobeFont-1.0: QuasiTimes-BoldItalic 1.07
FontDirectory/QuasiTimes-BoldItalic known{/QuasiTimes-BoldItalic findfont dup/UniqueID known{dup
/FullName(QuasiTimes-BoldItalic)readonly def
/FamilyName(QuasiTimes)readonly def
/FontName /QuasiTimes-BoldItalic def
/usr/share/texmf/fonts/type1/public/qfonts/qtmbi.pfb
#
Comment 3 Lukasz Ligowski 2010-03-06 23:29:07 UTC
Hmm this is three years old now.

It's a bug about program which is not in Portage.

Does not work with dev-python/reportlab-2.3-r1 (needs to install some extension or just simply doesnt work ;) which is oldest version in Portage and description is somewhat vague on "steps to reproduce problem".

Maybe it would be OK to close it?
Comment 4 Martin Mokrejš 2010-03-06 23:46:07 UTC
I think GenomeDiagram was donated into biopython, I wonder what the font requirements are then nowadays. I do not have enough time to look into this now, sorry. :( Is probably documented at biopython.org. ;-)

I would be happy if the ebuild of reportlab or biopython now checks for some package with Adobe T1 fonts, as shown in the original bug report.
Comment 5 Denilson Sá Maia 2010-05-25 04:42:39 UTC
I vote for closing this bug. Reasons:

* The bug itself didn't cite the package versions, so we don't know for sure which reportlab version was affected.
* No clear steps on how to reproduce it.
* Even though tehre were no instructions, I tried to reproduce this bug myself, but everything worked here.

I downloaded and extracted the biopython tarball. Then...
$ cd biopython-1.53/Tests
$ PYTHONPATH=.. python test_GenomeDiagram.py
And all 12 tests ran without failure. (using reportlab-2.4)
Also, all four test_Graphics*.py ran without problems. (and no other test uses reportlab)

Thus, I would close this bug as WORKSFORME.

By the way, this bug should NOT block bug 318233.
Comment 6 Martin Mokrejš 2010-06-22 22:09:04 UTC
It looks one needs to be root to have privs to write results of the tests into /usr/share/biopython/Tests/Graphics. :(( At the moment I have installed biopython-1.54.

# cd /usr/share/biopython/Tests

python run_tests.py test_GenomeDiagram
test_GenomeDiagram ... ok
----------------------------------------------------------------------
Ran 1 test in 16.576 seconds

# ls -la Graphics/
total 1152
drwxr-xr-x  2 root root   4096 Jun 23 00:04 .
drwxr-xr-x 46 root root  16384 Jun 23 00:03 ..
-rw-r--r--  1 root root  31128 Jun 23 00:04 GD_by_meth_circular.pdf
-rw-r--r--  1 root root   9572 Jun 23 00:03 GD_by_meth_linear.pdf
-rw-r--r--  1 root root 651411 Jun 23 00:04 GD_by_obj_circular.pdf
-rw-r--r--  1 root root  24393 Jun 23 00:04 GD_by_obj_linear.pdf
-rw-r--r--  1 root root  18862 Jun 23 00:04 GD_region_circular.pdf
-rw-r--r--  1 root root  49634 Jun 23 00:04 GD_region_circular.svg
-rw-r--r--  1 root root   2830 Jun 23 00:04 GD_region_linear.pdf
-rw-r--r--  1 root root   8333 Jun 23 00:04 GD_region_linear.svg
-rw-r--r--  1 root root   2871 Jun 23 00:04 GD_sigil_arrow_shafts.pdf
-rw-r--r--  1 root root  41854 Jun 23 00:04 GD_sigil_arrow_shafts_c.pdf
-rw-r--r--  1 root root   2922 Jun 23 00:04 GD_sigil_arrows.pdf
-rw-r--r--  1 root root  37548 Jun 23 00:04 GD_sigil_arrows_c.pdf
-rw-r--r--  1 root root   2670 Jun 23 00:04 GD_sigil_arrows_long.pdf
-rw-r--r--  1 root root  50412 Jun 23 00:04 GD_sigil_arrows_long_c.pdf
-rw-r--r--  1 root root   2907 Jun 23 00:04 GD_sigil_arrows_small.pdf
-rw-r--r--  1 root root  31447 Jun 23 00:04 GD_sigil_arrows_small_c.pdf
-rw-r--r--  1 root root   2851 Jun 23 00:04 GD_sigil_labels.pdf
-rw-r--r--  1 root root     97 Jun 13 08:07 README
-rw-r--r--  1 root root   2876 Jun 23 00:04 labels_default.pdf
-rw-r--r--  1 root root  27575 Jun 23 00:04 labels_default_c.pdf
-rw-r--r--  1 root root  43493 Jun 23 00:04 line_graph.pdf
-rw-r--r--  1 root root  50862 Jun 23 00:04 line_graph_c.pdf
#

The .pdf files look fine, so it works now, thanks.