MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / win32FontDirectory

Function win32FontDirectory

lib/matplotlib/font_manager.py:204–218  ·  view source on GitHub ↗

r""" Return the user-specified font directory for Win32. This is looked up from the registry key :: \\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Fonts If the key is not found, ``%WINDIR%\Fonts`` will be returned.

()

Source from the content-addressed store, hash-verified

202
203
204def win32FontDirectory():
205 r"""
206 Return the user-specified font directory for Win32. This is
207 looked up from the registry key ::
208
209 \\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Fonts
210
211 If the key is not found, ``%WINDIR%\Fonts`` will be returned.
212 """ # noqa: E501
213 import winreg
214 try:
215 with winreg.OpenKey(winreg.HKEY_CURRENT_USER, MSFolders) as user:
216 return winreg.QueryValueEx(user, 'Fonts')[0]
217 except OSError:
218 return os.path.join(os.environ['WINDIR'], 'Fonts')
219
220
221def _get_win32_installed_fonts():

Callers 1

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…