| 1 | #!/bin/bash |
|---|
| 2 | |
|---|
| 3 | # default font setting script for Vine Linux 7/7CR |
|---|
| 4 | # used by tex, gs, xpdf.. |
|---|
| 5 | # |
|---|
| 6 | # usage: update-defaultfont |
|---|
| 7 | |
|---|
| 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 |
|---|
| 14 | ALIASDIR=/usr/share/fonts/alias/TrueType |
|---|
| 15 | |
|---|
| 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) |
|---|
| 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 |
|---|
| 26 | cat <<EOF >> $TMPPTEXMAPFILE |
|---|
| 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 |
|---|
| 41 | cat <<EOF >> $TMPPTEXMAPFILE |
|---|
| 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 | |
|---|
| 54 | cat <<EOF > $TMPPTEXMAPFILE |
|---|
| 55 | % Vine additional map % |
|---|
| 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 |
|---|
| 60 | |
|---|
| 61 | % italic % |
|---|
| 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 |
|---|
| 66 | |
|---|
| 67 | % new JIS font metric % |
|---|
| 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 |
|---|
| 72 | |
|---|
| 73 | EOF |
|---|
| 74 | |
|---|
| 75 | cat <<EOF > $TMPUPTEXMAPFILE |
|---|
| 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 |
|---|
| 80 | |
|---|
| 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 |
|---|
| 85 | uprml-hq UniJIS-UCS2-H Mincho-Medium.ttf |
|---|
| 86 | upgbm-hq UniJIS-UCS2-H Gothic-Medium.ttf |
|---|
| 87 | |
|---|
| 88 | EOF |
|---|
| 89 | |
|---|
| 90 | cat<<EOF > $TMPOTFMAPFILE |
|---|
| 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 |
|---|
| 126 | otf-cjmr-h Identity-H Mincho-Medium.ttf |
|---|
| 127 | otf-cjmr-v Identity-V Mincho-Medium.ttf |
|---|
| 128 | otf-cjmb-h Identity-H FutoMin-Bold.ttf |
|---|
| 129 | otf-cjmb-v Identity-V FutoMin-Bold.ttf |
|---|
| 130 | otf-cjgr-h Identity-H Gothic-Medium.ttf |
|---|
| 131 | otf-cjgr-v Identity-V Gothic-Medium.ttf |
|---|
| 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 |
|---|
| 138 | |
|---|
| 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 |
|---|
| 144 | otf-ujmb-h UniJIS-UTF16-H FutoMin-Bold.ttf |
|---|
| 145 | otf-ujmb-v UniJIS-UTF16-V FutoMin-Bold.ttf |
|---|
| 146 | otf-ujgr-h UniJIS-UTF16-H Gothic-Medium.ttf |
|---|
| 147 | otf-ujgr-v UniJIS-UTF16-V Gothic-Medium.ttf |
|---|
| 148 | otf-ujgb-h UniJIS-UTF16-H FutoGo-Bold.ttf |
|---|
| 149 | otf-ujgb-v UniJIS-UTF16-V FutoGo-Bold.ttf |
|---|
| 150 | otf-ujge-h UniJIS-UTF16-H FutoGo-Bold.ttf |
|---|
| 151 | otf-ujge-v UniJIS-UTF16-V FutoGo-Bold.ttf |
|---|
| 152 | otf-ujmgr-h UniJIS-UTF16-H MaruGo-Medium.ttf |
|---|
| 153 | otf-ujmgr-v UniJIS-UTF16-V MaruGo-Medium.ttf |
|---|
| 154 | |
|---|
| 155 | % Unicode JIS04 |
|---|
| 156 | otf-ujmln-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
|---|
| 157 | otf-ujmln-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
|---|
| 158 | otf-ujmrn-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
|---|
| 159 | otf-ujmrn-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
|---|
| 160 | otf-ujmbn-h UniJIS2004-UTF16-H FutoMin-Bold.ttf |
|---|
| 161 | otf-ujmbn-v UniJIS2004-UTF16-V FutoMin-Bold.ttf |
|---|
| 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 |
|---|
| 166 | otf-ujgen-h UniJIS2004-UTF16-H FutoGo-Bold.ttf |
|---|
| 167 | otf-ujgen-v UniJIS2004-UTF16-V FutoGo-Bold.ttf |
|---|
| 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 |
|---|
| 174 | |
|---|
| 175 | % TEXT, 90JIS |
|---|
| 176 | uphminl-h UniJIS-UTF16-H Mincho-Medium.ttf |
|---|
| 177 | uphminl-v UniJIS-UTF16-V Mincho-Medium.ttf |
|---|
| 178 | uphminr-h UniJIS-UTF16-H Mincho-Medium.ttf |
|---|
| 179 | uphminr-v UniJIS-UTF16-V Mincho-Medium.ttf |
|---|
| 180 | uphminb-h UniJIS-UTF16-H FutoMin-Bold.ttf |
|---|
| 181 | uphminb-v UniJIS-UTF16-V FutoMin-Bold.ttf |
|---|
| 182 | uphgothr-h UniJIS-UTF16-H Gothic-Medium.ttf |
|---|
| 183 | uphgothr-v UniJIS-UTF16-V Gothic-Medium.ttf |
|---|
| 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 | |
|---|
| 207 | uphminr-h UniJIS-UTF16-H Mincho-Medium.ttf |
|---|
| 208 | uphminr-v UniJIS-UTF16-V Mincho-Medium.ttf |
|---|
| 209 | uphgothr-h UniJIS-UTF16-H Gothic-Medium.ttf |
|---|
| 210 | uphgothr-v UniJIS-UTF16-V Gothic-Medium.ttf |
|---|
| 211 | uphminb-h UniJIS-UTF16-H FutoMin-Bold.ttf |
|---|
| 212 | uphminb-v UniJIS-UTF16-V FutoMin-Bold.ttf |
|---|
| 213 | uphgothb-h UniJIS-UTF16-H FutoGo-Bold.ttf |
|---|
| 214 | uphgothb-v UniJIS-UTF16-V FutoGo-Bold.ttf |
|---|
| 215 | uphmgothr-h UniJIS-UTF16-H MaruGo-Medium.ttf |
|---|
| 216 | uphmgothr-v UniJIS-UTF16-V MaruGo-Medium.ttf |
|---|
| 217 | EOF |
|---|
| 218 | |
|---|
| 219 | ## make these directories if these do not exists |
|---|
| 220 | mkdir -p $TEXALIASDIR $ALIASDIR |
|---|
| 221 | |
|---|
| 222 | ## remove broken symbolic links |
|---|
| 223 | rm -f $TEXALIASDIR/* |
|---|
| 224 | rm -f $ALIASDIR/* |
|---|
| 225 | #find -L $TEXALIASDIR -type l -exec rm -f \{\} \; |
|---|
| 226 | #find -L $ALIASDIR -type l -exec rm -f \{\} \; |
|---|
| 227 | |
|---|
| 228 | ## alias font |
|---|
| 229 | # tfm name fontconfig alias PostScript name |
|---|
| 230 | lnttf min Serif Mincho-Medium |
|---|
| 231 | lnttf goth Sans Gothic-Medium |
|---|
| 232 | lnttf futomin FutoMin FutoMin-Bold |
|---|
| 233 | lnttf futogo FutoGo FutoGo-Bold |
|---|
| 234 | lnttf marugo Jun MaruGo-Medium |
|---|
| 235 | |
|---|
| 236 | # make symlink for CR fonts |
|---|
| 237 | for i in /usr/share/vine/fonts.d/* |
|---|
| 238 | do |
|---|
| 239 | if echo $file | grep -q "lnttc-.*\.sh$" ; then |
|---|
| 240 | . $i |
|---|
| 241 | fi |
|---|
| 242 | done |
|---|
| 243 | |
|---|
| 244 | # |
|---|
| 245 | cp -f $TMPPTEXMAPFILE $PTEXMAPFILE |
|---|
| 246 | cp -f $TMPUPTEXMAPFILE $UPTEXMAPFILE |
|---|
| 247 | cp -f $TMPOTFMAPFILE $OTFMAPFILE |
|---|
| 248 | cp -f $TMPOTFUPMAPFILE $OTFUPMAPFILE |
|---|
| 249 | rm -f $TMPPTEXMAPFILE $TMPUPTEXMAPFILE $TMPOTFMAPFILE $TMPOTFUPMAPFILE |
|---|