blob: 6f617c75dbd37b269a7d3842cef06d97ca10e0ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
DESCRIPTION="Extra fonts metrics for fop"
HOMEPAGE="http://hacker.klever.net/"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND="
media-fonts/corefonts
>=dev-java/fop-0.20.5-r7"
DEPEND="${RDEPEND}
dev-libs/libxslt"
src_compile() {
mkdir ${S}
cd ${S}
sed -e 's/org.apache.fop.apps.Fop/org.apache.fop.fonts.apps.TTFReader/' \
</usr/bin/fop >fop-ttfreader
mkdir xml
exec 5>fontlist.xml
echo '<fonts>' >&5
for f in /usr/share/fonts/corefonts/*.ttf ; do
fn="${f#/usr/share/fonts/corefonts/}"
fn="${fn%.ttf}"
ebegin "Creating ${fn} xml"
rm -f xml/${fn}.xml
sh fop-ttfreader -enc utf-8 ${f} xml/${fn}.xml &>/dev/null || rm xml/${fn}.xml
if [ -e "xml/${fn}.xml" ] ; then
echo ' <font name="'"${fn}"'" ttf="'"${f}"'" />' >&5
eend 0
else
eend 1
fi
done
echo '</fonts>' >&5
xsltproc -o userconfig.xml \
--stringparam ttfdir /usr/share/fonts/corefonts \
--stringparam xmldir ${S}/xml \
--stringparam destdir /usr/share/fop/fonts/corefonts \
--stringparam aliasfile ${FILESDIR}/aliases.xml \
${FILESDIR}/config.xsl fontlist.xml
}
src_install() {
insinto /usr/share/fop/fonts/corefonts
doins xml/*.xml
doins userconfig.xml
}
|