mirror of
https://github.com/Shu-Ying/main_plugin_farm.git
synced 2026-10-29 13:40:00 +08:00
add # 新增对zhenxun的工作流
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""为CI选择现有字体;部署仍须显式配置中文字体。"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def choose_font():
|
||||
configured = os.environ.get("FARM_TEST_FONT")
|
||||
candidates = ([configured] if configured else []) + [
|
||||
"C:/Windows/Fonts/msyh.ttc", "C:/Windows/Fonts/simsun.ttc",
|
||||
"/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
|
||||
"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
|
||||
"C:/Windows/Fonts/arial.ttf",
|
||||
]
|
||||
for name in candidates:
|
||||
if Path(name).is_file():
|
||||
return name
|
||||
raise RuntimeError("Set FARM_TEST_FONT to an existing font")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
path = choose_font()
|
||||
environment_file = os.environ.get("GITHUB_ENV")
|
||||
if environment_file:
|
||||
with open(environment_file, "a", encoding="utf-8") as output:
|
||||
output.write(f"FARM_TEST_FONT={path}\n")
|
||||
print(path)
|
||||
Reference in New Issue
Block a user