[1120] | 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 % |
---|
[5241] | 51 | % NOTE: rml, rmlv, gbm, gbmv are provided by |
---|
| 52 | % /usr/share/texmf/fonts/map/dvipdfmx/ptex-XXXXX.map |
---|
| 53 | %rml H !Ryumin-Light |
---|
| 54 | %rmlv V !Ryumin-Light |
---|
| 55 | %gbm H !GothicBBB-Medium |
---|
| 56 | %gbmv V !GothicBBB-Medium |
---|
[1120] | 57 | |
---|
| 58 | % italic % |
---|
| 59 | rmli H !Ryumin-Light,Italic |
---|
| 60 | rmlvi V !Ryumin-Light,Italic |
---|
| 61 | gbmi H !GothicBBB-Medium,Italic |
---|
| 62 | gbmvi V !GothicBBB-Medium,Italic |
---|
| 63 | |
---|
| 64 | % new JIS font metric % |
---|
| 65 | rmln H !Ryumin-Light |
---|
| 66 | rmlnv V !Ryumin-Light |
---|
| 67 | gbmn H !GothicBBB-Medium |
---|
| 68 | gbmnv V !GothicBBB-Medium |
---|
| 69 | |
---|
| 70 | %% |
---|
| 71 | %% Morisawa |
---|
| 72 | %% |
---|
[5241] | 73 | % NOTE: these fonts are provided by |
---|
| 74 | % /usr/share/texmf/fonts/map/dvipdfmx/morisawa.map |
---|
| 75 | %ryumin-l H Ryumin-Light |
---|
| 76 | %ryumin-l-v V Ryumin-Light |
---|
| 77 | %gtbbb-m H GothicBBB-Medium |
---|
| 78 | %gtbbb-m-v V GothicBBB-Medium |
---|
| 79 | %futomin-b H FutoMinA101-Bold |
---|
| 80 | %futomin-b-v V FutoMinA101-Bold |
---|
| 81 | %futogo-b H FutoGoB101-Bold |
---|
| 82 | %futogo-b-v V FutoGoB101-Bold |
---|
| 83 | %jun101-l H Jun101-Light |
---|
| 84 | %jun101-l-v V Jun101-Light |
---|
[1120] | 85 | |
---|
| 86 | EOF |
---|
| 87 | |
---|
| 88 | ## remove broken symbolic links |
---|
| 89 | rm -f $TEXALIASDIR/* |
---|
| 90 | rm -f $ALIASDIR/* |
---|
| 91 | #find -L $TEXALIASDIR -type l -exec rm -f \{\} \; |
---|
| 92 | #find -L $ALIASDIR -type l -exec rm -f \{\} \; |
---|
| 93 | |
---|
| 94 | ## alias font |
---|
| 95 | # tfm name fontconfig alias PostScript name |
---|
| 96 | lnttf min Serif Mincho-Medium |
---|
| 97 | lnttf goth Sans Gothic-Medium |
---|
| 98 | lnttf futomin FutoMin FutoMin-Bold |
---|
| 99 | lnttf futogo FutoGo FutoGo-Bold |
---|
| 100 | lnttf marugo Jun MaruGo-Medium |
---|
| 101 | |
---|
| 102 | # make symlink for CR fonts |
---|
| 103 | for i in /usr/share/vine/fonts.d/* |
---|
| 104 | do |
---|
| 105 | if echo $file | grep -q "lnttc-.*\.sh$" ; then |
---|
| 106 | . $i |
---|
| 107 | fi |
---|
| 108 | done |
---|
| 109 | |
---|
| 110 | # |
---|
| 111 | cp -f $TMPMAPFILE $MAPFILE |
---|
| 112 | rm -f $TMPMAPFILE |
---|