2008-07-03 15:27:19 +01: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-03 05:38:22 +01:00
|
|
|
<xsl:output method='xml' encoding="UTF-8" doctype-system="urn:fontconfig:fonts.dtd" />
|
2008-07-03 15:27:19 +01:00
|
|
|
|
|
|
|
<xsl:param name="fontDirectories" />
|
|
|
|
|
|
|
|
<xsl:template match="/fontconfig">
|
|
|
|
|
|
|
|
<fontconfig>
|
2014-09-28 15:46:26 +01:00
|
|
|
<xsl:apply-templates select="child::node()[name() != 'dir' and name() != 'cachedir' and name() != 'include']" />
|
2008-07-03 15:27:19 +01:00
|
|
|
|
2014-09-27 19:08:45 +01:00
|
|
|
<!-- the first cachedir will be used to store the cache -->
|
|
|
|
<cachedir prefix="xdg">fontconfig</cachedir>
|
|
|
|
<!-- /var/cache/fontconfig is useful for non-nixos systems -->
|
2014-02-04 19:02:51 +00:00
|
|
|
<cachedir>/var/cache/fontconfig</cachedir>
|
2013-06-27 12:31:35 +01:00
|
|
|
|
2020-08-13 19:04:10 +01:00
|
|
|
<!-- system-wide config -->
|
|
|
|
<include ignore_missing="yes">/etc/fonts/conf.d</include>
|
2020-05-27 03:35:25 +01:00
|
|
|
|
2014-09-27 19:08:45 +01:00
|
|
|
<dir prefix="xdg">fonts</dir>
|
2008-07-03 15:27:19 +01:00
|
|
|
<xsl:for-each select="str:tokenize($fontDirectories)">
|
|
|
|
<dir><xsl:value-of select="." /></dir>
|
|
|
|
<xsl:text>
</xsl:text>
|
|
|
|
</xsl:for-each>
|
2014-09-27 19:08:45 +01:00
|
|
|
|
|
|
|
<!-- nix user profile -->
|
|
|
|
<dir>~/.nix-profile/lib/X11/fonts</dir>
|
|
|
|
<dir>~/.nix-profile/share/fonts</dir>
|
2020-06-15 13:12:47 +01:00
|
|
|
|
|
|
|
<!-- FHS paths for non-NixOS platforms -->
|
|
|
|
<dir>/usr/share/fonts</dir>
|
|
|
|
<dir>/usr/local/share/fonts</dir>
|
|
|
|
|
2014-09-27 19:08:45 +01:00
|
|
|
<!-- nix default profile -->
|
|
|
|
<dir>/nix/var/nix/profiles/default/lib/X11/fonts</dir>
|
|
|
|
<dir>/nix/var/nix/profiles/default/share/fonts</dir>
|
2013-06-27 12:31:35 +01:00
|
|
|
|
2008-07-03 15:27:19 +01:00
|
|
|
</fontconfig>
|
|
|
|
|
|
|
|
</xsl:template>
|
2013-06-27 12:31:35 +01:00
|
|
|
|
2014-09-28 15:46:26 +01:00
|
|
|
|
|
|
|
<!-- 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>
|
|
|
|
|
2008-07-03 15:27:19 +01:00
|
|
|
</xsl:stylesheet>
|