nerdfonts: fix wrong attribute name in error message (#364463)
[NixPkgs.git] / pkgs / development / libraries / fontconfig / make-fonts-conf.xsl
blobaafa9345c87cfa441c654063d9caaddd37cee102
1 <?xml version="1.0"?>
3 <!--
4 This script copies the original fonts.conf from the fontconfig
5 distribution, but replaces all <dir> entries with the directories
6 specified in the $fontDirectories parameter.
7 -->
9 <xsl:stylesheet version="1.0"
10 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 xmlns:str="http://exslt.org/strings"
12 extension-element-prefixes="str"
15 <xsl:output method='xml' encoding="UTF-8" doctype-system="urn:fontconfig:fonts.dtd" />
17 <xsl:param name="fontDirectories" />
18 <xsl:param name="impureFontDirectories" />
19 <xsl:param name="includes" />
21 <xsl:template match="/fontconfig">
23 <fontconfig>
24 <xsl:apply-templates select="child::node()[name() != 'dir' and name() != 'cachedir' and name() != 'include']" />
26 <!-- the first cachedir will be used to store the cache -->
27 <cachedir prefix="xdg">fontconfig</cachedir>
28 <xsl:text>&#0010;</xsl:text>
29 <!-- /var/cache/fontconfig is useful for non-nixos systems -->
30 <cachedir>/var/cache/fontconfig</cachedir>
31 <xsl:text>&#0010;</xsl:text>
33 <!-- system-wide config -->
34 <xsl:for-each select="str:tokenize($includes)">
35 <include ignore_missing="yes"><xsl:value-of select="." /></include>
36 <xsl:text>&#0010;</xsl:text>
37 </xsl:for-each>
39 <dir prefix="xdg">fonts</dir>
40 <xsl:text>&#0010;</xsl:text>
41 <xsl:for-each select="str:tokenize($fontDirectories)">
42 <dir><xsl:value-of select="." /></dir>
43 <xsl:text>&#0010;</xsl:text>
44 </xsl:for-each>
46 <xsl:for-each select="str:tokenize($impureFontDirectories)">
47 <dir><xsl:value-of select="." /></dir>
48 <xsl:text>&#0010;</xsl:text>
49 </xsl:for-each>
51 </fontconfig>
53 </xsl:template>
56 <!-- New fontconfig >=2.11 doesn't like xml:space added by xsl:copy-of -->
57 <xsl:template match="node()|@*">
58 <xsl:copy>
59 <xsl:apply-templates select="node()|@*[name() != 'xml:space']"/>
60 </xsl:copy>
61 </xsl:template>
63 </xsl:stylesheet>