summaryrefslogtreecommitdiff
path: root/app-text/fop-corefonts-metrics/files
Unidiff
Diffstat (limited to 'app-text/fop-corefonts-metrics/files') (more/less context) (ignore whitespace changes)
-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
3 files changed, 126 insertions, 0 deletions
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