Added
Link Here
|
1 |
#!/bin/sh |
2 |
|
3 |
catfontsdir() |
4 |
{ |
5 |
while read _IN |
6 |
do |
7 |
case "${_IN}" in |
8 |
*-misc-bizingothic-* | [0-9]* | "") |
9 |
;; |
10 |
*) |
11 |
echo ${_IN} |
12 |
;; |
13 |
esac |
14 |
done |
15 |
} |
16 |
|
17 |
ROMA="" |
18 |
BOLD="ds=y" |
19 |
RITA="ai=0.08" |
20 |
ROBL="ai=0.08" |
21 |
|
22 |
make_xlfd() |
23 |
{ |
24 |
_enc=$1 |
25 |
_file=$2 |
26 |
_vendor=$3 |
27 |
_fname=$4 |
28 |
_poc=$5 |
29 |
_weight=$6 |
30 |
|
31 |
case "${_poc}:${_enc}" in |
32 |
p:jisx0201.1976-*) PFIX="bw=0.5" ;; |
33 |
c:jisx0201.1976-*) PFIX="bw=0.5" ;; |
34 |
p:*) PFIX="" ;; |
35 |
c:*) PFIX="" ;; |
36 |
esac |
37 |
|
38 |
set -- "" ${_weight}-r \ |
39 |
${RITA} ${_weight}-ri \ |
40 |
${ROBL} ${_weight}-ro |
41 |
while [ $# != 0 ]; do |
42 |
_prefix="${PFIX}:$1"; shift |
43 |
_variant=$1; shift |
44 |
[ ${index_type} = "scale" -a ${_prefix} != ":" ] && continue |
45 |
printf "%s:%s -%s-%s-%s-normal--0-0-0-0-%s-0-%s\n" \ |
46 |
$_prefix $_file $_vendor "$_fname" $_variant $_poc $_enc |
47 |
done | sed -e 's,::,:,g' -e 's,^:,,' |
48 |
} |
49 |
|
50 |
addentries() |
51 |
{ |
52 |
for ENC in iso8859-1 iso10646-1 jisx0201.1976-0 jisx0208.1983-0 jisx0208.1990-0 jisx0208.1997-0 jisx0213.2004-1 |
53 |
do |
54 |
make_xlfd $ENC BizinGothic-Regular.ttf misc "bizingothic" m medium |
55 |
make_xlfd $ENC BizinGothic-Bold.ttf misc "bizingothic" m bold |
56 |
done |
57 |
} |
58 |
|
59 |
nfonts() |
60 |
{ |
61 |
_L=0; while read _IN; do _L=$((${_L}+1)); done; echo ${_L} |
62 |
} |
63 |
|
64 |
install_fontsdir() |
65 |
{ |
66 |
index_type=${1:-"dir"} |
67 |
index="fonts.${index_type}" |
68 |
tmpfile="${index}.tmp" |
69 |
touch ${index} |
70 |
(catfontsdir < ${index}; addentries ${index_type}) > ${tmpfile} |
71 |
nfonts < ${tmpfile} > ${index} |
72 |
cat ${tmpfile} >> ${index} |
73 |
rm -f ${tmpfile} |
74 |
} |
75 |
|
76 |
deinstall_fontsdir() |
77 |
{ |
78 |
index_type=${1:-"dir"} |
79 |
index="fonts.${index_type}" |
80 |
tmpfile="${index}.tmp" |
81 |
catfontsdir < ${index} > ${tmpfile} |
82 |
nfonts < ${tmpfile} > ${index} |
83 |
cat ${tmpfile} >> ${index} |
84 |
rm -f ${tmpfile} |
85 |
if [ -r ${index} -a $(wc -l < ${index}) = 1 ]; then |
86 |
rm -f ${index} |
87 |
fi |
88 |
} |
89 |
|
90 |
case "$2" in |
91 |
POST-INSTALL) |
92 |
cd %%FONTSDIR%% |
93 |
install_fontsdir dir |
94 |
install_fontsdir scale |
95 |
;; |
96 |
POST-DEINSTALL) |
97 |
cd %%FONTSDIR%% |
98 |
deinstall_fontsdir dir |
99 |
deinstall_fontsdir scale |
100 |
;; |
101 |
esac |