-rw-r--r-- | qt/control/qte-fonts-common.control | 4 | ||||
-rw-r--r-- | qt/qte234-for-opie091-fontdir.patch | 65 | ||||
-rwxr-xr-x | root/usr/sbin/update-qtfontdir | 62 |
3 files changed, 64 insertions, 67 deletions
diff --git a/qt/control/qte-fonts-common.control b/qt/control/qte-fonts-common.control index 403aa88..b378e02 100644 --- a/qt/control/qte-fonts-common.control +++ b/qt/control/qte-fonts-common.control | |||
@@ -1,8 +1,8 @@ | |||
1 | Package: qte-fonts-common | 1 | Package: qte-fonts-common |
2 | Files: $QTDIR/bin/update-qtfontdir | 2 | Files: $OPIEDIR/root/usr/sbin/update-qtfontdir |
3 | Priority: required | 3 | Priority: required |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1:$QTE_VERSION-$QTE_REVISION | 7 | Version: 1:$QTE_VERSION-$QTE_REVISION-1 |
8 | Description: Qt/Embedded font common files | 8 | Description: Qt/Embedded font common files |
diff --git a/qt/qte234-for-opie091-fontdir.patch b/qt/qte234-for-opie091-fontdir.patch deleted file mode 100644 index 3b3daf4..0000000 --- a/qt/qte234-for-opie091-fontdir.patch +++ b/dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | --- /dev/null2003-01-17 15:37:44.000000000 -0600 | ||
2 | +++ bin/update-qtfontdir2003-04-22 00:37:07.000000000 -0500 | ||
3 | @@ -0,0 +1,62 @@ | ||
4 | +#!/bin/sh | ||
5 | + | ||
6 | +usage() | ||
7 | +{ | ||
8 | + echo "usage: $0 [font directory, defaults to QTDIR/lib/fonts]" | ||
9 | + exit 1 | ||
10 | +} | ||
11 | + | ||
12 | +setVar() | ||
13 | +{ | ||
14 | + eval "$1='$2'" | ||
15 | +} | ||
16 | + | ||
17 | +getVar() | ||
18 | +{ | ||
19 | + eval "echo \$$1" | ||
20 | +} | ||
21 | + | ||
22 | +handleQPF() | ||
23 | +{ | ||
24 | + base=`basename $1` | ||
25 | + family=`echo $base|cut -d_ -f1` | ||
26 | + pt=`echo $base|cut -d_ -f2` | ||
27 | + weight=`echo $base|cut -d_ -f3|sed -e 's,i$,,'` | ||
28 | + if (echo $base|cut -d_ -f3|grep -q 'i$'); then | ||
29 | + italic="y" | ||
30 | + else | ||
31 | + italic="n" | ||
32 | + fi | ||
33 | + echo "$family $base.qpf QPF $italic $weight $pt u" | ||
34 | +} | ||
35 | + | ||
36 | +if [ -z "$1" ]; then | ||
37 | + if [ -n "$QTDIR" ]; then | ||
38 | + fontdir=$QTDIR/lib/fonts | ||
39 | + else | ||
40 | + fontdir=/opt/QtPalmtop/lib/fonts | ||
41 | + fi | ||
42 | +else | ||
43 | + fontdir=$1 | ||
44 | +fi | ||
45 | + | ||
46 | +if ! [ -d $fontdir ]; then | ||
47 | + echo Error: $fontdir not a directory | ||
48 | + exit 1 | ||
49 | +fi | ||
50 | + | ||
51 | +if [ -e $fontdir/fontdir ]; then | ||
52 | + cat $fontdir/fontdir | grep -v '\.qpf' > $fontdir/fontdir.new | ||
53 | +fi | ||
54 | + | ||
55 | +( | ||
56 | + for file in `ls $fontdir/*.qpf|sed -e's,\.qpf$,,; s,_t[^_]*$,,;'|sort -u`; do | ||
57 | + handleQPF $file | ||
58 | + done | ||
59 | +) >> $fontdir/fontdir.new | ||
60 | + | ||
61 | +mv $fontdir/fontdir.new $fontdir/fontdir | ||
62 | + | ||
63 | +exit 0 | ||
64 | + | ||
65 | +# vim:ai:et:sts=4:sw=4:tw=0: | ||
diff --git a/root/usr/sbin/update-qtfontdir b/root/usr/sbin/update-qtfontdir new file mode 100755 index 0000000..6df7b50 --- a/dev/null +++ b/root/usr/sbin/update-qtfontdir | |||
@@ -0,0 +1,62 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | usage() | ||
4 | { | ||
5 | echo "usage: $0 [font directory, defaults to QTDIR/lib/fonts]" | ||
6 | exit 1 | ||
7 | } | ||
8 | |||
9 | setVar() | ||
10 | { | ||
11 | eval "$1='$2'" | ||
12 | } | ||
13 | |||
14 | getVar() | ||
15 | { | ||
16 | eval "echo \$$1" | ||
17 | } | ||
18 | |||
19 | handleQPF() | ||
20 | { | ||
21 | base=`basename $1` | ||
22 | family=`echo $base|cut -d_ -f1` | ||
23 | pt=`echo $base|cut -d_ -f2` | ||
24 | weight=`echo $base|cut -d_ -f3|sed -e 's,i$,,'` | ||
25 | if (echo $base|cut -d_ -f3|grep -q 'i$'); then | ||
26 | italic="y" | ||
27 | else | ||
28 | italic="n" | ||
29 | fi | ||
30 | echo "$family $base.qpf QPF $italic $weight $pt u" | ||
31 | } | ||
32 | |||
33 | if [ -z "$1" ]; then | ||
34 | if [ -n "$QTDIR" ]; then | ||
35 | fontdir=$QTDIR/lib/fonts | ||
36 | else | ||
37 | fontdir=/opt/QtPalmtop/lib/fonts | ||
38 | fi | ||
39 | else | ||
40 | fontdir=$1 | ||
41 | fi | ||
42 | |||
43 | if ! [ -d $fontdir ]; then | ||
44 | echo Error: $fontdir not a directory | ||
45 | exit 1 | ||
46 | fi | ||
47 | |||
48 | if [ -e $fontdir/fontdir ]; then | ||
49 | cat $fontdir/fontdir | grep -v '\.qpf' > $fontdir/fontdir.new | ||
50 | fi | ||
51 | |||
52 | ( | ||
53 | for file in `ls $fontdir/*.qpf|sed -e's,\.qpf$,,; s,_t[^_]*$,,;'|sort -u`; do | ||
54 | handleQPF $file | ||
55 | done | ||
56 | ) >> $fontdir/fontdir.new | ||
57 | |||
58 | mv $fontdir/fontdir.new $fontdir/fontdir | ||
59 | |||
60 | exit 0 | ||
61 | |||
62 | # vim:ai:et:sts=4:sw=4:tw=0: | ||