[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user