diff options
Diffstat (limited to 'packages/qte-fonts-common')
-rw-r--r-- | packages/qte-fonts-common/qte-fonts-common/update-qtfontdir | 70 | ||||
-rw-r--r-- | packages/qte-fonts-common/qte-fonts-common_3.3.3.bb | 2 |
2 files changed, 71 insertions, 1 deletions
diff --git a/packages/qte-fonts-common/qte-fonts-common/update-qtfontdir b/packages/qte-fonts-common/qte-fonts-common/update-qtfontdir index e69de29bb2..788c0b307d 100644 --- a/packages/qte-fonts-common/qte-fonts-common/update-qtfontdir +++ b/packages/qte-fonts-common/qte-fonts-common/update-qtfontdir @@ -0,0 +1,70 @@ +#!/bin/sh + +usage() +{ + echo "usage: $0 [font directory, defaults to QTDIR/lib/fonts]" + exit 1 +} + +setVar() +{ + eval "$1='$2'" +} + +getVar() +{ + eval "echo \$$1" +} + +handleQPF() +{ + base=`basename $1` + family=`echo $base|cut -d_ -f1` + pt=`echo $base|cut -d_ -f2` + weight=`echo $base|cut -d_ -f3|sed -e 's,i$,,'` + if (echo $base|cut -d_ -f3|grep -q 'i$'); then + italic="y" + else + italic="n" + fi + echo "$family $base.qpf QPF $italic $weight $pt u" +} + +if [ -z "$1" ]; then + if [ -n "$QTDIR" ]; then + fontdir=$QTDIR/lib/fonts + else + fontdir=/opt/QtPalmtop/lib/fonts + fi +else + fontdir=$1 +fi + +if ! [ -d $fontdir ]; then + echo Error: $fontdir not a directory + exit 1 +fi + +if [ -e $fontdir/fontdir ]; then + if find $fontdir -newer $fontdir/fontdir | grep "\(qpf\|ttf\)"; then + echo "fontdir needs updating..." + else + echo "fontdir already up to date - exiting" + exit 0 + fi + cat $fontdir/fontdir | grep -v '\.qpf' > $fontdir/fontdir.new +else + echo "fontdir not existing. creating..." +fi + +( + for file in `ls $fontdir/*.qpf|sed -e's,\.qpf$,,; s,_t[^_]*$,,;'|sort -u`; do + handleQPF $file + done +) >> $fontdir/fontdir.new + +mv $fontdir/fontdir.new $fontdir/fontdir + +exit 0 + +# vim:ai:et:sts=4:sw=4:tw=0: diff --git a/packages/qte-fonts-common/qte-fonts-common_3.3.3.bb b/packages/qte-fonts-common/qte-fonts-common_3.3.3.bb index 1cda5ac913..803d6923be 100644 --- a/packages/qte-fonts-common/qte-fonts-common_3.3.3.bb +++ b/packages/qte-fonts-common/qte-fonts-common_3.3.3.bb @@ -3,7 +3,7 @@ DESCRIPTION= "Tools to update the Qt fontdir" MAINTAINER = "M&N Solutions <info@mn-solutions.de>" LICENSE = "GPL/QPL" PACKAGE_ARCH = "all" -PR = "r1" +PR = "r2" SRC_URI = "ftp://ftp.trolltech.com/pub/qt/source/qt-embedded-free-${PV}.tar.gz" SRC_URI += "file://update-qtfontdir" |