File: build_roman

package info (click to toggle)
fonts-junicode 2%2Bgit20230104%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 114,100 kB
  • sloc: python: 162; sh: 119; xml: 18; makefile: 16
file content (70 lines) | stat: -rwxr-xr-x 1,480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash

outputtype="ttf"

instanceparam="-i"

generateufo=true

xslfile="fix_wdth_axis.xsl"

for arg in $@
do
  if [ $arg == "otf" ]
  then
    outputtype=$arg
  elif [ $arg == "variable" ]
  then
    outputtype=$arg
    instanceparam=""
  elif [ $arg == "variable-cff2" ]
  then
    outputtype=$arg
    instanceparam=""
  elif [ $arg == "u" ]
  then
    generateufo=false
  elif [ $arg == "s"  ]
  then
    xslfile="fix_wdth_axis-shorter.xsl"
  fi

done

if [ "$generateufo" = true ]
then
  echo "Generating UFOs and designspace file from Glyphs source"
  glyphs2ufo --no-preserve-glyphsapp-metadata --propagate-anchors --generate-GDEF --write-public-skip-export-glyphs Junicode-width.glyphs
  if [ $? -ne 0 ]
  then
    echo "glyphs2ufo failed"
    exit 1
  fi
  echo "Cleaning up designspace file"
  xsltproc -o Junicode-width-fixed.designspace $xslfile Junicode-width.designspace
  if [ $? -ne 0 ]
  then
   echo "xsltproc failed"
   exit 1
  fi
fi

echo "building font(s)"
fontmake -o $outputtype $instanceparam -m "Junicode-width-fixed.designspace"
if [ $? -ne 0 ]
then
 echo "fontmake failed"
 exit 1
fi

if [ $outputtype == "variable" ]
then
  cp variable_ttf/Junicode-width-fixed-VF.ttf variable_ttf/JunicodeTwoBetaVF-Roman.ttf
  rm variable_ttf/Junicode-width-fixed-VF.ttf
fi
if [ $outputtype == "variable-cff2" ]
then
  cp variable_otf/Junicode-width-fixed-VF.otf variable_otf/JunicodeTwoBetaVF-Roman.otf
  rm -i variable_otf/Junicode-width-fixed-VF.otf
fi
exit 0