Skip to content

Commit

Permalink
updated docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
richrobe committed Jan 8, 2023
1 parent 1226360 commit f962253
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fau_colors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.4.2"
__version__ = "1.4.3"

from fau_colors._utils import export_as_gpl
from fau_colors.fonts import register_fausans_font
Expand Down
8 changes: 7 additions & 1 deletion fau_colors/fonts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

from matplotlib import font_manager
from matplotlib import pyplot as plt


def register_fausans_font():
Expand Down Expand Up @@ -28,11 +29,16 @@ def register_fausans_font():
]
for path in possible_paths:
if path.exists():
# check if font is already registered
if "FAUSans Office" in font_manager.fontManager.get_font_names():
plt.rcParams["font.family"] = "sans-serif"
plt.rcParams["font.sans-serif"] = "FAUSans Office"
return
font_manager.fontManager.addfont(path)
print(
"Successfully registered FAU Sans font. "
"You can now use it in matplotlib by adding the following lines to your code:\n\n"
'plt.rcParams["font.family"] = "sans-serif"'
'plt.rcParams["font.family"] = "sans-serif"\n'
'plt.rcParams["font.sans-serif"] = "FAUSans Office"'
)
return
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fau_colors"
version = "1.4.2"
version = "1.4.3"
description = "The official colors of FAU as matplotlib/seaborn colormaps"
authors = [
"Robert Richer <[email protected]>",
Expand Down

0 comments on commit f962253

Please sign in to comment.