summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--app-text/fop-corefonts-metrics/Manifest15
-rw-r--r--app-text/fop-corefonts-metrics/files/aliases.xml55
-rw-r--r--app-text/fop-corefonts-metrics/files/config.xsl71
-rw-r--r--app-text/fop-corefonts-metrics/files/digest-fop-corefonts-metrics-00
-rw-r--r--app-text/fop-corefonts-metrics/fop-corefonts-metrics-0.ebuild54
-rw-r--r--profiles/categories1
6 files changed, 196 insertions, 0 deletions
diff --git a/app-text/fop-corefonts-metrics/Manifest b/app-text/fop-corefonts-metrics/Manifest
new file mode 100644
index 0000000..cd81cc8
--- a/dev/null
+++ b/app-text/fop-corefonts-metrics/Manifest
@@ -0,0 +1,15 @@
+AUX aliases.xml 1290 RMD160 d812dbec7953d89034bc4551e734867d879eca9e SHA1 d3941895c5a8b274c4f9600dcb510b8d3124b26c SHA256 1aaa3c30961062f13b3a63a1e727544908d760791aaf7cfe42b36c69bf7dd273
+MD5 1f3e9bc53cad8b38df629bae59d70c31 files/aliases.xml 1290
+RMD160 d812dbec7953d89034bc4551e734867d879eca9e files/aliases.xml 1290
+SHA256 1aaa3c30961062f13b3a63a1e727544908d760791aaf7cfe42b36c69bf7dd273 files/aliases.xml 1290
+AUX config.xsl 2194 RMD160 1e808bbfb59e13d2e7f381df7b35fd6a7193063f SHA1 341e22a15fd9d9c6bb9a1326c858b72b4e884af3 SHA256 a31a91ff359cf50cd1b7f54016231679222f8a72208585c3a77e119214fff25b
+MD5 4eb29f55fdc62b0f8c78fcc2e0e926e7 files/config.xsl 2194
+RMD160 1e808bbfb59e13d2e7f381df7b35fd6a7193063f files/config.xsl 2194
+SHA256 a31a91ff359cf50cd1b7f54016231679222f8a72208585c3a77e119214fff25b files/config.xsl 2194
+EBUILD fop-corefonts-metrics-0.ebuild 1317 RMD160 fb209d9437eefd787809171678f4d0b46774c35b SHA1 6b8f33fdf1c0e883d39440b12b17a54534e81385 SHA256 19855d62944b34719a81e2a330fa492d0c5eaadba4ffcf1201c8b05fd6dcbd86
+MD5 958f3135b9f127062c9b4d06836f676f fop-corefonts-metrics-0.ebuild 1317
+RMD160 fb209d9437eefd787809171678f4d0b46774c35b fop-corefonts-metrics-0.ebuild 1317
+SHA256 19855d62944b34719a81e2a330fa492d0c5eaadba4ffcf1201c8b05fd6dcbd86 fop-corefonts-metrics-0.ebuild 1317
+MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-fop-corefonts-metrics-0 0
+RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-fop-corefonts-metrics-0 0
+SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-fop-corefonts-metrics-0 0
diff --git a/app-text/fop-corefonts-metrics/files/aliases.xml b/app-text/fop-corefonts-metrics/files/aliases.xml
new file mode 100644
index 0000000..5e7f282
--- a/dev/null
+++ b/app-text/fop-corefonts-metrics/files/aliases.xml
@@ -0,0 +1,55 @@
+<fonts>
+ <font name="AndaleMono">
+ <alias>andalemono</alias>
+ <alias>Andale Mono</alias>
+ <alias>Andale mono</alias>
+ <alias>andale mono</alias>
+ </font>
+ <font name="Arial">
+ <alias>arial</alias>
+ </font>
+ <font name="ArialBlack">
+ <alias>arialblack</alias>
+ <alias>Arial Black</alias>
+ <alias>Arial black</alias>
+ <alias>arial black</alias>
+ </font>
+ <font name="ComicSansMS">
+ <alias>comicsansms</alias>
+ <alias>Comic Sans MS</alias>
+ <alias>Comic sans ms</alias>
+ <alias>comic sans ms</alias>
+ </font>
+ <font name="CourierNew">
+ <alias>couriernew</alias>
+ <alias>Courier New</alias>
+ <alias>Courier new</alias>
+ <alias>courier new</alias>
+ </font>
+ <font name="Georgia">
+ <alias>Georgia</alias>
+ <alias>geogria</alias>
+ </font>
+ <font name="Impact">
+ <alias>Impact</alias>
+ <alias>impact</alias>
+ </font>
+ <font name="TimesNewRoman">
+ <alias>timesnewroman</alias>
+ <alias>Times New Roman</alias>
+ <alias>Times new roman</alias>
+ <alias>times new roman</alias>
+ <alias>Times</alias>
+ <alias>times</alias>
+ </font>
+ <font name="TrebuchetMS">
+ <alias>trebuchetms</alias>
+ <alias>Trebuchet MS</alias>
+ <alias>Trebuchet ms</alias>
+ <alias>trebuchet ms</alias>
+ </font>
+ <font name="Verdana">
+ <alias>Verdana</alias>
+ <alias>verdana</alias>
+ </font>
+</fonts>
diff --git a/app-text/fop-corefonts-metrics/files/config.xsl b/app-text/fop-corefonts-metrics/files/config.xsl
new file mode 100644
index 0000000..0d3eae3
--- a/dev/null
+++ b/app-text/fop-corefonts-metrics/files/config.xsl
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
+
+ <xsl:output
+ method="xml" version="1.0"
+ encoding="utf-8"
+ indent="yes"
+ omit-xml-declaration="yes"
+ media-type="text/xml" />
+
+ <xsl:param name="ttfdir"/>
+ <xsl:param name="xmldir"/>
+ <xsl:param name="destdir"/>
+ <xsl:param name="aliasfile"/>
+
+ <xsl:variable name="aliases" select="document($aliasfile)"/>
+
+ <xsl:template match="/">
+ <configuration>
+ <fonts>
+ <xsl:apply-templates select="/fonts"/>
+ </fonts>
+ </configuration>
+ </xsl:template>
+
+ <xsl:template match="font">
+ <xsl:variable name="x" select="document(concat($xmldir,'/',@name,'.xml'))"/>
+ <xsl:variable name="fn" select="$x/font-metrics/font-name"/>
+ <xsl:comment>font-name: <xsl:value-of select="$fn"/></xsl:comment>
+ <font metrics-file="{$destdir}/{@name}.xml" kerning="yes" embed-file="{$ttfdir}/{@name}.ttf">
+ <xsl:variable name="n"><!-- font name -->
+ <xsl:choose>
+ <xsl:when test="contains($fn,',')">
+ <xsl:value-of select="substring-before($fn,',')"/>
+ </xsl:when>
+ <xsl:when test="$fn">
+ <xsl:value-of select="$fn"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="a"><!-- attributes -->
+ <xsl:if test="contains($fn,',')">
+ <xsl:value-of select="substring-after($fn,',')"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="style">
+ <xsl:choose>
+ <xsl:when test="contains($a,'Italic')">italic</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="weight">
+ <xsl:choose>
+ <xsl:when test="contains($a,'Bold')">bold</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="nn" select="@name"/>
+ <xsl:for-each select="$aliases/fonts/font[@name=$n or @name=$nn]/alias[text()!=$n and text()!=$nn]">
+ <font-triplet name="{./text()}" style="{$style}" weight="{$weight}"/>
+ </xsl:for-each>
+ <font-triplet name="{$n}" style="{$style}" weight="{$weight}"/>
+ <font-triplet name="{@name}" style="normal" weight="normal"/>
+ </font>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/app-text/fop-corefonts-metrics/files/digest-fop-corefonts-metrics-0 b/app-text/fop-corefonts-metrics/files/digest-fop-corefonts-metrics-0
new file mode 100644
index 0000000..e69de29
--- a/dev/null
+++ b/app-text/fop-corefonts-metrics/files/digest-fop-corefonts-metrics-0
diff --git a/app-text/fop-corefonts-metrics/fop-corefonts-metrics-0.ebuild b/app-text/fop-corefonts-metrics/fop-corefonts-metrics-0.ebuild
new file mode 100644
index 0000000..6f617c7
--- a/dev/null
+++ b/app-text/fop-corefonts-metrics/fop-corefonts-metrics-0.ebuild
@@ -0,0 +1,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
+}
diff --git a/profiles/categories b/profiles/categories
index 2445be4..e9c4b4d 100644
--- a/profiles/categories
+++ b/profiles/categories
@@ -1 +1,2 @@
+app-text
dev-db