Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,21 +25,21 @@ NUM_COLS = 3
|
|
| 25 |
# --- 字体加载与文本处理函数 ---
|
| 26 |
|
| 27 |
def get_font_regular(size=14):
|
| 28 |
-
"""加载思源黑体-常规 (
|
| 29 |
-
font_path = "
|
| 30 |
if os.path.exists(font_path):
|
| 31 |
return font_manager.FontProperties(fname=font_path, size=size)
|
| 32 |
else:
|
| 33 |
-
st.warning("警告:未找到字体文件 '
|
| 34 |
return font_manager.FontProperties(family='sans-serif', size=size)
|
| 35 |
|
| 36 |
def get_font_bold(size=14):
|
| 37 |
-
"""加载思源黑体-粗体 (
|
| 38 |
-
font_path = "
|
| 39 |
if os.path.exists(font_path):
|
| 40 |
return font_manager.FontProperties(fname=font_path, size=size)
|
| 41 |
else:
|
| 42 |
-
st.warning("警告:未找到字体文件 '
|
| 43 |
return font_manager.FontProperties(family='sans-serif', size=size, weight='bold')
|
| 44 |
|
| 45 |
def get_pinyin_abbr(text):
|
|
|
|
| 25 |
# --- 字体加载与文本处理函数 ---
|
| 26 |
|
| 27 |
def get_font_regular(size=14):
|
| 28 |
+
"""加载思源黑体-常规 (SimHei.ttf)"""
|
| 29 |
+
font_path = "SimHei.ttf"
|
| 30 |
if os.path.exists(font_path):
|
| 31 |
return font_manager.FontProperties(fname=font_path, size=size)
|
| 32 |
else:
|
| 33 |
+
st.warning("警告:未找到字体文件 'SimHei.ttf',LED屏排片表显示可能不正确。")
|
| 34 |
return font_manager.FontProperties(family='sans-serif', size=size)
|
| 35 |
|
| 36 |
def get_font_bold(size=14):
|
| 37 |
+
"""加载思源黑体-粗体 (Alibaba-PuHuiTi-Bold.ttf)"""
|
| 38 |
+
font_path = "Alibaba-PuHuiTi-Bold.ttf.otf"
|
| 39 |
if os.path.exists(font_path):
|
| 40 |
return font_manager.FontProperties(fname=font_path, size=size)
|
| 41 |
else:
|
| 42 |
+
st.warning("警告:未找到字体文件 'Alibaba-PuHuiTi-Bold.ttf',散场时间表显示可能不正确。")
|
| 43 |
return font_manager.FontProperties(family='sans-serif', size=size, weight='bold')
|
| 44 |
|
| 45 |
def get_pinyin_abbr(text):
|