Ethscriptions commited on
Commit
e93f304
·
verified ·
1 Parent(s): 1ffe1c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -25,21 +25,21 @@ NUM_COLS = 3
25
  # --- 字体加载与文本处理函数 ---
26
 
27
  def get_font_regular(size=14):
28
- """加载思源黑体-常规 (SourceHanSansCN-Regular.otf)"""
29
- font_path = "SourceHanSansCN-Regular.otf"
30
  if os.path.exists(font_path):
31
  return font_manager.FontProperties(fname=font_path, size=size)
32
  else:
33
- st.warning("警告:未找到字体文件 'SourceHanSansCN-Regular.otf',LED屏排片表显示可能不正确。")
34
  return font_manager.FontProperties(family='sans-serif', size=size)
35
 
36
  def get_font_bold(size=14):
37
- """加载思源黑体-粗体 (SourceHanSansCN-Bold.otf)"""
38
- font_path = "SourceHanSansCN-Bold.otf"
39
  if os.path.exists(font_path):
40
  return font_manager.FontProperties(fname=font_path, size=size)
41
  else:
42
- st.warning("警告:未找到字体文件 'SourceHanSansCN-Bold.otf',散场时间表显示可能不正确。")
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):