| 1 | #!/bin/bash |
|---|
| 2 | |
|---|
| 3 | # default font setting script for Vine Linux 5/5CR |
|---|
| 4 | # used by tex, gs, xpdf.. |
|---|
| 5 | # |
|---|
| 6 | # usage: update-defaultfont |
|---|
| 7 | |
|---|
| 8 | TEXMF=/usr/share/texmf |
|---|
| 9 | MAPFILE=$TEXMF/fonts/map/dvipdfmx/vine.map |
|---|
| 10 | TEXALIASDIR=$TEXMF/fonts/truetype |
|---|
| 11 | ALIASDIR=/usr/share/fonts/alias/TrueType |
|---|
| 12 | |
|---|
| 13 | TMPMAPFILE=$(mktemp /tmp/vine.map.XXXXXX) |
|---|
| 14 | |
|---|
| 15 | # set default font symlink |
|---|
| 16 | lnttf() { |
|---|
| 17 | F=$(fc-match -v "$2" | grep "file:" | cut -f2 -d\") |
|---|
| 18 | ln -sf $F $TEXALIASDIR/$3.ttf |
|---|
| 19 | ln -sf $F $ALIASDIR/$3.ttf |
|---|
| 20 | cat <<EOF >> $TMPMAPFILE |
|---|
| 21 | % $1 % |
|---|
| 22 | $1 H $3.ttf |
|---|
| 23 | t$1 V $3.ttf |
|---|
| 24 | $1i H $3.ttf -s .3 |
|---|
| 25 | t$1i V $3.ttf -s .3 |
|---|
| 26 | |
|---|
| 27 | EOF |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | # make symlink for CR fonts |
|---|
| 31 | lnttc() { |
|---|
| 32 | F=$(find /usr/share/fonts/ -name "$2.ttc" -type f | head -1) |
|---|
| 33 | if [ -f "$F" ]; then |
|---|
| 34 | ln -sf $F $TEXALIASDIR/$3.ttc |
|---|
| 35 | cat <<EOF >> $TMPMAPFILE |
|---|
| 36 | % $3 % |
|---|
| 37 | $1 H $3.ttc |
|---|
| 38 | t$1 V $3.ttc |
|---|
| 39 | $1i H $3.ttc -s .3 |
|---|
| 40 | t$1i V $3.ttc -s .3 |
|---|
| 41 | |
|---|
| 42 | EOF |
|---|
| 43 | fi |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | ######################################################################################## |
|---|
| 47 | |
|---|
| 48 | ## no-embedding font |
|---|
| 49 | cat <<EOF > $TMPMAPFILE |
|---|
| 50 | % Vine additional map % |
|---|
| 51 | rml H !Ryumin-Light |
|---|
| 52 | rmlv V !Ryumin-Light |
|---|
| 53 | gbm H !GothicBBB-Medium |
|---|
| 54 | gbmv V !GothicBBB-Medium |
|---|
| 55 | |
|---|
| 56 | % italic % |
|---|
| 57 | rmli H !Ryumin-Light,Italic |
|---|
| 58 | rmlvi V !Ryumin-Light,Italic |
|---|
| 59 | gbmi H !GothicBBB-Medium,Italic |
|---|
| 60 | gbmvi V !GothicBBB-Medium,Italic |
|---|
| 61 | |
|---|
| 62 | % new JIS font metric % |
|---|
| 63 | rmln H !Ryumin-Light |
|---|
| 64 | rmlnv V !Ryumin-Light |
|---|
| 65 | gbmn H !GothicBBB-Medium |
|---|
| 66 | gbmnv V !GothicBBB-Medium |
|---|
| 67 | |
|---|
| 68 | %% |
|---|
| 69 | %% Morisawa |
|---|
| 70 | %% |
|---|
| 71 | ryumin-l H Ryumin-Light |
|---|
| 72 | ryumin-l-v V Ryumin-Light |
|---|
| 73 | gtbbb-m H GothicBBB-Medium |
|---|
| 74 | gtbbb-m-v V GothicBBB-Medium |
|---|
| 75 | futomin-b H FutoMinA101-Bold |
|---|
| 76 | futomin-b-v V FutoMinA101-Bold |
|---|
| 77 | futogo-b H FutoGoB101-Bold |
|---|
| 78 | futogo-b-v V FutoGoB101-Bold |
|---|
| 79 | jun101-l H Jun101-Light |
|---|
| 80 | jun101-l-v V Jun101-Light |
|---|
| 81 | |
|---|
| 82 | EOF |
|---|
| 83 | |
|---|
| 84 | ## remove broken symbolic links |
|---|
| 85 | rm -f $TEXALIASDIR/* |
|---|
| 86 | rm -f $ALIASDIR/* |
|---|
| 87 | #find -L $TEXALIASDIR -type l -exec rm -f \{\} \; |
|---|
| 88 | #find -L $ALIASDIR -type l -exec rm -f \{\} \; |
|---|
| 89 | |
|---|
| 90 | ## alias font |
|---|
| 91 | # tfm name fontconfig alias PostScript name |
|---|
| 92 | lnttf min Serif Mincho-Medium |
|---|
| 93 | lnttf goth Sans Gothic-Medium |
|---|
| 94 | lnttf futomin FutoMin FutoMin-Bold |
|---|
| 95 | lnttf futogo FutoGo FutoGo-Bold |
|---|
| 96 | lnttf marugo Jun MaruGo-Medium |
|---|
| 97 | |
|---|
| 98 | # make symlink for CR fonts |
|---|
| 99 | for i in /usr/share/vine/fonts.d/* |
|---|
| 100 | do |
|---|
| 101 | if echo $file | grep -q "lnttc-.*\.sh$" ; then |
|---|
| 102 | . $i |
|---|
| 103 | fi |
|---|
| 104 | done |
|---|
| 105 | |
|---|
| 106 | # |
|---|
| 107 | cp -f $TMPMAPFILE $MAPFILE |
|---|
| 108 | rm -f $TMPMAPFILE |
|---|