├── .gitignore ├── README.md ├── add-ligatures.sh ├── convert.sh └── download.sh /.gitignore: -------------------------------------------------------------------------------- 1 | otf/ 2 | otf-with-ligatures/ 3 | woff/ 4 | tool-*/ 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Operator Mono Font Downloader and OTF Converter 2 | 3 | This tool allows you to download the font Operator Mono and convert it to OTF. 4 | 5 | ## Download 6 | 7 | ```sh 8 | ./download.sh 9 | ``` 10 | 11 | ## Convert to OTF 12 | 13 | ```sh 14 | ./convert.sh 15 | ``` 16 | 17 | ## Ligatures 18 | 19 | To add ligatures to the OTF fonts that you've downloaded and converted: 20 | 21 | ```sh 22 | ./add-ligatures.sh 23 | ``` 24 | 25 | Which uses the tool from this [repo](https://github.com/kiliman/operator-mono-lig) with 26 | this [Docker wrapper](https://github.com/drod3763/kiliman-operator-mono-lig-docker) 27 | -------------------------------------------------------------------------------- /add-ligatures.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | REPO_URL=git@github.com:drod3763/kiliman-operator-mono-lig-docker.git 4 | TOOL_DIR=tool-ligatures 5 | SOURCE_DIR=otf 6 | OUTPUT_DIR=otf-with-ligatures 7 | CMD=tool-woff2otf/woff2otf.py 8 | 9 | if [ ! -d ${SOURCE_DIR} ]; then 10 | echo "Directory ${SOURCE_DIR} does not exist" 11 | exit 1 12 | fi 13 | 14 | if [ ! -d ${TOOL_DIR} ]; then 15 | echo "Cloning ligatures tool to ${TOOL_DIR}" 16 | git clone ${REPO_URL} ${TOOL_DIR} 17 | else 18 | echo "Updating ligatures tool in ${TOOL_DIR}" 19 | cd ${TOOL_DIR} 20 | git pull 21 | cd - > /dev/null 22 | fi 23 | 24 | echo 25 | 26 | mkdir -p ${OUTPUT_DIR} 27 | 28 | cp -p ${SOURCE_DIR}/*.otf ${TOOL_DIR}/input 29 | 30 | docker-compose -f ${TOOL_DIR}/docker-compose.yaml run --rm operator-mono-lig 31 | 32 | cp -p ${TOOL_DIR}/build/*.otf ${OUTPUT_DIR} 33 | 34 | echo 35 | echo "Done!" 36 | -------------------------------------------------------------------------------- /convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | REPO_URL=git@github.com:hanikesn/woff2otf.git 4 | TOOL_DIR=tool-woff2otf 5 | SOURCE_DIR=woff 6 | OUTPUT_DIR=otf 7 | CMD=tool-woff2otf/woff2otf.py 8 | 9 | if [ ! -d ${SOURCE_DIR} ]; then 10 | echo "Directory ${SOURCE_DIR} does not exist" 11 | exit 1 12 | fi 13 | 14 | if [ ! -d ${TOOL_DIR} ]; then 15 | echo "Cloning OTF conversion tool to ${TOOL_DIR}" 16 | git clone ${REPO_URL} ${TOOL_DIR} 17 | else 18 | echo "Updating OTF conversion tool in ${TOOL_DIR}" 19 | cd ${TOOL_DIR} 20 | git pull 21 | cd - > /dev/null 22 | fi 23 | 24 | echo 25 | 26 | mkdir -p ${OUTPUT_DIR} 27 | 28 | find ${SOURCE_DIR} -type f -name "*.woff" -exec basename {} \; \ 29 | | while read woffFile 30 | do 31 | filename=$(echo ${woffFile} | sed 's|\.woff||') 32 | newFilename="${filename}.otf" 33 | echo "Converting ${woffFile} to ${newFilename}" 34 | ${CMD} ${SOURCE_DIR}/${woffFile} ${OUTPUT_DIR}/${filename}.otf 35 | done 36 | 37 | echo 38 | echo "Done!" 39 | -------------------------------------------------------------------------------- /download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | URL=https://fonts.cdnfonts.com/css/operator-mono 4 | DIR=woff 5 | 6 | mkdir -p ${DIR} 7 | 8 | curl -s ${URL} \ 9 | | grep 'https://' \ 10 | | sed "s|.*url('\(.*\)') format.*|\1|" \ 11 | | while read fontUrl 12 | do 13 | filename=$(echo ${fontUrl} | sed 's|.*/||') 14 | echo "Downloading ${fontUrl} to ${DIR}/${filename}" 15 | wget -q "${fontUrl}" -O "${DIR}/${filename}" 16 | done 17 | 18 | echo 19 | echo "Done!" 20 | --------------------------------------------------------------------------------