Skip to content

Commit

Permalink
fix font loading (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
pplonski committed Jul 6, 2023
1 parent e9cfd08 commit a293aaf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions supervised/base_automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,17 @@
check_integer,
)
from supervised.utils.utils import dump_data, load_data
import matplotlib.font_manager as font_manager

# Get a list of all font families available on the system
font_families = font_manager.findSystemFonts()

# Load the font file for the first font family in the list and get the name of the first font family
REPORT_FONT = font_manager.FontProperties(fname=font_families[0]).get_name()
try:
import matplotlib.font_manager as font_manager
# Get a list of all font families available on the system
font_families = font_manager.findSystemFonts()

# Load the font file for the first font family in the list and get the name of the first font family
REPORT_FONT = font_manager.FontProperties(fname=font_families[0]).get_name()
except Exception:
REPORT_FONT = "Arial"

logger = logging.getLogger(__name__)
logger.setLevel(LOG_LEVEL)
Expand Down

0 comments on commit a293aaf

Please sign in to comment.