FiraCode icon indicating copy to clipboard operation
FiraCode copied to clipboard

how can I build firacode.otf?

Open Lengdrich opened this issue 2 years ago • 2 comments

I want to download the firacode file of otf format, but I can't find it, and I build it myself, but no firacode.otf. could you tell me how can I get firacode.otf file? thank you.

Lengdrich avatar Dec 14 '22 01:12 Lengdrich

Replace ttf to otf in build_ttf.sh

tonsky avatar Dec 14 '22 01:12 tonsky

Replace ttf to otf in build_ttf.sh

should I replace these four line code?

#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "$(dirname "$0")/.."
[ -d venv ] && source venv/bin/activate

family_name=${FIRACODE_FAMILY_NAME:-"Fira Code"}
glyphs_file=${FIRACODE_GLYPHS_FILE:-"FiraCode.glyphs"}

dir="distr/otf/${family_name}" # this line
# dir="distr/otf/${family_name}"

mkdir -p "${dir}"
rm -rf "${dir:?}/"*

args=( "$@" )
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )
weights=( "${args[@]:-"${default_weights[@]}"}" )

for weight in "${weights[@]}"; do
	file="${dir}/FiraCode-${weight}.otf" # this line
	# file="${dir}/FiraCode-${weight}.ttf"

	echo "=============="
	echo
	echo "  [i] Creating ${file}"
	echo

	fontmake -g "${glyphs_file}" -o otf --output-path "${file}" -i ".* ${weight}" # this line
	# fontmake -g "${glyphs_file}" -o ttf --output-path "${file}" -i ".* ${weight}"

	echo "  [i] Fixing DSIG in ${file}"
	gftools fix-dsig --autofix "${file}"

	echo "  [i] OTFautohint ${file}" # this line
	# echo "  [i] TTFautohint ${file}"
	
	# ttfautohint --no-info --ignore-restrictions "${file}" "${file}.hinted"
	otfautohint --no-info --ignore-restrictions "${file}" "${file}.hinted" # this line
	mv "${file}.hinted" "${file}"
done

Lengdrich avatar Dec 14 '22 02:12 Lengdrich