refactor(tools): Avoid warnings. (#10161)
This commit is contained in:
parent
bf048b8d7c
commit
3c85136279
2 changed files with 9 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import matplotlib.pyplot as plt
|
||||
from matplotlib.font_manager import FontProperties
|
||||
from matplotlib.font_manager import FontProperties, fontManager
|
||||
|
||||
from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController
|
||||
|
||||
|
|
@ -17,9 +17,10 @@ def set_chinese_font():
|
|||
]
|
||||
|
||||
for font in font_list:
|
||||
chinese_font = FontProperties(font)
|
||||
if chinese_font.get_name() == font:
|
||||
return chinese_font
|
||||
if font in fontManager.ttflist:
|
||||
chinese_font = FontProperties(font)
|
||||
if chinese_font.get_name() == font:
|
||||
return chinese_font
|
||||
|
||||
return FontProperties()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue