61 lines
1.8 KiB
Python
61 lines
1.8 KiB
Python
import os
|
|
|
|
from lib.make import *
|
|
|
|
upstream_version = "4.301"
|
|
|
|
version(upstream_version)
|
|
description("a humanist sans-serif typeface designed by Carrois Type Design and Mozilla")
|
|
maintainer("sisungo <[email protected]>")
|
|
source_url("https://carrois.com/downloads/Fira/Download_Folder_FiraSans_4301.zip")
|
|
|
|
|
|
widths = ["Compressed", "Condensed", "Normal"]
|
|
styles = ["Italic", "Roman"]
|
|
weights = ["Bold", "Book", "Eight", "ExtraBold", "ExtraLight", "Four", "Hair", "Heavy", "", "Light", "Medium", "SemiBold", "Thin", "Two", "Ultra", "UltraLight"]
|
|
|
|
|
|
def find_file(width, style, weight):
|
|
modify = width
|
|
if width == "Normal":
|
|
modify = ""
|
|
filename = f"FiraSans{modify}-{weight}{style}.otf"
|
|
if os.path.exists(f"{width}/{style}/{filename}"):
|
|
return filename
|
|
return None
|
|
|
|
def on_pack_by(width, style, weight):
|
|
def pack(composer):
|
|
composer.makedirs("share/fonts/FiraSans")
|
|
filename = find_file(width, style, weight)
|
|
composer.add(
|
|
f"{width}/{style}/{filename}",
|
|
f"share/fonts/FiraSans/{filename}",
|
|
)
|
|
on_pack(pack)
|
|
|
|
|
|
def build():
|
|
filename_version = upstream_version.replace('.', '')
|
|
os.chdir(f"Download_Folder_FiraSans_{filename_version}/Fonts/Fira_Sans_OTF_{filename_version}")
|
|
|
|
packages = []
|
|
for width in widths:
|
|
for style in styles:
|
|
for weight in weights:
|
|
filename = find_file(width, style, weight)
|
|
if filename:
|
|
pkgname = filename.replace(".otf", "")
|
|
package(pkgname)
|
|
arch_any()
|
|
on_pack_by(width, style, weight)
|
|
packages += [pkgname]
|
|
|
|
package("FiraSans-Fonts")
|
|
arch_any()
|
|
for pkgname in packages:
|
|
dep(f"{pkgname} (same-version) @any")
|
|
on_pack(lambda x: print("Packing FiraSans-Fonts."))
|
|
|
|
on_build(build)
|