[FIX] rml2pdf: use glob instead of listdir to match on '/usr/share/fonts/TTF/*/*.ttf'

bzr revid: mat@openerp.com-20131203161516-c118p7bmztuyrwlr
This commit is contained in:
Martin Trigaux 2013-12-03 17:15:16 +01:00
parent 30c3f13ab7
commit e012bbb2d4
1 changed files with 4 additions and 7 deletions

View File

@ -21,10 +21,9 @@
##############################################################################
from reportlab import rl_config
from reportlab.lib import fonts
from reportlab.pdfbase import pdfmetrics, ttfonts
import logging
import os,platform
import glob
import os
# .apidoc title: TTF Font Table
@ -95,10 +94,8 @@ def list_all_sysfonts():
# TTFOpenFile is not very good at it.
searchpath = list(set(TTFSearchPath + rl_config.TTFSearchPath))
for dirname in searchpath:
dirname = os.path.expanduser(dirname)
if os.path.exists(dirname):
for filename in [x for x in os.listdir(dirname) if x.lower().endswith('.ttf')]:
filepath.append(os.path.join(dirname, filename))
for filename in glob.glob(os.path.expanduser(dirname)+'/*.[Tt][Tt][Ff]'):
filepath.append(filename)
return filepath
def SetCustomFonts(rmldoc):