summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/fonts/arev/sfdtokernaccent
blob: 1e787b867d649dc8f0014ea5a940a56ee618974c (plain)
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
#!/bin/bash

# Bash script to extract kerning info for accents from sfd file that is passed in on standard input

# SYNTAX:
# cat sfdFile | sfdtokernaccent sfdFile KernAccentMTXfile

sfdFile=$1
KernFile=$2

echo "Creating accent kerns $KernFile from $sfdFile"

echo "% accent kerns $KernFile " > $KernFile
echo "% Created by sfdtokernaccent from $sfdFile for accent kerning" >> $KernFile
echo "% on `date`." >> $KernFile

echo "\relax" >> $KernFile
echo "\metrics" >> $KernFile

read LineIn1 LineIn2 LineIn3 LineIn4 LineInRest
ErrorVal=$?

Char=""
Width=0
AccentPos=0

while [ $ErrorVal -eq 0 ]
do
  if [ "$LineIn1" = "StartChar:" ]
  then
    Char=$LineIn2
  fi
  if [ "$LineIn1" = "Width:" ]
  then
    Width=$LineIn2
  fi
  if [ "$LineIn1" = "AnchorPoint:" ]
  then
    if [ "$LineIn2" = '"TopCap"' ]
    then
      AccentPos=$LineIn3
      #echo "found: $Char, $Width, $AccentPos"
      echo "\\fixaccentkern{$Char}{$AccentPos}  % Width=$Width" >> $KernFile
    fi
  fi
  if [ "$LineIn1" = "AnchorPoint:" ]
  then
    if [ "$LineIn2" = '"Top"' ]
    then
      AccentPos=$LineIn3
      #echo "found: $Char, $Width, $AccentPos"
      echo "\\fixaccentkern{$Char}{$AccentPos}  % Width=$Width" >> $KernFile
    fi
  fi


  read LineIn1 LineIn2 LineIn3 LineIn4 LineInRest
  ErrorVal=$?
done

echo "\endmetrics" >> $KernFile

echo "Done."