From dc6e46f15c5730057d38072afa5fd731c7131a91 Mon Sep 17 00:00:00 2001 From: Archlinux-Jerry Build Bot Date: Tue, 4 Feb 2020 15:04:35 +0800 Subject: [PATCH] add package: ttf-dejavu-emojiless --- ttf-dejavu-emojiless/PKGBUILD | 51 +++++++++ ttf-dejavu-emojiless/autobuild.yaml | 4 + ttf-dejavu-emojiless/cleaner.py | 10 ++ ...generic-name-assignment-and-aliasing.patch | 102 ++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 ttf-dejavu-emojiless/PKGBUILD create mode 100644 ttf-dejavu-emojiless/autobuild.yaml create mode 100755 ttf-dejavu-emojiless/cleaner.py create mode 100644 ttf-dejavu-emojiless/remove-generic-name-assignment-and-aliasing.patch diff --git a/ttf-dejavu-emojiless/PKGBUILD b/ttf-dejavu-emojiless/PKGBUILD new file mode 100644 index 0000000..74cd696 --- /dev/null +++ b/ttf-dejavu-emojiless/PKGBUILD @@ -0,0 +1,51 @@ +# $Id$ +# Maintainer: +# Contributor: 😂👌 + +pkgname=ttf-dejavu-emojiless +pkgver=2.37 +pkgrel=2 +pkgdesc="Derivate of DejaVu without characters listed as emoji, in order not to override color fonts" +arch=('any') +url="https://dejavu-fonts.github.io/" +license=('custom') +depends=('fontconfig' 'xorg-fonts-encodings' 'xorg-mkfontscale' 'xorg-mkfontdir') +makedepends=('fontforge') +provides=('ttf-font' 'ttf-dejavu') +conflicts=('ttf-dejavu') +source=(https://downloads.sourceforge.net/project/dejavu/dejavu/${pkgver}/dejavu-fonts-ttf-${pkgver}.tar.bz2 + remove-generic-name-assignment-and-aliasing.patch + https://github.com/iamcal/emoji-data/raw/master/emoji.json + cleaner.py) +sha256sums=('fa9ca4d13871dd122f61258a80d01751d603b4d3ee14095d65453b4e846e17d7' + '21d85a4f6ea7856074a4eb5c5fce6a10e764d11ff4336e92c4f009815efebb0c' + 'SKIP' + '415ba5000c5dbaf15b56d91d137a60ee257b5ef31c17cb2fd54ed015220b1f8c') + +prepare() { + cd dejavu-fonts-ttf-$pkgver + patch -Np1 -i ../remove-generic-name-assignment-and-aliasing.patch + cd "${srcdir}" + ttfdir="${srcdir}"/dejavu-fonts-ttf-${pkgver}/ttf + for ttf in "${ttfdir}"/*.ttf; do + fontforge -script cleaner.py $ttf + done +} + +package() { + install -dm755 "${pkgdir}"/etc/fonts/conf.avail + install -dm755 "${pkgdir}"/etc/fonts/conf.d + install -dm755 "${pkgdir}"/usr/share/fonts/TTF + + cd "${srcdir}"/dejavu-fonts-ttf-${pkgver} + install -m644 ttf/*.ttf "${pkgdir}"/usr/share/fonts/TTF/ + install -m644 fontconfig/*.conf "${pkgdir}"/etc/fonts/conf.avail/ + + pushd "${pkgdir}"/etc/fonts/conf.avail + for config in *; do + ln -sf ../conf.avail/${config} ../conf.d/${config} + done + popd + + install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE +} diff --git a/ttf-dejavu-emojiless/autobuild.yaml b/ttf-dejavu-emojiless/autobuild.yaml new file mode 100644 index 0000000..f9e1b29 --- /dev/null +++ b/ttf-dejavu-emojiless/autobuild.yaml @@ -0,0 +1,4 @@ +type: + auto +priority: + 10 diff --git a/ttf-dejavu-emojiless/cleaner.py b/ttf-dejavu-emojiless/cleaner.py new file mode 100755 index 0000000..bf75d92 --- /dev/null +++ b/ttf-dejavu-emojiless/cleaner.py @@ -0,0 +1,10 @@ +from json import load +from sys import argv + +ttf = fontforge.open(argv[1]) +for emoji in load(open('emoji.json')): + try: + ttf.removeGlyph(int(emoji['unified'], 16)) + except ValueError: + pass +ttf.generate(argv[1]) diff --git a/ttf-dejavu-emojiless/remove-generic-name-assignment-and-aliasing.patch b/ttf-dejavu-emojiless/remove-generic-name-assignment-and-aliasing.patch new file mode 100644 index 0000000..155afd2 --- /dev/null +++ b/ttf-dejavu-emojiless/remove-generic-name-assignment-and-aliasing.patch @@ -0,0 +1,102 @@ +From d9ee532b4f0a879372bdb006ac85d7807629ea98 Mon Sep 17 00:00:00 2001 +From: Fabian Greffrath +Date: Mon, 15 May 2017 21:08:12 +0200 +Subject: [PATCH] fontconfig: remove generic name assignment and aliasing + +This removes the generic name assignment and the generic name aliasing +rules for the three standard DejaVu Sans, Sans-Mono and Serif fonts. + +These rules are redundant as they are already in the fontconfig +upstream config files 45-latin.conf and 60-latin.conf, respectively, +for at least 10 years now, c.f.: + +https://cgit.freedesktop.org/fontconfig/commit/conf.d/45-latin.conf?id=4b51f173c99152586db26b03752873a4b4020672 +https://cgit.freedesktop.org/fontconfig/commit/conf.d/60-latin.conf?id=6c5619a08575943f75d2341e1a4931ec5faf716b + +We have a bug report in Debian from a user who complains that he +changed the preference for the default sans-serif font in the expected +rule, i.e. 60-latin.conf, and was confused when his change was +overridden by fonts-dejavu's own rule in 57-dejavu-sans.conf: + +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753401 + +The reporter confirms that removing the offending lines from the +config files in the fonts-dejavu package causes the intended changes +applied to the 60-latin.conf file to take effect. + +Thanks for considering! +--- + fontconfig/57-dejavu-sans-mono.conf | 14 -------------- + fontconfig/57-dejavu-sans.conf | 14 -------------- + fontconfig/57-dejavu-serif.conf | 14 -------------- + 3 files changed, 42 deletions(-) + +diff --git a/fontconfig/57-dejavu-sans-mono.conf b/fontconfig/57-dejavu-sans-mono.conf +index cc42561e..2c75b5cf 100644 +--- a/fontconfig/57-dejavu-sans-mono.conf ++++ b/fontconfig/57-dejavu-sans-mono.conf +@@ -45,18 +45,4 @@ + DejaVu Sans Mono + + +- +- +- DejaVu Sans Mono +- +- monospace +- +- +- +- +- monospace +- +- DejaVu Sans Mono +- +- + +diff --git a/fontconfig/57-dejavu-sans.conf b/fontconfig/57-dejavu-sans.conf +index 565cab5f..cff7a842 100644 +--- a/fontconfig/57-dejavu-sans.conf ++++ b/fontconfig/57-dejavu-sans.conf +@@ -70,18 +70,4 @@ + DejaVu Sans + + +- +- +- DejaVu Sans +- +- sans-serif +- +- +- +- +- sans-serif +- +- DejaVu Sans +- +- + +diff --git a/fontconfig/57-dejavu-serif.conf b/fontconfig/57-dejavu-serif.conf +index a922e9b2..10ae70fd 100644 +--- a/fontconfig/57-dejavu-serif.conf ++++ b/fontconfig/57-dejavu-serif.conf +@@ -52,18 +52,4 @@ + DejaVu Serif + + +- +- +- DejaVu Serif +- +- serif +- +- +- +- +- serif +- +- DejaVu Serif +- +- +