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.
()
| 202 | |
| 203 | |
| 204 | def 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 | |
| 221 | def _get_win32_installed_fonts(): |
no test coverage detected
searching dependent graphs…