author | Michael Krelin <hacker@klever.net> | 2007-02-21 22:00:17 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-02-21 22:00:17 (UTC) |
commit | 2c0667333416d9ecc74c92475c67d0e160921ff9 (patch) (unidiff) | |
tree | 7aae17a697c2ff5543a4a8349f7cd3ff0c2f9ad5 /app-text | |
parent | 367d0bf3c9eca4192a09bc5688338aa99f62d86a (diff) | |
download | misc-2c0667333416d9ecc74c92475c67d0e160921ff9.zip misc-2c0667333416d9ecc74c92475c67d0e160921ff9.tar.gz misc-2c0667333416d9ecc74c92475c67d0e160921ff9.tar.bz2 |
fop-corefonts-metrics
5 files changed, 195 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 @@ | |||
1 | AUX aliases.xml 1290 RMD160 d812dbec7953d89034bc4551e734867d879eca9e SHA1 d3941895c5a8b274c4f9600dcb510b8d3124b26c SHA256 1aaa3c30961062f13b3a63a1e727544908d760791aaf7cfe42b36c69bf7dd273 | ||
2 | MD5 1f3e9bc53cad8b38df629bae59d70c31 files/aliases.xml 1290 | ||
3 | RMD160 d812dbec7953d89034bc4551e734867d879eca9e files/aliases.xml 1290 | ||
4 | SHA256 1aaa3c30961062f13b3a63a1e727544908d760791aaf7cfe42b36c69bf7dd273 files/aliases.xml 1290 | ||
5 | AUX config.xsl 2194 RMD160 1e808bbfb59e13d2e7f381df7b35fd6a7193063f SHA1 341e22a15fd9d9c6bb9a1326c858b72b4e884af3 SHA256 a31a91ff359cf50cd1b7f54016231679222f8a72208585c3a77e119214fff25b | ||
6 | MD5 4eb29f55fdc62b0f8c78fcc2e0e926e7 files/config.xsl 2194 | ||
7 | RMD160 1e808bbfb59e13d2e7f381df7b35fd6a7193063f files/config.xsl 2194 | ||
8 | SHA256 a31a91ff359cf50cd1b7f54016231679222f8a72208585c3a77e119214fff25b files/config.xsl 2194 | ||
9 | EBUILD fop-corefonts-metrics-0.ebuild 1317 RMD160 fb209d9437eefd787809171678f4d0b46774c35b SHA1 6b8f33fdf1c0e883d39440b12b17a54534e81385 SHA256 19855d62944b34719a81e2a330fa492d0c5eaadba4ffcf1201c8b05fd6dcbd86 | ||
10 | MD5 958f3135b9f127062c9b4d06836f676f fop-corefonts-metrics-0.ebuild 1317 | ||
11 | RMD160 fb209d9437eefd787809171678f4d0b46774c35b fop-corefonts-metrics-0.ebuild 1317 | ||
12 | SHA256 19855d62944b34719a81e2a330fa492d0c5eaadba4ffcf1201c8b05fd6dcbd86 fop-corefonts-metrics-0.ebuild 1317 | ||
13 | MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-fop-corefonts-metrics-0 0 | ||
14 | RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-fop-corefonts-metrics-0 0 | ||
15 | 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 @@ | |||
1 | <fonts> | ||
2 | <font name="AndaleMono"> | ||
3 | <alias>andalemono</alias> | ||
4 | <alias>Andale Mono</alias> | ||
5 | <alias>Andale mono</alias> | ||
6 | <alias>andale mono</alias> | ||
7 | </font> | ||
8 | <font name="Arial"> | ||
9 | <alias>arial</alias> | ||
10 | </font> | ||
11 | <font name="ArialBlack"> | ||
12 | <alias>arialblack</alias> | ||
13 | <alias>Arial Black</alias> | ||
14 | <alias>Arial black</alias> | ||
15 | <alias>arial black</alias> | ||
16 | </font> | ||
17 | <font name="ComicSansMS"> | ||
18 | <alias>comicsansms</alias> | ||
19 | <alias>Comic Sans MS</alias> | ||
20 | <alias>Comic sans ms</alias> | ||
21 | <alias>comic sans ms</alias> | ||
22 | </font> | ||
23 | <font name="CourierNew"> | ||
24 | <alias>couriernew</alias> | ||
25 | <alias>Courier New</alias> | ||
26 | <alias>Courier new</alias> | ||
27 | <alias>courier new</alias> | ||
28 | </font> | ||
29 | <font name="Georgia"> | ||
30 | <alias>Georgia</alias> | ||
31 | <alias>geogria</alias> | ||
32 | </font> | ||
33 | <font name="Impact"> | ||
34 | <alias>Impact</alias> | ||
35 | <alias>impact</alias> | ||
36 | </font> | ||
37 | <font name="TimesNewRoman"> | ||
38 | <alias>timesnewroman</alias> | ||
39 | <alias>Times New Roman</alias> | ||
40 | <alias>Times new roman</alias> | ||
41 | <alias>times new roman</alias> | ||
42 | <alias>Times</alias> | ||
43 | <alias>times</alias> | ||
44 | </font> | ||
45 | <font name="TrebuchetMS"> | ||
46 | <alias>trebuchetms</alias> | ||
47 | <alias>Trebuchet MS</alias> | ||
48 | <alias>Trebuchet ms</alias> | ||
49 | <alias>trebuchet ms</alias> | ||
50 | </font> | ||
51 | <font name="Verdana"> | ||
52 | <alias>Verdana</alias> | ||
53 | <alias>verdana</alias> | ||
54 | </font> | ||
55 | </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 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <xsl:stylesheet version="1.0" | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > | ||
4 | |||
5 | <xsl:output | ||
6 | method="xml" version="1.0" | ||
7 | encoding="utf-8" | ||
8 | indent="yes" | ||
9 | omit-xml-declaration="yes" | ||
10 | media-type="text/xml" /> | ||
11 | |||
12 | <xsl:param name="ttfdir"/> | ||
13 | <xsl:param name="xmldir"/> | ||
14 | <xsl:param name="destdir"/> | ||
15 | <xsl:param name="aliasfile"/> | ||
16 | |||
17 | <xsl:variable name="aliases" select="document($aliasfile)"/> | ||
18 | |||
19 | <xsl:template match="/"> | ||
20 | <configuration> | ||
21 | <fonts> | ||
22 | <xsl:apply-templates select="/fonts"/> | ||
23 | </fonts> | ||
24 | </configuration> | ||
25 | </xsl:template> | ||
26 | |||
27 | <xsl:template match="font"> | ||
28 | <xsl:variable name="x" select="document(concat($xmldir,'/',@name,'.xml'))"/> | ||
29 | <xsl:variable name="fn" select="$x/font-metrics/font-name"/> | ||
30 | <xsl:comment>font-name: <xsl:value-of select="$fn"/></xsl:comment> | ||
31 | <font metrics-file="{$destdir}/{@name}.xml" kerning="yes" embed-file="{$ttfdir}/{@name}.ttf"> | ||
32 | <xsl:variable name="n"><!-- font name --> | ||
33 | <xsl:choose> | ||
34 | <xsl:when test="contains($fn,',')"> | ||
35 | <xsl:value-of select="substring-before($fn,',')"/> | ||
36 | </xsl:when> | ||
37 | <xsl:when test="$fn"> | ||
38 | <xsl:value-of select="$fn"/> | ||
39 | </xsl:when> | ||
40 | <xsl:otherwise> | ||
41 | <xsl:value-of select="@name"/> | ||
42 | </xsl:otherwise> | ||
43 | </xsl:choose> | ||
44 | </xsl:variable> | ||
45 | <xsl:variable name="a"><!-- attributes --> | ||
46 | <xsl:if test="contains($fn,',')"> | ||
47 | <xsl:value-of select="substring-after($fn,',')"/> | ||
48 | </xsl:if> | ||
49 | </xsl:variable> | ||
50 | <xsl:variable name="style"> | ||
51 | <xsl:choose> | ||
52 | <xsl:when test="contains($a,'Italic')">italic</xsl:when> | ||
53 | <xsl:otherwise>normal</xsl:otherwise> | ||
54 | </xsl:choose> | ||
55 | </xsl:variable> | ||
56 | <xsl:variable name="weight"> | ||
57 | <xsl:choose> | ||
58 | <xsl:when test="contains($a,'Bold')">bold</xsl:when> | ||
59 | <xsl:otherwise>normal</xsl:otherwise> | ||
60 | </xsl:choose> | ||
61 | </xsl:variable> | ||
62 | <xsl:variable name="nn" select="@name"/> | ||
63 | <xsl:for-each select="$aliases/fonts/font[@name=$n or @name=$nn]/alias[text()!=$n and text()!=$nn]"> | ||
64 | <font-triplet name="{./text()}" style="{$style}" weight="{$weight}"/> | ||
65 | </xsl:for-each> | ||
66 | <font-triplet name="{$n}" style="{$style}" weight="{$weight}"/> | ||
67 | <font-triplet name="{@name}" style="normal" weight="normal"/> | ||
68 | </font> | ||
69 | </xsl:template> | ||
70 | |||
71 | </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 @@ | |||
1 | # Copyright 1999-2007 Gentoo Foundation | ||
2 | # Distributed under the terms of the GNU General Public License v2 | ||
3 | # $Header: $ | ||
4 | |||
5 | inherit eutils | ||
6 | |||
7 | DESCRIPTION="Extra fonts metrics for fop" | ||
8 | HOMEPAGE="http://hacker.klever.net/" | ||
9 | LICENSE="MIT" | ||
10 | SLOT="0" | ||
11 | KEYWORDS="~amd64 ~x86" | ||
12 | IUSE="" | ||
13 | |||
14 | RDEPEND=" | ||
15 | media-fonts/corefonts | ||
16 | >=dev-java/fop-0.20.5-r7" | ||
17 | DEPEND="${RDEPEND} | ||
18 | dev-libs/libxslt" | ||
19 | |||
20 | src_compile() { | ||
21 | mkdir ${S} | ||
22 | cd ${S} | ||
23 | sed -e 's/org.apache.fop.apps.Fop/org.apache.fop.fonts.apps.TTFReader/' \ | ||
24 | </usr/bin/fop >fop-ttfreader | ||
25 | mkdir xml | ||
26 | exec 5>fontlist.xml | ||
27 | echo '<fonts>' >&5 | ||
28 | for f in /usr/share/fonts/corefonts/*.ttf ; do | ||
29 | fn="${f#/usr/share/fonts/corefonts/}" | ||
30 | fn="${fn%.ttf}" | ||
31 | ebegin "Creating ${fn} xml" | ||
32 | rm -f xml/${fn}.xml | ||
33 | sh fop-ttfreader -enc utf-8 ${f} xml/${fn}.xml &>/dev/null || rm xml/${fn}.xml | ||
34 | if [ -e "xml/${fn}.xml" ] ; then | ||
35 | echo ' <font name="'"${fn}"'" ttf="'"${f}"'" />' >&5 | ||
36 | eend 0 | ||
37 | else | ||
38 | eend 1 | ||
39 | fi | ||
40 | done | ||
41 | echo '</fonts>' >&5 | ||
42 | xsltproc -o userconfig.xml \ | ||
43 | --stringparam ttfdir /usr/share/fonts/corefonts \ | ||
44 | --stringparam xmldir ${S}/xml \ | ||
45 | --stringparam destdir /usr/share/fop/fonts/corefonts \ | ||
46 | --stringparam aliasfile ${FILESDIR}/aliases.xml \ | ||
47 | ${FILESDIR}/config.xsl fontlist.xml | ||
48 | } | ||
49 | |||
50 | src_install() { | ||
51 | insinto /usr/share/fop/fonts/corefonts | ||
52 | doins xml/*.xml | ||
53 | doins userconfig.xml | ||
54 | } | ||