auto-import dejavu-fonts-2.7.0-0.9.fc6 on branch devel from dejavu-fonts-2.7.0-0.9.fc6.src.rpm

more blocking code
This commit is contained in:
nim 2006-06-11 11:18:55 +00:00
parent 7be0f7bef5
commit c2efd8466d
3 changed files with 158 additions and 12 deletions

84
dejavu-fonts-block.xsl Normal file
View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Block DejaVu use with Arabic and Persian
© 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net>
This file is distributed under the terms of the GNU General
Public License (GPL) version 2. Copies of the GPL can be obtained from:
http://www.gnu.org/licenses/gpl.html
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:output method="xml" indent="yes" encoding="UTF-8" doctype-system="fonts.dtd"/>
<!-- Preserve most nodes -->
<xsl:template match="*" priority="0">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*|text()|comment()"/>
</xsl:copy>
</xsl:template>
<!-- Preserve attributes and comments -->
<xsl:template match="@*|comment()">
<xsl:copy/>
</xsl:template>
<!-- Add Arabic and Persian overrides for default aliases -->
<xsl:template match="fontconfig/dir[position()=last()]" priority ="1">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*|text()|comment()"/>
</xsl:copy>
<match>
<xsl:comment>Added by dejavu-fonts-block</xsl:comment>
<xsl:comment>Use KacstQura as default sans-serif when lang is Arabic</xsl:comment>
<test name="family"><string>sans-serif</string></test>
<test name="lang"><string>ar</string></test>
<edit name="family" mode="assign" binding="same">
<string>KacstQura</string>
</edit>
</match>
<match>
<xsl:comment>Added by dejavu-fonts-block</xsl:comment>
<xsl:comment>Use KacstQura as default serif when lang is Arabic</xsl:comment>
<test name="family"><string>serif</string></test>
<test name="lang"><string>ar</string></test>
<edit name="family" mode="assign" binding="same">
<string>KacstQura</string>
</edit>
</match>
<match>
<xsl:comment>Added by dejavu-fonts-block</xsl:comment>
<xsl:comment>Use KacstQura as default monospace when lang is Arabic</xsl:comment>
<test name="family"><string>monospace</string></test>
<test name="lang"><string>ar</string></test>
<edit name="family" mode="assign" binding="same">
<string>KacstQuraFixed</string>
</edit>
</match>
<match>
<xsl:comment>Added by dejavu-fonts-block</xsl:comment>
<xsl:comment>Use Roya as default sans-serif when lang is Farsi</xsl:comment>
<test name="family"><string>sans-serif</string></test>
<test name="lang"><string>fa</string></test>
<edit name="family" mode="assign" binding="same">
<string>Roya</string>
</edit>
</match>
<match>
<xsl:comment>Added by dejavu-fonts-block</xsl:comment>
<xsl:comment>Use Nazli as default serif when lang is Farsi</xsl:comment>
<test name="family"><string>serif</string></test>
<test name="lang"><string>fa</string></test>
<edit name="family" mode="assign" binding="same">
<string>Nazli</string>
</edit>
</match>
<match>
<xsl:comment>Added by dejavu-fonts-block</xsl:comment>
<xsl:comment>Use Terafik as default monospace when lang is Farsi</xsl:comment>
<test name="family"><string>monospace</string></test>
<test name="lang"><string>fa</string></test>
<edit name="family" mode="assign" binding="same">
<string>Terafik</string>
</edit>
</match>
</xsl:template>
</xsl:stylesheet>

25
dejavu-fonts-unblock.xsl Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Blocks DejaVu use with Arabic and Persian
© 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net>
This file is distributed under the terms of the GNU General
Public License (GPL) version 2. Copies of the GPL can be obtained from:
http://www.gnu.org/licenses/gpl.html
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:output method="xml" indent="yes" encoding="UTF-8" doctype-system="fonts.dtd"/>
<!-- Preserve most nodes -->
<xsl:template match="*" priority="0">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*|text()|comment()"/>
</xsl:copy>
</xsl:template>
<!-- Preserve attributes and comments -->
<xsl:template match="@*|comment()">
<xsl:copy/>
</xsl:template>
<!-- Remove our blocking code -->
<xsl:template match="fontconfig/match[comment()[.='Added by dejavu-fonts-block']]" priority ="1"/>
</xsl:stylesheet>

View File

