feat: 开源蟹蟹输入RTOS适配改版并采用MIT商用许可

这个提交包含在:
sydxky 于 2026-11-14 12:10:10 +08:00 提交
当前提交 29374caffd
116 个文件已更改
+351523

没有与搜索条件相匹配的文件

@@ -0,0 +1,19 @@
"""Rebuild local PNGs from the retained iconfont SVG originals (pip install resvg-py)."""
import hashlib,json,pathlib,xml.etree.ElementTree as ET
import resvg_py
APP=pathlib.Path(__file__).resolve().parents[1]
SOURCE=APP/'third_party/remix-icon'
OUT=APP/'src/assets/ime-icons'
OUT.mkdir(parents=True,exist_ok=True)
metadata=json.loads((SOURCE/'icons.json').read_text(encoding='utf-8'))
for record in metadata['icons']:
raw=(SOURCE/(record['name']+'.iconfont.svg')).read_bytes()
assert hashlib.sha256(raw).hexdigest().upper()==record['iconfont_svg_sha256']
root=ET.fromstring(raw);root.attrib.pop('style',None)
color='#FFFFFF' if record['name']=='check-line' else '#515866' if record['name']=='delete-back-2-line' else '#2867D9'
for node in root.iter():node.attrib.pop('fill',None)
root.set('fill',color)
(OUT/(record['name']+'.png')).write_bytes(resvg_py.svg_to_bytes(svg_string=ET.tostring(root,encoding='unicode'),width=72,height=72))
(OUT/'LICENSE.txt').write_bytes((SOURCE/'LICENSE').read_bytes())
print('Built',len(metadata['icons']),'local 72px transparent icons; display at 20/24px')