* Graphviz updated to 2.20.2. Now built with fontconfig, gd and pango
support. * New function makeFontsConf to generate a fontconfig configuration file. Moved from NixOS. * dot2pdf: use makeFontsConf to generate a fonts.conf containing just the Ghostscript fonts (see NIXPKGS-29). * dot2pdf: generate PDF directly, don't go through PS. Note that this and using fontconfig changes the interpretation of "fontname" attributes in dot graphs. svn path=/nixpkgs/trunk/; revision=12251
This commit is contained in:
13
pkgs/development/libraries/fontconfig/make-fonts-conf.nix
Normal file
13
pkgs/development/libraries/fontconfig/make-fonts-conf.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{runCommand, libxslt, fontconfig, fontDirectories}:
|
||||
|
||||
runCommand "fonts.conf"
|
||||
{
|
||||
buildInputs = [libxslt];
|
||||
inherit fontDirectories;
|
||||
}
|
||||
''
|
||||
xsltproc --stringparam fontDirectories "$fontDirectories" \
|
||||
--stringparam fontconfig "${fontconfig}" \
|
||||
${./make-fonts-conf.xsl} ${fontconfig}/etc/fonts/fonts.conf \
|
||||
> $out
|
||||
''
|
||||
40
pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
Normal file
40
pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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"
|
||||
>
|
||||
|
||||
<xsl:output method='xml' encoding="UTF-8" doctype-system="fonts.dtd" />
|
||||
|
||||
<xsl:param name="fontDirectories" />
|
||||
<xsl:param name="fontconfig" />
|
||||
|
||||
<xsl:template match="/fontconfig">
|
||||
|
||||
<fontconfig>
|
||||
<xsl:copy-of select="child::node()[name() != 'dir' and name() != 'cachedir' and name() != 'include']" />
|
||||
|
||||
<include xml:space="preserve"><xsl:value-of select="$fontconfig" />/etc/fonts/conf.d</include>
|
||||
<include ignore_missing="yes" xml:space="preserve">/etc/fonts/conf.d</include>
|
||||
|
||||
<cachedir xml:space="preserve">/var/cache/fontconfig</cachedir>
|
||||
<cachedir xml:space="preserve">~/.fontconfig</cachedir>
|
||||
|
||||
<xsl:for-each select="str:tokenize($fontDirectories)">
|
||||
<dir><xsl:value-of select="." /></dir>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:for-each>
|
||||
|
||||
</fontconfig>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user