@ -11,22 +11,26 @@
Name: dejavu-fonts
Version: 2.7.0
Release: 0.8%{?dist}
Release: 0.9%{?dist}
Summary: DejaVu fonts
Group: User Interface/X
License: Redistributable, with restrictions
URL: http://dejavu.sf.net/
Source: http://prdownloads.sourceforge.net/dejavu/%{archivename}-%{archiveversion}.tar.gz
Source1: %{name}-register.xsl
Source2: %{name}-vera-aliases.conf
Source3: %{name}-persian-override.conf
Source4: %{name}-arabic-override.conf
Source2: %{name}-block.xsl
Source3: %{name}-unblock.xsl
Source4: %{name}-vera-aliases.conf
Source5: %{name}-persian-override.conf
Source6: %{name}-arabic-override.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: fontforge
# The CPAN sources do not declare perl(Font::TTF)
BuildRequires: perl-Font-TTF
# Needed to compute unicode coverage
BuildRequires: %{Blocks} %{UnicodeData}
# If we add this the package will require fontconfig
# Requires: %{fontconfdir}/conf.d
BuildArch: noarch
Conflicts: fontconfig < 2.3.93
@ -55,8 +59,7 @@ experimental.
%package makedefault
Group: User Interface/X
Summary: Files needed to register DejaVu fonts in fontconfig aliases
Requires: %{name} = %{version}-%{release}
Summary: Files needed to make DejaVu the default fontconfig fonts
# Needed for fontconfig alias registration
Requires: %{_bindir}/xsltproc, /bin/mktemp, %{fontconfdir}/fonts.conf
Obsoletes: %{name}-fontconfig
@ -73,7 +76,7 @@ the aliases, and keep their current rank otherwise.
Group: User Interface/X
Summary: Files needed to block DejaVu use with some scripts
Requires: %{fontconfdir}/conf.d
Requires: %{_bindir}/xsltproc, /bin/mktemp, %{fontconfdir}/fonts.conf
%description block
The DejaVu fonts are a font family based on the Bitstream Vera Fonts release
@ -123,12 +126,14 @@ install -m 0644 generated/*.ttf %{buildroot}%{fontdir}
#xsl
install -d -m 755 %{buildroot}%{xsldir}
install -p -m 644 %{SOURCE1} %{buildroot}%{xsldir}/register.xsl
install -p -m 644 %{SOURCE2} %{buildroot}%{xsldir}/block.xsl
install -p -m 644 %{SOURCE3} %{buildroot}%{xsldir}/unblock.xsl
# Fontconfig overrides for some scripts
install -d -m 0755 %{buildroot}%{fontconfdir}/conf.d
install -m 0644 %{SOURCE2} %{buildroot}%{fontconfdir}/conf.d/20-BitstreamVera-aliases.conf
install -m 0644 %{SOURCE3} %{buildroot}%{fontconfdir}/conf.d/00-dejavu-persian-override.conf
install -m 0644 %{SOURCE4} %{buildroot}%{fontconfdir}/conf.d/00-dejavu-arabic-override.conf
install -m 0644 %{SOURCE4} %{buildroot}%{fontconfdir}/conf.d/20-BitstreamVera-aliases.conf
install -m 0644 %{SOURCE5} %{buildroot}%{fontconfdir}/conf.d/00-dejavu-persian-override.conf
install -m 0644 %{SOURCE6} %{buildroot}%{fontconfdir}/conf.d/00-dejavu-arabic-override.conf
%clean
@ -162,6 +167,7 @@ if [ "$1" = "0" ]; then
fi
fi
### Triggers yes I know I'm mad
# I hope this won't be necessary by FC6T1 time
@ -173,6 +179,24 @@ if [ -w %{fontconfdir}/fonts.conf ] ; then
/bin/cat $TMPFILE > %{fontconfdir}/fonts.conf && /bin/rm $TMPFILE
fi
# These bits do not seem achieveable right now by dumping files in
# %{fontconfdir}/conf.d
%triggerin block -- fontconfig, %{fontconfdir}/fonts.conf
if [ -w %{fontconfdir}/fonts.conf ] ; then
TMPFILE=$(/bin/mktemp -q /tmp/fonts.conf.XXXXXX) && \
%{_bindir}/xsltproc --novalid --output $TMPFILE \
%{xsldir}/block.xsl %{fontconfdir}/fonts.conf && \
/bin/cat $TMPFILE > %{fontconfdir}/fonts.conf && /bin/rm $TMPFILE
fi
%triggerun block -- fontconfig, %{fontconfdir}/fonts.conf
if [ -w %{fontconfdir}/fonts.conf ] ; then
TMPFILE=$(/bin/mktemp -q /tmp/fonts.conf.XXXXXX) && \
%{_bindir}/xsltproc --novalid --output $TMPFILE \
%{xsldir}/unblock.xsl %{fontconfdir}/fonts.conf && \
/bin/cat $TMPFILE > %{fontconfdir}/fonts.conf && /bin/rm $TMPFILE
fi
%files
%defattr(0644,root,root,0755)
@ -201,18 +225,31 @@ fi
%files block
%defattr(0644,root,root,0755)
%dir %{xsldir}
%{xsldir}/block.xsl
%{xsldir}/unblock.xsl
%exclude %{fontconfdir}/conf.d/20-BitstreamVera-aliases.conf
%{fontconfdir}/conf.d/*.conf
%changelog
* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.9
- reintroduce xslt triggers in dejavu-fonts-block as fontconfig conf.d priority
is not high enough for our needs
* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.8
- preparation to 2.7.0 based on the current dejavu snapshot
- complete and clean up the Vera aliasing
* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.7
- addition of fontconfig blocking for Arabic and Persian
(experimental but safe)
- tweak of the fontconfig aliasing to make DejaVu fonts the highest prio
instead of following Vera ranking, and rename the subpackage accordingly
- complete and clean up the Vera aliasing
* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.1
- preparation to 2.7.0 based on the current dejavu snapshot
* Mon May 15 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.6.0-1
- 2.6.0