feat: add Fira Project fonts
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import os
|
||||
|
||||
from lib.make import *
|
||||
|
||||
upstream_version = "3.206"
|
||||
|
||||
version(upstream_version)
|
||||
description("Monospaced variant of the Fira Sans font series")
|
||||
maintainer("sisungo <[email protected]>")
|
||||
source_url("https://carrois.com/downloads/Fira/Fira_Mono_3_2.zip")
|
||||
|
||||
|
||||
def build():
|
||||
os.chdir("Fonts/FiraMono_OTF_32")
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def declare_seperate(name):
|
||||
def pack(composer):
|
||||
composer.makedirs("share/fonts/FiraMono")
|
||||
composer.add(f"{name}.otf", f"share/fonts/FiraMono/{name}.otf")
|
||||
|
||||
package(name)
|
||||
on_pack(pack)
|
||||
|
||||
declare_seperate("FiraMono-Bold")
|
||||
declare_seperate("FiraMono-Medium")
|
||||
declare_seperate("FiraMono-Regular")
|
||||
|
||||
package("FiraMono-Fonts")
|
||||
dep("FiraMono-Bold")
|
||||
dep("FiraMono-Medium")
|
||||
dep("FiraMono-Regular")
|
||||
on_pack(lambda x: print("Packing FiraMono-Fonts."))
|
||||
@@ -0,0 +1,60 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user