blob: 80b32a0eaa07875c48fc3b310b4375c35c4517a9 (
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
|
#!/bin/bash
# Bash script to make list of glyphs from afm file than need kerning for accents.
# SYNTAX:
# afmtokernaccent AfmFile GlyphListFile
AfmFile=$1
GlyphList=$2
echo "Creating glyph list $GlyphList from $AfmFile for accent kerning"
MaxLines=`wc -l $AfmFile | cut -d" " -f 1`
echo " $MaxLines lines in afm file."
LineNum=1
UnknownGlyph=1
ProccessingChars=FALSE
echo "% glyph list $GlyphList " > $GlyphList
echo "% Created by afmtokernaccent from $AfmFile for accent kerning" >> $GlyphList
echo "% on `date`." >> $GlyphList
echo "\relax" >> $GlyphList
echo "\metrics" >> $GlyphList
for skewchar in circum circumup
do
# Pull out bounding box information for skewchar
sed -n 's_C -*[0-9]* ; WX \(-*[0-9]*\) ; N '$skewchar' ; B \(-*[0-9]*\) -*[0-9]* \(-*[0-9]*\) -*[0-9]* ;_\\def\\'$skewchar'bbleft\{\2\} \\def\\'$skewchar'bbright\{\3\}_p' <$AfmFile >> $GlyphList
# Pull out kerning information
sed -n 's_KPX \([A-Za-z0-9]*\) '$skewchar' \(-*[0-9]*\)_\\fixaccentkern\{\1\}\{\2\}\{\\'$skewchar'bbleft\}\{\\'$skewchar'bbright\}_p' <$AfmFile >> $GlyphList
done
echo "\endmetrics" >> $GlyphList
echo "Done."
|