# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v3

EAPI=8

inherit font

DESCRIPTION="Bitmapped programming font, based on Tamsyn"
HOMEPAGE="https://github.com/sunaku/tamzen-font"

if [[ "${PV}" == *9999* ]] ; then
	inherit git-r3

	EGIT_REPO_URI="https://github.com/sunaku/tamzen-font"
else
	SRC_URI="fetch+https://github.com/sunaku/tamzen-font/archive/refs/tags/Tamzen-${PV}.tar.gz"
	S="${WORKDIR}/${PN}-font-Tamzen-${PV}"

	KEYWORDS="amd64 x86"
fi

LICENSE="Tamzen"
SLOT="0"

IUSE="ttf"

src_install() {
	suffixes=(otb pcf)
	use ttf && suffixes+=(ttf)

	for suffix in "${suffixes[@]}"; do
		FONT_S=${S}/${suffix} FONT_SUFFIX=${suffix} font_src_install
	done

	insinto /usr/share/consolefonts # consolefonts (.psf)
	doins psf/*.psf
}