mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Font scanner: Also scan the new win 10 local font paths
Fixes #1888798 [Additional Windows 10 font directory location (v 1809)](https://bugs.launchpad.net/calibre/+bug/1888798)
This commit is contained in:
parent
742187742a
commit
9b386b6a46
@ -103,10 +103,16 @@ def font_dirs():
|
||||
winutil, err = plugins['winutil']
|
||||
if err:
|
||||
raise RuntimeError('Failed to load winutil: %s'%err)
|
||||
try:
|
||||
return [winutil.special_folder_path(winutil.CSIDL_FONTS)]
|
||||
except ValueError:
|
||||
return [r'C:\Windows\Fonts']
|
||||
paths = {os.path.normcase(r'C:\Windows\Fonts')}
|
||||
for which in (winutil.CSIDL_FONTS, winutil.CSIDL_LOCAL_APPDATA, winutil.CSIDL_APPDATA):
|
||||
try:
|
||||
path = winutil.special_folder_path(winutil.CSIDL_FONTS)
|
||||
except ValueError:
|
||||
continue
|
||||
if which != winutil.CSIDL_FONTS:
|
||||
path = os.path.join(path, r'Microsoft\Windows\Fonts')
|
||||
paths.add(os.path.normcase(path))
|
||||
return list(paths)
|
||||
if isosx:
|
||||
return [
|
||||
'/Library/Fonts',
|
||||
|
Loading…
x
Reference in New Issue
Block a user