[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 % |
---|
[7147] | 56 | rml H Mincho-Medium.ttf |
---|
| 57 | rmlv V Mincho-Medium.ttf |
---|
| 58 | gbm H Gothic-Medium.ttf |
---|
| 59 | gbmv V Gothic-Medium.ttf |
---|
[1120] | 60 | |
---|
| 61 | % italic % |
---|
[7147] | 62 | rmli H Mincho-Medium.ttf,Italic |
---|
| 63 | rmlvi V Mincho-Medium.ttf,Italic |
---|
| 64 | gbmi H Gothic-Medium.ttf,Italic |
---|
| 65 | gbmvi V Gothic-Medium.ttf,Italic |
---|
[1120] | 66 | |
---|
| 67 | % new JIS font metric % |
---|
[7147] | 68 | rmln H Mincho-Medium.ttf |
---|
| 69 | rmlnv V Mincho-Medium.ttf |
---|
| 70 | gbmn H Gothic-Medium.ttf |
---|
| 71 | gbmnv V Gothic-Medium.ttf |
---|
[1120] | 72 | |
---|
[7147] | 73 | EOF |
---|
[1120] | 74 | |
---|
[7147] | 75 | cat <<EOF > $TMPUPTEXMAPFILE |
---|
| 76 | urml UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 77 | urmlv UniJIS-UTF16-V Mincho-Medium.ttf |
---|
| 78 | ugbm UniJIS-UTF16-H Gothic-Medium.ttf |
---|
| 79 | ugbmv UniJIS-UTF16-V Gothic-Medium.ttf |
---|
| 80 | |
---|
| 81 | uprml-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 82 | uprml-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
| 83 | upgbm-h UniJIS-UTF16-H Gothic-Medium.ttf |
---|
| 84 | upgbm-v UniJIS-UTF16-V Gothic-Medium.ttf |
---|
| 85 | uprml-hq UniJIS-UCS2-H Mincho-Medium.ttf |
---|
| 86 | upgbm-hq UniJIS-UCS2-H Gothic-Medium.ttf |
---|
[1120] | 87 | EOF |
---|
| 88 | |
---|
[7147] | 89 | cat<<EOF > $TMPOTFMAPFILE |
---|
| 90 | otf-ujmr-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 91 | otf-ujmr-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
| 92 | otf-cjmr-h Identity-H Mincho-Medium.ttf |
---|
| 93 | otf-cjmr-v Identity-V Mincho-Medium.ttf |
---|
| 94 | hminr-h H Mincho-Medium.ttf |
---|
| 95 | hminr-v V Mincho-Medium.ttf |
---|
| 96 | |
---|
| 97 | otf-ujgr-h UniJIS-UTF16-H Gothic-Medium.ttf |
---|
| 98 | otf-ujgr-v UniJIS-UTF16-V Gothic-Medium.ttf |
---|
| 99 | otf-cjgr-h Identity-H Gothic-Medium.ttf |
---|
| 100 | otf-cjgr-v Identity-V Gothic-Medium.ttf |
---|
| 101 | hgothr-h H Gothic-Medium.ttf |
---|
| 102 | hgothr-v V Gothic-Medium.ttf |
---|
| 103 | |
---|
| 104 | otf-ujmb-h UniJIS-UTF16-H FutoMin-Bold.ttf |
---|
| 105 | otf-ujmb-v UniJIS-UTF16-V FutoMin-Bold.ttf |
---|
| 106 | otf-cjmb-h Identity-H FutoMin-Bold.ttf |
---|
| 107 | otf-cjmb-v Identity-V FutoMin-Bold.ttf |
---|
| 108 | hminb-h H FutoMin-Bold.ttf |
---|
| 109 | hminb-v V FutoMin-Bold.ttf |
---|
| 110 | |
---|
| 111 | otf-ujgb-h UniJIS-UTF16-H FutoGo-Bold.ttf |
---|
| 112 | otf-ujgb-v UniJIS-UTF16-V FutoGo-Bold.ttf |
---|
| 113 | otf-cjgb-h Identity-H FutoGo-Bold.ttf |
---|
| 114 | otf-cjgb-v Identity-V FutoGo-Bold.ttf |
---|
| 115 | hgothb-h H FutoGo-Bold.ttf |
---|
| 116 | hgothb-v V FutoGo-Bold.ttf |
---|
| 117 | |
---|
| 118 | hgotheb-h H FutoGo-Bold.ttf |
---|
| 119 | hgotheb-v V FutoGo-Bold.ttf |
---|
| 120 | |
---|
| 121 | otf-ujmgr-h UniJIS-UTF16-H MaruGo-Medium.ttf |
---|
| 122 | otf-ujmgr-v UniJIS-UTF16-V MaruGo-Medium.ttf |
---|
| 123 | otf-cjmgr-h Identity-H MaruGo-Medium.ttf |
---|
| 124 | otf-cjmgr-v Identity-V MaruGo-Medium.ttf |
---|
| 125 | hmgothr-h H MaruGo-Medium.ttf |
---|
| 126 | hmgothr-v V MaruGo-Medium.ttf |
---|
| 127 | |
---|
| 128 | otf-ujml-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 129 | otf-ujml-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
| 130 | otf-cjml-h Identity-H Mincho-Medium.ttf |
---|
| 131 | otf-cjml-v Identity-V Mincho-Medium.ttf |
---|
| 132 | hminl-h H Mincho-Medium.ttf |
---|
| 133 | hminl-v V Mincho-Medium.ttf |
---|
| 134 | |
---|
| 135 | % JIS X 0213:2004 % |
---|
| 136 | otf-ujmrn-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 137 | otf-ujmrn-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
| 138 | hminrn-h H Mincho-Medium.ttf |
---|
| 139 | hminrn-v V Mincho-Medium.ttf |
---|
| 140 | |
---|
| 141 | otf-ujgrn-h UniJIS2004-UTF16-H Gothic-Medium.ttf |
---|
| 142 | otf-ujgrn-v UniJIS2004-UTF16-V Gothic-Medium.ttf |
---|
| 143 | hgothrn-h H Gothic-Medium.ttf |
---|
| 144 | hgothrn-v V Gothic-Medium.ttf |
---|
| 145 | |
---|
| 146 | otf-ujmbn-h UniJIS2004-UTF16-H FutoMin-Bold.ttf |
---|
| 147 | otf-ujmbn-v UniJIS2004-UTF16-V FutoMin-Bold.ttf |
---|
| 148 | hminbn-h H FutoMin-Bold.ttf |
---|
| 149 | hminbn-v V FutoMin-Bold.ttf |
---|
| 150 | |
---|
| 151 | otf-ujgbn-h UniJIS2004-UTF16-H FutoGo-Bold.ttf |
---|
| 152 | otf-ujgbn-v UniJIS2004-UTF16-V FutoGo-Bold.ttf |
---|
| 153 | hgothbn-h H FutoGo-Bold.ttf |
---|
| 154 | hgothbn-v V FutoGo-Bold.ttf |
---|
| 155 | |
---|
| 156 | otf-ujmgrn-h UniJIS2004-UTF16-H MaruGo-Medium.ttf |
---|
| 157 | otf-ujmgrn-v UniJIS2004-UTF16-V MaruGo-Medium.ttf |
---|
| 158 | hmgothrn-h H MaruGo-Medium.ttf |
---|
| 159 | hmgothrn-v V MaruGo-Medium.ttf |
---|
| 160 | |
---|
| 161 | otf-ujmln-h UniJIS2004-UTF16-H Mincho-Medium.ttf |
---|
| 162 | otf-ujmln-v UniJIS2004-UTF16-V Mincho-Medium.ttf |
---|
| 163 | hminln-h H Mincho-Medium.ttf |
---|
| 164 | hminln-v V Mincho-Medium.ttf |
---|
| 165 | EOF |
---|
| 166 | |
---|
| 167 | cat<<EOF > $TMPOTFUPMAPFILE |
---|
| 168 | uphminr-h UniJIS-UTF16-H Mincho-Medium.ttf |
---|
| 169 | uphminr-v UniJIS-UTF16-V Mincho-Medium.ttf |
---|
| 170 | uphgothr-h UniJIS-UTF16-H Gothic-Medium.ttf |
---|
| 171 | uphgothr-v UniJIS-UTF16-V Gothic-Medium.ttf |
---|
| 172 | uphminb-h UniJIS-UTF16-H FutoMin-Bold.ttf |
---|
| 173 | uphminb-v UniJIS-UTF16-V FutoMin-Bold.ttf |
---|
| 174 | uphgothb-h UniJIS-UTF16-H FutoGo-Bold.ttf |
---|
| 175 | uphgothb-v UniJIS-UTF16-V FutoGo-Bold.ttf |
---|
| 176 | uphmgothr-h UniJIS-UTF16-H MaruGo-Medium.ttf |
---|
| 177 | uphmgothr-v UniJIS-UTF16-V MaruGo-Medium.ttf |
---|
| 178 | EOF |
---|
| 179 | |
---|
| 180 | ## make these directories if these do not exists |
---|
| 181 | mkdir -p $TEXALIASDIR $ALIASDIR |
---|
| 182 | |
---|
[1120] | 183 | ## remove broken symbolic links |
---|
| 184 | rm -f $TEXALIASDIR/* |
---|
| 185 | rm -f $ALIASDIR/* |
---|
| 186 | #find -L $TEXALIASDIR -type l -exec rm -f \{\} \; |
---|
| 187 | #find -L $ALIASDIR -type l -exec rm -f \{\} \; |
---|
| 188 | |
---|
| 189 | ## alias font |
---|
| 190 | # tfm name fontconfig alias PostScript name |
---|
| 191 | lnttf min Serif Mincho-Medium |
---|
| 192 | lnttf goth Sans Gothic-Medium |
---|
| 193 | lnttf futomin FutoMin FutoMin-Bold |
---|
| 194 | lnttf futogo FutoGo FutoGo-Bold |
---|
| 195 | lnttf marugo Jun MaruGo-Medium |
---|
| 196 | |
---|
| 197 | # make symlink for CR fonts |
---|
| 198 | for i in /usr/share/vine/fonts.d/* |
---|
| 199 | do |
---|
| 200 | if echo $file | grep -q "lnttc-.*\.sh$" ; then |
---|
| 201 | . $i |
---|
| 202 | fi |
---|
| 203 | done |
---|
| 204 | |
---|
| 205 | # |
---|
[7147] | 206 | cp -f $TMPPTEXMAPFILE $PTEXMAPFILE |
---|
| 207 | cp -f $TMPUPTEXMAPFILE $UPTEXMAPFILE |
---|
| 208 | cp -f $TMPOTFMAPFILE $OTFMAPFILE |
---|
| 209 | cp -f $TMPOTFUPMAPFILE $OTFUPMAPFILE |
---|
| 210 | rm -f $TMPPTEXMAPFILE $TMPUPTEXMAPFILE $TMPOTFMAPFILE $TMPOTFUPMAPFILE |
---|