update
This commit is contained in:
14
aifont.py
14
aifont.py
@@ -11,7 +11,7 @@ if not os.path.exists(meslo):
|
||||
|
||||
# download SVG icons
|
||||
base = "https://git.syui.ai/ai/app/raw/branch/main/icon"
|
||||
for name in ["ai.svg", "syui.svg"]:
|
||||
for name in ["ai.svg", "syui.svg", "bluesky.svg"]:
|
||||
subprocess.run(["curl", "-sL", "-o", f"/tmp/{name}", f"{base}/{name}"], check=True)
|
||||
|
||||
subprocess.run(["fontforge", "-script", "/dev/stdin"], input=b"""
|
||||
@@ -20,12 +20,22 @@ import fontforge
|
||||
icons = fontforge.font()
|
||||
icons.em = 1024
|
||||
|
||||
scale = 200
|
||||
|
||||
glyph = icons.createChar(0xE001, "ai")
|
||||
glyph.importOutlines("/tmp/ai.svg")
|
||||
bb = glyph.boundingBox()
|
||||
glyph.transform((scale/100.0, 0, 0, scale/100.0, 0, 0))
|
||||
glyph.width = 1024
|
||||
|
||||
glyph = icons.createChar(0xE002, "syui")
|
||||
glyph.importOutlines("/tmp/syui.svg")
|
||||
glyph.transform((scale/100.0, 0, 0, scale/100.0, 0, 0))
|
||||
glyph.width = 1024
|
||||
|
||||
glyph = icons.createChar(0xE003, "bluesky")
|
||||
glyph.importOutlines("/tmp/bluesky.svg")
|
||||
glyph.transform((scale/100.0, 0, 0, scale/100.0, 0, 0))
|
||||
glyph.width = 1024
|
||||
|
||||
icons.generate("/tmp/icons.ttf")
|
||||
@@ -36,6 +46,8 @@ font.selection.select(0xE001)
|
||||
font.clear()
|
||||
font.selection.select(0xE002)
|
||||
font.clear()
|
||||
font.selection.select(0xE003)
|
||||
font.clear()
|
||||
font.selection.none()
|
||||
|
||||
font.mergeFonts("/tmp/icons.ttf")
|
||||
|
||||
Reference in New Issue
Block a user