[1120] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[7147] | 3 | # default font setting script for Vine Linux 7/7CR |
---|
[1120] | 4 | # used by tex, gs, xpdf.. |
---|
| 5 | # |
---|
| 6 | # usage: update-defaultfont |
---|
| 7 | |
---|
[7147] | 8 | TEXMF=/var/lib/texmf |
---|
| 9 | PTEXMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/ptex-vine.map |
---|
| 10 | UPTEXMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/uptex-vine.map |
---|
| 11 | OTFMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/otf-vine.map |
---|
| 12 | OTFUPMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/otf-up-vine.map |
---|
| 13 | TEXALIASDIR=$TEXMF/fonts/truetype/vine |
---|
[1120] | 14 | ALIASDIR=/usr/share/fonts/alias/TrueType |
---|
| 15 | |
---|
[7147] | 16 | TMPPTEXMAPFILE=$(mktemp /tmp/ptex-vine.map.XXXXXX) |
---|
| 17 | TMPUPTEXMAPFILE=$(mktemp /tmp/uptex-vine.map.XXXXXX) |
---|
| 18 | TMPOTFMAPFILE=$(mktemp /tmp/otf-vine.map.XXXXXX) |
---|
| 19 | TMPOTFUPMAPFILE=$(mktemp /tmp/otf-up-vine.map.XXXXXX) |
---|
[1120] | 20 | |
---|
| 21 | # set default font symlink |
---|
| 22 | lnttf() { |
---|
| 23 | F=$(fc-match -v "$2" | grep "file:" | cut -f2 -d\") |
---|
| 24 | ln -sf $F $TEXALIASDIR/$3.ttf |
---|
| 25 | ln -sf $F $ALIASDIR/$3.ttf |
---|
[7147] | 26 | cat <<EOF >> $TMPPTEXMAPFILE |
---|
[1120] | 27 | % $1 % |
---|
| 28 | $1 H $3.ttf |
---|
| 29 | t$1 V $3.ttf |
---|
| 30 | $1i H $3.ttf -s .3 |
---|
| 31 | t$1i V $3.ttf -s .3 |
---|
| 32 | |
---|
| 33 | EOF |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | # make symlink for CR fonts |
---|
| 37 | lnttc() { |
---|
| 38 | F=$(find /usr/share/fonts/ -name "$2.ttc" -type f | head -1) |
---|
| 39 | if [ -f "$F" ]; then |
---|
| 40 | ln -sf $F $TEXALIASDIR/$3.ttc |
---|
[7147] | 41 | cat <<EOF >> $TMPPTEXMAPFILE |
---|
[1120] | 42 | % $3 % |
---|
| 43 | $1 H $3.ttc |
---|
| 44 | t$1 V $3.ttc |
---|
| 45 | $1i H $3.ttc -s .3 |
---|
| 46 | t$1i V $3.ttc -s .3 |
---|
| 47 | |
---|
| 48 | EOF |
---|
| 49 | fi |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | ######################################################################################## |
---|
| 53 | |
---|
[7147] | 54 | cat <<EOF > $TMPPTEXMAPFILE |
---|
[1120] | 55 | % Vine additional map % |
---|
[9942] | 56 | rml 2004-H Mincho-Medium.ttf |
---|
| 57 | rmlv 2004-V Mincho-Medium.ttf |
---|
| 58 | gbm 2004-H Gothic-Medium.ttf |
---|
| 59 | gbmv 2004-V Gothic-Medium.ttf |
---|
[1120] | 60 | |
---|
| 61 | % italic % |
---|
[9942] | 62 | rmli 2004-H Mincho-Medium.ttf,Italic |
---|
| 63 | rmlvi 2004-V Mincho-Medium.ttf,Italic |
---|
| 64 | gbmi 2004-H Gothic-Medium.ttf,Italic |
---|
| 65 | gbmvi 2004-V Gothic-Medium.ttf,Italic |
---|
[1120] | 66 | |
---|
| 67 | % new JIS font metric % |
---|
[9942] | 68 | rmln 2004-H Mincho-Medium.ttf |
---|
| 69 | rmlnv 2004-V Mincho-Medium.ttf |
---|
| 70 | gbmn 2004-H Gothic-Medium.ttf |
---|
| 71 | gbmnv 2004-V Gothic-Medium.ttf |
---|
[1120] | 72 | |
---|
[7147] | 73 | EOF |
---|
[1120] | 74 | |
---|
[7147] | 75 | cat <<EOF > $TMPUPTEXMAPFILE |
---|
[9942] | 76 | urml UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 77 | urmlv UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
| 78 | ugbm UniJIS2004-UTF16-H Gothic-Medium.ttf |
---|
| 79 | ugbmv UniJIS2004-UTF16-V Gothic-Medium.ttf |
---|
[7147] | 80 | |
---|
[9942] | 81 | uprml-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 82 | uprml-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
| 83 | upgbm-h UniJIS2004-UTF16-H Gothic-Medium.ttf |
---|
| 84 | upgbm-v UniJIS2004-UTF16-V Gothic-Medium.ttf |
---|
[7147] | 85 | uprml-hq UniJIS-UCS2-H Mincho-Medium.ttf |
---|
| 86 | upgbm-hq UniJIS-UCS2-H Gothic-Medium.ttf |
---|
[9942] | 87 | |
---|
[1120] | 88 | EOF |
---|
| 89 | |
---|
[7147] | 90 | cat<<EOF > $TMPOTFMAPFILE |
---|
[9942] | 91 | % TEXT, 90JIS |
---|
| 92 | hminl-h H Mincho-Medium.ttf |
---|
| 93 | hminl-v V Mincho-Medium.ttf |
---|
| 94 | hminr-h H Mincho-Medium.ttf |
---|
| 95 | hminr-v V Mincho-Medium.ttf |
---|
| 96 | hminb-h H FutoMin-Bold.ttf |
---|
| 97 | hminb-v V FutoMin-Bold.ttf |
---|
| 98 | hgothr-h H Gothic-Medium.ttf |
---|
| 99 | hgothr-v V Gothic-Medium.ttf |
---|
| 100 | hgothb-h H FutoGo-Bold.ttf |
---|
| 101 | hgothb-v V FutoGo-Bold.ttf |
---|
| 102 | hgotheb-h H FutoGo-Bold.ttf |
---|
| 103 | hgotheb-v V FutoGo-Bold.ttf |
---|
| 104 | hmgothr-h H MaruGo-Medium.ttf |
---|
| 105 | hmgothr-v V MaruGo-Medium.ttf |
---|
| 106 | |
---|
| 107 | % TEXT, JIS04 |
---|
| 108 | hminln-h 2004-H Mincho-Medium.ttf |
---|
| 109 | hminln-v 2004-V Mincho-Medium.ttf |
---|
| 110 | hminrn-h 2004-H Mincho-Medium.ttf |
---|
| 111 | hminrn-v 2004-V Mincho-Medium.ttf |
---|
| 112 | hminbn-h 2004-H FutoMin-Bold.ttf |
---|
| 113 | hminbn-v 2004-V FutoMin-Bold.ttf |
---|
| 114 | hgothrn-h 2004-H Gothic-Medium.ttf |
---|
| 115 | hgothrn-v 2004-V Gothic-Medium.ttf |
---|
| 116 | hgothbn-h 2004-H FutoGo-Bold.ttf |
---|
| 117 | hgothbn-v 2004-V FutoGo-Bold.ttf |
---|
| 118 | hgothebn-h 2004-H FutoGo-Bold.ttf |
---|
| 119 | hgothebn-v 2004-V FutoGo-Bold.ttf |
---|
| 120 | hmgothrn-h 2004-H MaruGo-Medium.ttf |
---|
| 121 | hmgothrn-v 2004-V MaruGo-Medium.ttf |
---|
| 122 | |
---|
| 123 | % CID |
---|
| 124 | otf-cjml-h Identity-H Mincho-Medium.ttf |
---|
| 125 | otf-cjml-v Identity-V Mincho-Medium.ttf |
---|
[7147] | 126 | otf-cjmr-h Identity-H Mincho-Medium.ttf |
---|
| 127 | otf-cjmr-v Identity-V Mincho-Medium.ttf |
---|
[9942] | 128 | otf-cjmb-h Identity-H FutoMin-Bold.ttf |
---|
| 129 | otf-cjmb-v Identity-V FutoMin-Bold.ttf |
---|
[7147] | 130 | otf-cjgr-h Identity-H Gothic-Medium.ttf |
---|
| 131 | otf-cjgr-v Identity-V Gothic-Medium.ttf |
---|
[9942] | 132 | otf-cjgb-h Identity-H FutoGo-Bold.ttf |
---|
| 133 | otf-cjgb-v Identity-V FutoGo-Bold.ttf |
---|
| 134 | otf-cjge-h Identity-H FutoGo-Bold.ttf |
---|
| 135 | otf-cjge-v Identity-V FutoGo-Bold.ttf |
---|
| 136 | otf-cjmgr-h Identity-H MaruGo-Medium.ttf |
---|
| 137 | otf-cjmgr-v Identity-V MaruGo-Medium.ttf |
---|
[7147] | 138 | |
---|
[9942] | 139 | % Unicode 90JIS |
---|
| 140 | otf-ujml-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 141 | otf-ujml-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
| 142 | otf-ujmr-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 143 | otf-ujmr-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
[7147] | 144 | otf-ujmb-h UniJIS-UTF16-H FutoMin-Bold.ttf |
---|
| 145 | otf-ujmb-v UniJIS-UTF16-V FutoMin-Bold.ttf |
---|
[9942] | 146 | otf-ujgr-h UniJIS-UTF16-H Gothic-Medium.ttf |
---|
| 147 | otf-ujgr-v UniJIS-UTF16-V Gothic-Medium.ttf |
---|
[7147] | 148 | otf-ujgb-h UniJIS-UTF16-H FutoGo-Bold.ttf |
---|
| 149 | otf-ujgb-v UniJIS-UTF16-V FutoGo-Bold.ttf |
---|
[9942] | 150 | otf-ujge-h UniJIS-UTF16-H FutoGo-Bold.ttf |
---|
| 151 | otf-ujge-v UniJIS-UTF16-V FutoGo-Bold.ttf |
---|
[7147] | 152 | otf-ujmgr-h UniJIS-UTF16-H MaruGo-Medium.ttf |
---|
| 153 | otf-ujmgr-v UniJIS-UTF16-V MaruGo-Medium.ttf |
---|
| 154 | |
---|
[9942] | 155 | % Unicode JIS04 |
---|
| 156 | otf-ujmln-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 157 | otf-ujmln-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
[7147] | 158 | otf-ujmrn-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 159 | otf-ujmrn-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
[9942] | 160 | otf-ujmbn-h UniJIS2004-UTF16-H FutoMin-Bold.ttf |
---|
| 161 | otf-ujmbn-v UniJIS2004-UTF16-V FutoMin-Bold.ttf |
---|
[7147] | 162 | otf-ujgrn-h UniJIS2004-UTF16-H Gothic-Medium.ttf |
---|
| 163 | otf-ujgrn-v UniJIS2004-UTF16-V Gothic-Medium.ttf |
---|
| 164 | otf-ujgbn-h UniJIS2004-UTF16-H FutoGo-Bold.ttf |
---|
| 165 | otf-ujgbn-v UniJIS2004-UTF16-V FutoGo-Bold.ttf |
---|
[9942] | 166 | otf-ujgen-h UniJIS2004-UTF16-H FutoGo-Bold.ttf |
---|
| 167 | otf-ujgen-v UniJIS2004-UTF16-V FutoGo-Bold.ttf |
---|
[7147] | 168 | otf-ujmgrn-h UniJIS2004-UTF16-H MaruGo-Medium.ttf |
---|
| 169 | otf-ujmgrn-v UniJIS2004-UTF16-V MaruGo-Medium.ttf |
---|
| 170 | |
---|
| 171 | EOF |
---|
| 172 | |
---|
| 173 | cat<<EOF > $TMPOTFUPMAPFILE |
---|
[9942] | 174 | |
---|
| 175 | % TEXT, 90JIS |
---|
| 176 | uphminl-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 177 | uphminl-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
[7147] | 178 | uphminr-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 179 | uphminr-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
[9942] | 180 | uphminb-h UniJIS-UTF16-H FutoMin-Bold.ttf |
---|
| 181 | uphminb-v UniJIS-UTF16-V FutoMin-Bold.ttf |
---|
[7147] | 182 | uphgothr-h UniJIS-UTF16-H Gothic-Medium.ttf |
---|
| 183 | uphgothr-v UniJIS-UTF16-V Gothic-Medium.ttf |
---|
[9942] | 184 | uphgothb-h UniJIS-UTF16-H FutoGo-Bold.ttf |
---|
| 185 | uphgothb-v UniJIS-UTF16-V FutoGo-Bold.ttf |
---|
| 186 | uphgotheb-h UniJIS-UTF16-H FutoGo-Bold.ttf |
---|
| 187 | uphgotheb-v UniJIS-UTF16-V FutoGo-Bold.ttf |
---|
| 188 | uphmgothr-h UniJIS-UTF16-H MaruGo-Medium.ttf |
---|
| 189 | uphmgothr-v UniJIS-UTF16-V MaruGo-Medium.ttf |
---|
| 190 | |
---|
| 191 | % TEXT, JIS04 |
---|
| 192 | uphminln-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 193 | uphminln-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
| 194 | uphminrn-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 195 | uphminrn-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
| 196 | uphminbn-h UniJIS2004-UTF16-H FutoMin-Bold.ttf |
---|
| 197 | uphminbn-v UniJIS2004-UTF16-V FutoMin-Bold.ttf |
---|
| 198 | uphgothrn-h UniJIS2004-UTF16-H Gothic-Medium.ttf |
---|
| 199 | uphgothrn-v UniJIS2004-UTF16-V Gothic-Medium.ttf |
---|
| 200 | uphgothbn-h UniJIS2004-UTF16-H FutoGo-Bold.ttf |
---|
| 201 | uphgothbn-v UniJIS2004-UTF16-V FutoGo-Bold.ttf |
---|
| 202 | uphgothebn-h UniJIS2004-UTF16-H FutoGo-Bold.ttf |
---|
| 203 | uphgothebn-v UniJIS2004-UTF16-V FutoGo-Bold.ttf |
---|
| 204 | uphmgothrn-h UniJIS2004-UTF16-H MaruGo-Medium.ttf |
---|
| 205 | uphmgothrn-v UniJIS2004-UTF16-V MaruGo-Medium.ttf |
---|
| 206 | |
---|
[7147] | 207 | EOF |
---|
| 208 | |
---|
| 209 | ## make these directories if these do not exists |
---|
| 210 | mkdir -p $TEXALIASDIR $ALIASDIR |
---|
| 211 | |
---|
[1120] | 212 | ## remove broken symbolic links |
---|
| 213 | rm -f $TEXALIASDIR/* |
---|
| 214 | rm -f $ALIASDIR/* |
---|
| 215 | #find -L $TEXALIASDIR -type l -exec rm -f \{\} \; |
---|
| 216 | #find -L $ALIASDIR -type l -exec rm -f \{\} \; |
---|
| 217 | |
---|
| 218 | ## alias font |
---|
| 219 | # tfm name fontconfig alias PostScript name |
---|
| 220 | lnttf min Serif Mincho-Medium |
---|
| 221 | lnttf goth Sans Gothic-Medium |
---|
| 222 | lnttf futomin FutoMin FutoMin-Bold |
---|
| 223 | lnttf futogo FutoGo FutoGo-Bold |
---|
| 224 | lnttf marugo Jun MaruGo-Medium |
---|
| 225 | |
---|
| 226 | # make symlink for CR fonts |
---|
| 227 | for i in /usr/share/vine/fonts.d/* |
---|
| 228 | do |
---|
| 229 | if echo $file | grep -q "lnttc-.*\.sh$" ; then |
---|
| 230 | . $i |
---|
| 231 | fi |
---|
| 232 | done |
---|
| 233 | |
---|
| 234 | # |
---|
[7147] | 235 | cp -f $TMPPTEXMAPFILE $PTEXMAPFILE |
---|
| 236 | cp -f $TMPUPTEXMAPFILE $UPTEXMAPFILE |
---|
| 237 | cp -f $TMPOTFMAPFILE $OTFMAPFILE |
---|
| 238 | cp -f $TMPOTFUPMAPFILE $OTFUPMAPFILE |
---|
| 239 | rm -f $TMPPTEXMAPFILE $TMPUPTEXMAPFILE $TMPOTFMAPFILE $TMPOTFUPMAPFILE |
---|
[9944] | 240 | chmod 644 $PTEXMAPFILE $UPTEXMAPFILE $OTFMAPFILE $OTFUPMAPFILE |
---|