2020-04-24 23:36:52 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
This script copies the original fonts.conf from the fontconfig
|
|
|
|
distribution, but replaces all <dir> entries with the directories
|
|
|
|
specified in the $fontDirectories parameter.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<xsl:stylesheet version="1.0"
|
|
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
xmlns:str="http://exslt.org/strings"
|
|
|
|
extension-element-prefixes="str"
|
|
|
|
>
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
<xsl:output method='xml' encoding="UTF-8" doctype-system="urn:fontconfig:fonts.dtd" />
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
<xsl:param name="fontDirectories" />
|
2024-01-25 14:12:00 +00:00
|
|
|
<xsl:param name="impureFontDirectories" />
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
<xsl:template match="/fontconfig">
|
|
|
|
|
|
|
|
<fontconfig>
|
|
|
|
<xsl:apply-templates select="child::node()[name() != 'dir' and name() != 'cachedir' and name() != 'include']" />
|
|
|
|
|
|
|
|
<!-- the first cachedir will be used to store the cache -->
|
|
|
|
<cachedir prefix="xdg">fontconfig</cachedir>
|
2024-01-25 14:12:00 +00:00
|
|
|
<xsl:text>
</xsl:text>
|
2020-04-24 23:36:52 +00:00
|
|
|
<!-- /var/cache/fontconfig is useful for non-nixos systems -->
|
|
|
|
<cachedir>/var/cache/fontconfig</cachedir>
|
2024-01-25 14:12:00 +00:00
|
|
|
<xsl:text>
</xsl:text>
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
<!-- system-wide config -->
|
|
|
|
<include ignore_missing="yes">/etc/fonts/conf.d</include>
|
2024-01-25 14:12:00 +00:00
|
|
|
<xsl:text>
</xsl:text>
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
<dir prefix="xdg">fonts</dir>
|
2024-01-25 14:12:00 +00:00
|
|
|
<xsl:text>
</xsl:text>
|
2020-04-24 23:36:52 +00:00
|
|
|
<xsl:for-each select="str:tokenize($fontDirectories)">
|
|
|
|
<dir><xsl:value-of select="." /></dir>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:for-each>
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
<xsl:for-each select="str:tokenize($impureFontDirectories)">
|
|
|
|
<dir><xsl:value-of select="." /></dir>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:for-each>
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
</fontconfig>
|
|
|
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- New fontconfig >=2.11 doesn't like xml:space added by xsl:copy-of -->
|
|
|
|
<xsl:template match="node()|@*">
|
|
|
|
<xsl:copy>
|
|
|
|
<xsl:apply-templates select="node()|@*[name() != 'xml:space']"/>
|
|
|
|
</xsl:copy>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|