It looks as if the statist package is passing a hard-coded font file 
path to matplotlib:

  C:/OSGeo4W/apps/qgis-dev/python/plugins/statist/font/CharisSILR.ttf


because of the following line in the log:

findfont returning 
C:/OSGeo4W/apps/qgis-dev/python/plugins/statist/font/CharisSILR.ttf

Does this file exist on your system?  In any case, it looks from here 
(without being able to play with all the moving parts) that the bug is 
in statist.py, and matplotlib is just blindly following the request to 
use a particular font.

Cheers,
Mike


Alexander Bruy wrote:
> Thanks for explanation Michael.
>
>    I do more intensive testing and found than this problem have place
> in Windows and Linux in all verions of Qt which I have (4.4.3 and 4.5.2).
> So you are right saying
>   
>> I don't think this is related to Qt at all, but is illustrating some 
>> sort of bug in the font lookup code.
>>     
>
> I try to perform some testing with your instructions
>   
>> Can you try removing fontList.cache and trying again?  I *believe* it 
>> lives in "C:\Documents and Settings\${YOURNAME}\Local 
>> Settings\.matplotlib" on Windows, but I'm not a regular Windows user.  
>> You may have to search for it.
>>     
> I remove fontList.cache and try again. And have this debug output:
>
> Traceback (most recent call last):
>   File "C:\OSGeo4W\apps\qgis-dev\python\plugins\statist\statist.py", line 
> 114, in doCalcStats
>     d = doStatist.dlgStatist( self.iface )
>   File "C:\OSGeo4W\apps\qgis-dev\python\plugins\statist\doStatist.py", line 
> 81, in __init__
>     self.canvas = FigureCanvas( self.figure )
>   File 
> "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\backends\backend_qt4agg.py",
>  line 57, in __init__
>     FigureCanvasQT.__init__( self, figure )
>   File 
> "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\backends\backend_qt4.py",
>  line 103, in __init__
>     self.resize( w, h )
>   File 
> "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\backends\backend_qt4.py",
>  line 171, in resize
>     self.draw()
>   File 
> "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\backends\backend_qt4agg.py",
>  line 133, in draw
>     FigureCanvasAgg.draw(self)
>   File 
> "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\backends\backend_agg.py",
>  line 279, in draw
>     self.figure.draw(self.renderer)
>   File "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\figure.py", 
> line 775, in draw
>     for t in self.texts: t.draw(renderer)
>   File "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\text.py", line 
> 452, in draw
>     bbox, info = self._get_layout(renderer)
>   File "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\text.py", line 
> 246, in _get_layout
>     'lp', self._fontproperties, ismath=False)
>   File 
> "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\backends\backend_agg.py",
>  line 155, in get_text_width_height_descent
>     font = self._get_agg_font(prop)
>   File 
> "C:\OSGeo4W\apps\Python25\lib\site-packages\matplotlib\backends\backend_agg.py",
>  line 195, in _get_agg_font
>     font = FT2Font(str(fname))
> RuntimeError: Could not open facefile 
> C:/OSGeo4W/apps/qgis-dev/python/plugins/statist/font/CharisSILR.ttf; 
> Cannot_Open_Resource
>
> And then
>   
>> Also, set the rcParam['verbose.level'] to 'debug-annoying' and send the 
>> output.  That may provide some clues as to how the font lookup is failing.
>>     
>
> I set rcParam['verbose.level'] to 'debug-annoying' and receive large output 
> (see attachment)
>
> I do this under Windows, but my colleagues have same problem under Linux, so 
> I ask them to
> do same things and can send theirs logs later
>
> -- реклама -----------------------------------------------------------
> Поторопись зарегистрировать самый короткий почтовый адрес @i.ua
> http://mail.i.ua/reg - и получи 1Gb для хранения писем

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to