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