Skip to content

Commit

Permalink
Fixed backporting of social plugin font loading logic
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Mar 31, 2024
1 parent 8956524 commit e71f00b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
11 changes: 0 additions & 11 deletions material/plugins/social/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,6 @@ def _resolve_font(self, family: str, style: str):
if not fallback or len(name) < len(fallback):
fallback = name

# Print warning in debug mode, since the font could not be resolved
if self.config.debug:
log.warning(
f"Couldn't find style '{style}' for font family '{family}'. " +
f"Styles available:\n\n" +
f"\n".join([os.path.splitext(file)[0] for file in list]) +
f"\n\n"
f"Falling back to: {fallback}\n"
f"\n"
)

# Fall back to regular font (guess if there are multiple)
return self._resolve_font(family, fallback)

Expand Down
11 changes: 0 additions & 11 deletions src/plugins/social/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,6 @@ def _resolve_font(self, family: str, style: str):
if not fallback or len(name) < len(fallback):
fallback = name

# Print warning in debug mode, since the font could not be resolved
if self.config.debug:
log.warning(
f"Couldn't find style '{style}' for font family '{family}'. " +
f"Styles available:\n\n" +
f"\n".join([os.path.splitext(file)[0] for file in list]) +
f"\n\n"
f"Falling back to: {fallback}\n"
f"\n"
)

# Fall back to regular font (guess if there are multiple)
return self._resolve_font(family, fallback)

Expand Down

0 comments on commit e71f00b

Please sign in to comment.