source: projects/vutils/trunk/update-defaultfont @ 7147

Revision 7147, 5.8 KB checked in by munepi, 11 years ago (diff)

TeX Live 2012

Line 
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
8TEXMF=/var/lib/texmf
9PTEXMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/ptex-vine.map
10UPTEXMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/uptex-vine.map
11OTFMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/otf-vine.map
12OTFUPMAPFILE=$TEXMF/fonts/map/dvipdfmx/vine/otf-up-vine.map
13TEXALIASDIR=$TEXMF/fonts/truetype/vine
14ALIASDIR=/usr/share/fonts/alias/TrueType
15
16TMPPTEXMAPFILE=$(mktemp /tmp/ptex-vine.map.XXXXXX)
17TMPUPTEXMAPFILE=$(mktemp /tmp/uptex-vine.map.XXXXXX)
18TMPOTFMAPFILE=$(mktemp /tmp/otf-vine.map.XXXXXX)
19TMPOTFUPMAPFILE=$(mktemp /tmp/otf-up-vine.map.XXXXXX)
20
21# set default font symlink
22lnttf() {
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
29t$1     V       $3.ttf
30$1i     H       $3.ttf -s .3
31t$1i    V       $3.ttf -s .3
32
33EOF
34}
35
36# make symlink for CR fonts
37lnttc() {
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
44t$1     V       $3.ttc
45$1i     H       $3.ttc -s .3
46t$1i    V       $3.ttc -s .3
47
48EOF
49    fi
50}
51
52########################################################################################
53
54cat <<EOF > $TMPPTEXMAPFILE
55% Vine additional map %
56rml     H       Mincho-Medium.ttf
57rmlv    V       Mincho-Medium.ttf
58gbm     H       Gothic-Medium.ttf
59gbmv    V       Gothic-Medium.ttf
60
61% italic %
62rmli    H       Mincho-Medium.ttf,Italic
63rmlvi   V       Mincho-Medium.ttf,Italic
64gbmi    H       Gothic-Medium.ttf,Italic
65gbmvi   V       Gothic-Medium.ttf,Italic
66
67% new JIS font metric %
68rmln    H       Mincho-Medium.ttf
69rmlnv   V       Mincho-Medium.ttf
70gbmn    H       Gothic-Medium.ttf
71gbmnv   V       Gothic-Medium.ttf
72
73EOF
74
75cat <<EOF > $TMPUPTEXMAPFILE
76urml            UniJIS-UTF16-H  Mincho-Medium.ttf
77urmlv           UniJIS-UTF16-V  Mincho-Medium.ttf
78ugbm            UniJIS-UTF16-H  Gothic-Medium.ttf
79ugbmv           UniJIS-UTF16-V  Gothic-Medium.ttf
80
81uprml-h         UniJIS-UTF16-H  Mincho-Medium.ttf
82uprml-v         UniJIS-UTF16-V  Mincho-Medium.ttf
83upgbm-h         UniJIS-UTF16-H  Gothic-Medium.ttf
84upgbm-v         UniJIS-UTF16-V  Gothic-Medium.ttf
85uprml-hq        UniJIS-UCS2-H   Mincho-Medium.ttf
86upgbm-hq        UniJIS-UCS2-H   Gothic-Medium.ttf
87EOF
88
89cat<<EOF > $TMPOTFMAPFILE
90otf-ujmr-h      UniJIS-UTF16-H  Mincho-Medium.ttf
91otf-ujmr-v      UniJIS-UTF16-V  Mincho-Medium.ttf
92otf-cjmr-h      Identity-H      Mincho-Medium.ttf
93otf-cjmr-v      Identity-V      Mincho-Medium.ttf
94hminr-h         H               Mincho-Medium.ttf
95hminr-v         V               Mincho-Medium.ttf
96
97otf-ujgr-h      UniJIS-UTF16-H  Gothic-Medium.ttf
98otf-ujgr-v      UniJIS-UTF16-V  Gothic-Medium.ttf
99otf-cjgr-h      Identity-H      Gothic-Medium.ttf
100otf-cjgr-v      Identity-V      Gothic-Medium.ttf
101hgothr-h        H               Gothic-Medium.ttf
102hgothr-v        V               Gothic-Medium.ttf
103
104otf-ujmb-h      UniJIS-UTF16-H  FutoMin-Bold.ttf
105otf-ujmb-v      UniJIS-UTF16-V  FutoMin-Bold.ttf
106otf-cjmb-h      Identity-H      FutoMin-Bold.ttf
107otf-cjmb-v      Identity-V      FutoMin-Bold.ttf
108hminb-h         H               FutoMin-Bold.ttf
109hminb-v         V               FutoMin-Bold.ttf
110
111otf-ujgb-h      UniJIS-UTF16-H  FutoGo-Bold.ttf
112otf-ujgb-v      UniJIS-UTF16-V  FutoGo-Bold.ttf
113otf-cjgb-h      Identity-H      FutoGo-Bold.ttf
114otf-cjgb-v      Identity-V      FutoGo-Bold.ttf
115hgothb-h        H               FutoGo-Bold.ttf
116hgothb-v        V               FutoGo-Bold.ttf
117
118hgotheb-h       H               FutoGo-Bold.ttf
119hgotheb-v       V               FutoGo-Bold.ttf
120
121otf-ujmgr-h     UniJIS-UTF16-H  MaruGo-Medium.ttf
122otf-ujmgr-v     UniJIS-UTF16-V  MaruGo-Medium.ttf
123otf-cjmgr-h     Identity-H      MaruGo-Medium.ttf
124otf-cjmgr-v     Identity-V      MaruGo-Medium.ttf
125hmgothr-h       H               MaruGo-Medium.ttf
126hmgothr-v       V               MaruGo-Medium.ttf
127
128otf-ujml-h      UniJIS-UTF16-H  Mincho-Medium.ttf
129otf-ujml-v      UniJIS-UTF16-V  Mincho-Medium.ttf
130otf-cjml-h      Identity-H      Mincho-Medium.ttf
131otf-cjml-v      Identity-V      Mincho-Medium.ttf
132hminl-h         H               Mincho-Medium.ttf
133hminl-v         V               Mincho-Medium.ttf
134
135% JIS X 0213:2004 %
136otf-ujmrn-h     UniJIS2004-UTF16-H      Mincho-Medium.ttf
137otf-ujmrn-v     UniJIS2004-UTF16-V      Mincho-Medium.ttf
138hminrn-h        H                       Mincho-Medium.ttf
139hminrn-v        V                       Mincho-Medium.ttf
140
141otf-ujgrn-h     UniJIS2004-UTF16-H      Gothic-Medium.ttf
142otf-ujgrn-v     UniJIS2004-UTF16-V      Gothic-Medium.ttf
143hgothrn-h       H                       Gothic-Medium.ttf
144hgothrn-v       V                       Gothic-Medium.ttf
145
146otf-ujmbn-h     UniJIS2004-UTF16-H      FutoMin-Bold.ttf
147otf-ujmbn-v     UniJIS2004-UTF16-V      FutoMin-Bold.ttf
148hminbn-h        H                       FutoMin-Bold.ttf
149hminbn-v        V                       FutoMin-Bold.ttf
150
151otf-ujgbn-h     UniJIS2004-UTF16-H      FutoGo-Bold.ttf
152otf-ujgbn-v     UniJIS2004-UTF16-V      FutoGo-Bold.ttf
153hgothbn-h       H                       FutoGo-Bold.ttf
154hgothbn-v       V                       FutoGo-Bold.ttf
155
156otf-ujmgrn-h    UniJIS2004-UTF16-H      MaruGo-Medium.ttf
157otf-ujmgrn-v    UniJIS2004-UTF16-V      MaruGo-Medium.ttf
158hmgothrn-h      H                       MaruGo-Medium.ttf
159hmgothrn-v      V                       MaruGo-Medium.ttf
160
161otf-ujmln-h     UniJIS2004-UTF16-H      Mincho-Medium.ttf
162otf-ujmln-v     UniJIS2004-UTF16-V      Mincho-Medium.ttf
163hminln-h        H                       Mincho-Medium.ttf
164hminln-v        V                       Mincho-Medium.ttf
165EOF
166
167cat<<EOF > $TMPOTFUPMAPFILE
168uphminr-h       UniJIS-UTF16-H  Mincho-Medium.ttf
169uphminr-v       UniJIS-UTF16-V  Mincho-Medium.ttf
170uphgothr-h      UniJIS-UTF16-H  Gothic-Medium.ttf
171uphgothr-v      UniJIS-UTF16-V  Gothic-Medium.ttf
172uphminb-h       UniJIS-UTF16-H  FutoMin-Bold.ttf
173uphminb-v       UniJIS-UTF16-V  FutoMin-Bold.ttf
174uphgothb-h      UniJIS-UTF16-H  FutoGo-Bold.ttf
175uphgothb-v      UniJIS-UTF16-V  FutoGo-Bold.ttf
176uphmgothr-h     UniJIS-UTF16-H  MaruGo-Medium.ttf
177uphmgothr-v     UniJIS-UTF16-V  MaruGo-Medium.ttf
178EOF
179
180## make these directories if these do not exists
181mkdir -p $TEXALIASDIR $ALIASDIR
182
183## remove broken symbolic links
184rm -f $TEXALIASDIR/*
185rm -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
191lnttf min       Serif                           Mincho-Medium
192lnttf goth      Sans                            Gothic-Medium
193lnttf futomin   FutoMin                         FutoMin-Bold
194lnttf futogo    FutoGo                          FutoGo-Bold
195lnttf marugo    Jun                             MaruGo-Medium
196
197# make symlink for CR fonts
198for i in /usr/share/vine/fonts.d/*
199do
200  if echo $file | grep -q "lnttc-.*\.sh$" ; then
201    . $i
202  fi
203done
204
205#
206cp -f $TMPPTEXMAPFILE $PTEXMAPFILE
207cp -f $TMPUPTEXMAPFILE $UPTEXMAPFILE
208cp -f $TMPOTFMAPFILE $OTFMAPFILE
209cp -f $TMPOTFUPMAPFILE $OTFUPMAPFILE
210rm -f $TMPPTEXMAPFILE $TMPUPTEXMAPFILE $TMPOTFMAPFILE $TMPOTFUPMAPFILE
Note: See TracBrowser for help on using the repository browser.