Skip to content

Commit

Permalink
[README.md] Modify the code example to use the new exception
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Apr 29, 2023
1 parent a94c7c8 commit a3c95a8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ pip install FindSystemFontsFilename

## How to use it
```python
from find_system_fonts_filename import get_system_fonts_filename
from find_system_fonts_filename import get_system_fonts_filename, FontConfigNotFound, OSNotSupported

fonts_filename = get_system_fonts_filename()
try:
fonts_filename = get_system_fonts_filename()
except (FontConfigNotFound, OSNotSupported):
# Deal with the exception
# OSNotSupported can only happen in Windows and macOS
# - Windows Vista SP2 and more are supported
# - macOS 10.6 and more are supported
# FontConfigNotFound can only happen on Linux when Fontconfig could't be found.
pass
```

0 comments on commit a3c95a8

Please sign in to comment.