mirror of
https://github.com/lleene/LLEENE-Latex-Templates.git
synced 2025-01-23 02:42:21 +01:00
utility script for generating groff fonts
This commit is contained in:
parent
930f8a83c6
commit
4ed6c9fcf1
17
Fonts/groff_font.sh
Executable file
17
Fonts/groff_font.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
for font_file in $(find . -regextype posix-extended -iregex ".*-(italic|bold|regular)+.ttf");
|
||||||
|
do fontforge -lang=ff -c "Open(\"$font_file\");Generate(\"${font_file/ttf/pfa}\")";
|
||||||
|
done
|
||||||
|
|
||||||
|
MAP_FILE="/usr/share/groff/current/font/devps/generate/textmap"
|
||||||
|
ENC_FILE="/usr/share/groff/current/font/devps/text.enc"
|
||||||
|
FONT_FAMILY="${PWD##*/}"
|
||||||
|
|
||||||
|
for afm_file in ./*afm; do
|
||||||
|
FONT_TYPE="R"
|
||||||
|
if [[ "${afm_file,,}" == *"italic"* ]] ; then FONT_TYPE="I" ; fi
|
||||||
|
if [[ "${afm_file,,}" == *"bold"* ]] ; then FONT_TYPE="B" ; fi
|
||||||
|
if [[ "${afm_file,,}" == *"bolditalic"* ]] ; then FONT_TYPE="BI" ; fi
|
||||||
|
afmtodit -e $ENC_FILE $afm_file $MAP_FILE "${FONT_FAMILY}${FONT_TYPE}"
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user