Fixed backporting of social plugin font loading logic

This commit is contained in:
squidfunk 2024-03-31 21:17:44 +08:00
parent 8956524097
commit e71f00b4c9
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
2 changed files with 0 additions and 22 deletions

View File

@ -500,17 +500,6 @@ class SocialPlugin(BasePlugin[SocialConfig]):
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)

View File

@ -500,17 +500,6 @@ class SocialPlugin(BasePlugin[SocialConfig]):
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)