|
62 | 62 | X11FontDirectories = [ |
63 | 63 | # what seems to be the standard installation point |
64 | 64 | "/usr/X11R6/lib/X11/fonts/TTF/", |
| 65 | + # documented as a good place to install new fonts... |
| 66 | + "/usr/share/fonts/", |
65 | 67 | # common application, not really useful |
66 | 68 | "/usr/lib/openoffice/share/fonts/truetype/", |
67 | | - # documented as a good place to install new fonts... |
68 | | - "/usr/share/fonts/"] |
| 69 | + ] |
69 | 70 |
|
70 | 71 | OSXFontDirectories = [ |
71 | 72 | "/Library/Fonts/", |
@@ -164,24 +165,17 @@ def OSXInstalledFonts(directory=None, fontext=None): |
164 | 165 |
|
165 | 166 | def x11FontDirectory(): |
166 | 167 | """Return the system font directories for X11.""" |
| 168 | + fontpaths = [] |
| 169 | + def add(arg,directory,files): |
| 170 | + fontpaths.append(directory) |
167 | 171 |
|
168 | | - chkfont = '/usr/sbin/chkfontpath' |
169 | | - if os.path.isfile(chkfont): |
170 | | - fontpaths = os.popen(chkfont).readlines() |
171 | | - return [p.split(':')[1].strip() for p in fontpaths if \ |
172 | | - p.find(': /') >= 0] |
173 | | - else: |
174 | | - fontpaths = [] |
175 | | - #def add(arg, directory, files): |
176 | | - def add(arg,directory,files): |
177 | | - fontpaths.append(directory) |
178 | | - for fontdir in X11FontDirectories: |
179 | | - try: |
180 | | - if os.path.isdir(fontdir): |
181 | | - os.path.walk(fontdir, add, None) |
182 | | - except (IOError, OSError, TypeError, ValueError): |
183 | | - pass |
184 | | - return fontpaths |
| 172 | + for fontdir in X11FontDirectories: |
| 173 | + try: |
| 174 | + if os.path.isdir(fontdir): |
| 175 | + os.path.walk(fontdir, add, None) |
| 176 | + except (IOError, OSError, TypeError, ValueError): |
| 177 | + pass |
| 178 | + return fontpaths |
185 | 179 |
|
186 | 180 | def findSystemFonts(fontpaths=None, fontext='ttf'): |
187 | 181 |
|
|
0 commit comments