* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
@ 2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
` (18 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-30 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463325715
Comment:
Freetype itself says [emphasis added]
> Note that this feature is covered by several Microsoft patents and **should not be activated in any default build of the library**.
A build option is okay, but this should not be on by default.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
2020-07-30 23:34 ` [PR REVIEW] " ahesford
@ 2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
` (17 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-30 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 211 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463323873
Comment:
This shouldn't be in `pre_build`, it should be in `post_patch`.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
2020-07-30 23:34 ` [PR REVIEW] " ahesford
2020-07-30 23:34 ` ahesford
@ 2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
` (16 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-30 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463325236
Comment:
Drop `${wrksrc}/`, you're already in that directory in `post_patch`.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (2 preceding siblings ...)
2020-07-30 23:34 ` ahesford
@ 2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
` (15 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-30 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 206 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463325888
Comment:
Change to "Enable subpixel rendering similar to ClearType"
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (3 preceding siblings ...)
2020-07-30 23:34 ` ahesford
@ 2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
` (14 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-30 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 188 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463326096
Comment:
`if [ "$build_option_cleartype" ]; then`
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (4 preceding siblings ...)
2020-07-30 23:34 ` ahesford
@ 2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
` (13 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-30 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 756 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463327520
Comment:
This is not the right way to handle this configuration snippet. In fact, fontconfig improperly installs several snippets in `/etc/fonts/conf.d`. The point of `/etc/fonts/conf.d` is to allow site-specific customization of fontconfig, but symlinks managed by the package will be recreated if the user deletes them and reinstalls or updates the package. Also, if the user removes the managed links, `xbps-pkgdb` will complain about broken symlinks when checking package integrity.
The right way to manage these symlinks is create an `INSTALL` script, run only for the initial installation and not an upgrade.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (5 preceding siblings ...)
2020-07-30 23:34 ` ahesford
@ 2020-07-30 23:34 ` ahesford
2020-07-31 0:05 ` ericonr
` (12 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-30 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 193 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463326488
Comment:
This file is already installed by fontconfig.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (6 preceding siblings ...)
2020-07-30 23:34 ` ahesford
@ 2020-07-31 0:05 ` ericonr
2020-07-31 0:06 ` ericonr
` (11 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ericonr @ 2020-07-31 0:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
New review comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463336709
Comment:
See #13296, it became available due to MS joining OIN.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (7 preceding siblings ...)
2020-07-31 0:05 ` ericonr
@ 2020-07-31 0:06 ` ericonr
2020-07-31 0:15 ` ahesford
` (10 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ericonr @ 2020-07-31 0:06 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
New review comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463336709
Comment:
See #13296, it became available due to MS joining OSI.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR REVIEW] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (8 preceding siblings ...)
2020-07-31 0:06 ` ericonr
@ 2020-07-31 0:15 ` ahesford
2020-07-31 8:17 ` [PR PATCH] [Updated] " andry-dev
` (9 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: ahesford @ 2020-07-31 0:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#discussion_r463339211
Comment:
Thanks for the clarification. I didn't look at the contents of the removed patch to see that we're already enabling this option. In that case, no harm in making it a default option.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR PATCH] [Updated] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (9 preceding siblings ...)
2020-07-31 0:15 ` ahesford
@ 2020-07-31 8:17 ` andry-dev
2021-03-23 15:57 ` prez
` (8 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: andry-dev @ 2020-07-31 8:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
There is an updated pull request by andry-dev against master on the void-packages repository
https://github.com/andry-dev/void-packages fontconfig
https://github.com/void-linux/void-packages/pull/23962
fontconfig: fix subpixel rendering in GTK applications
This PR hopefully closes #21429.
The first commit converts the freetype's ClearType patch to a build option; while it is not necessary for the fix, @ericonr suggested it and it seems helpful.
The second commit provides a `fontconfig` configuration file that sets `lcdfilter` to `lcddefault`, fixing the issue.
The config file provides a system-wide default without enforcing it, so the user/desktop environment can override the option in `~/.config/fontconfig/fonts.conf`. This doesn't break existing users: if they set the option anywhere then that is respected, if they didn't then subpixel rendering will work as intended.
Setting `lcdfilter` to `lcdlight` in `fonts.conf` is equivalent to the default "Harmony" engine, so it's the same as not having the patch in the first place.
## Why is this needed anyway?
A year ago I opened #13296, which enables ClearType in `freetype`. When testing it I had `lcdfilter` already set to `lcddefault` in my own `fonts.conf` and I didn't think about setting the option by default system-wide, so I never noticed any regression. Sorry for that.
I wrote the patch because without it I couldn't read text effortlessly, the font wasn't "right" for me. Major distros (Ubuntu, Debian and Fedora from the top of my head) have it enabled by default because, _generally speaking_, font rendering feels better with it.
A patch file from https://github.com/void-linux/void-packages/pull/23962.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fontconfig-23962.patch --]
[-- Type: text/x-diff, Size: 3432 bytes --]
From 297a04f3dc33e655832a15dae6adf4000c64707d Mon Sep 17 00:00:00 2001
From: andry-dev <peketribal2@gmail.com>
Date: Thu, 30 Jul 2020 22:24:53 +0000
Subject: [PATCH 1/2] freetype: move ClearType patch to a build option
---
.../freetype/patches/enable-subpixel-rendering.patch | 11 -----------
srcpkgs/freetype/template | 11 ++++++++++-
2 files changed, 10 insertions(+), 12 deletions(-)
delete mode 100644 srcpkgs/freetype/patches/enable-subpixel-rendering.patch
diff --git a/srcpkgs/freetype/patches/enable-subpixel-rendering.patch b/srcpkgs/freetype/patches/enable-subpixel-rendering.patch
deleted file mode 100644
index 5cba955ca2c..00000000000
--- a/srcpkgs/freetype/patches/enable-subpixel-rendering.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/freetype/config/ftoption.h
-+++ include/freetype/config/ftoption.h
-@@ -126,7 +126,7 @@
- * macro is not defined, FreeType offers alternative LCD rendering
- * technology that produces excellent output without LCD filtering.
- */
--/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /**************************************************************************
diff --git a/srcpkgs/freetype/template b/srcpkgs/freetype/template
index f279908c442..d3f072ff201 100644
--- a/srcpkgs/freetype/template
+++ b/srcpkgs/freetype/template
@@ -1,7 +1,7 @@
# Template file for 'freetype'
pkgname=freetype
version=2.10.2
-revision=1
+revision=2
build_style=gnu-configure
configure_args="--enable-freetype-config"
hostmakedepends="pkg-config"
@@ -12,6 +12,15 @@ license="GPL-2.0-or-later, FTL"
homepage="https://www.freetype.org/"
distfiles="${NONGNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=1543d61025d2e6312e0a1c563652555f17378a204a61e99928c9fcef030a2d8b
+build_options="cleartype"
+desc_option_cleartype="Enable subpixel rendering similar to ClearType"
+build_options_default="cleartype"
+
+post_patch() {
+ if [ "$build_option_cleartype" ]; then
+ vsed -i include/freetype/config/ftoption.h -e 's@/\* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING \*/@#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING@'
+ fi
+}
post_install() {
vlicense docs/LICENSE.TXT docs/FTL.TXT
From 3e6a8e802de53b8bbd320ce3384dc4a88eab0e06 Mon Sep 17 00:00:00 2001
From: andry-dev <peketribal2@gmail.com>
Date: Thu, 30 Jul 2020 22:30:33 +0000
Subject: [PATCH 2/2] fontconfig: set lcdfilter by default
---
srcpkgs/fontconfig/INSTALL | 4 ++++
srcpkgs/fontconfig/template | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/srcpkgs/fontconfig/INSTALL b/srcpkgs/fontconfig/INSTALL
index 1daa9b2a8f5..bf97a39b732 100644
--- a/srcpkgs/fontconfig/INSTALL
+++ b/srcpkgs/fontconfig/INSTALL
@@ -5,6 +5,10 @@ case "${ACTION}" in
pre)
;;
post)
+ if [ "$UPDATE" = "no" ]; then
+ ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/
+ fi
+
echo "Building fonts cache... "
fc-cache -f >/dev/null
echo "done."
diff --git a/srcpkgs/fontconfig/template b/srcpkgs/fontconfig/template
index 18504e4503f..fca09c2c0ba 100644
--- a/srcpkgs/fontconfig/template
+++ b/srcpkgs/fontconfig/template
@@ -1,7 +1,7 @@
# Template file for 'fontconfig'
pkgname=fontconfig
version=2.13.1
-revision=2
+revision=3
build_style=gnu-configure
configure_args="--enable-static --enable-docs --with-cache-dir=/var/cache/${pkgname}"
hostmakedepends="gperf pkg-config"
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (10 preceding siblings ...)
2020-07-31 8:17 ` [PR PATCH] [Updated] " andry-dev
@ 2021-03-23 15:57 ` prez
2021-03-23 21:46 ` [PR PATCH] [Updated] " andry-dev
` (7 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: prez @ 2021-03-23 15:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
New comment by prez on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#issuecomment-805021630
Comment:
bump
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR PATCH] [Updated] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (11 preceding siblings ...)
2021-03-23 15:57 ` prez
@ 2021-03-23 21:46 ` andry-dev
2021-03-23 21:49 ` andry-dev
` (6 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: andry-dev @ 2021-03-23 21:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
There is an updated pull request by andry-dev against master on the void-packages repository
https://github.com/andry-dev/void-packages fontconfig
https://github.com/void-linux/void-packages/pull/23962
fontconfig: fix subpixel rendering in GTK applications
This PR hopefully closes #21429.
The first commit converts the freetype's ClearType patch to a build option; while it is not necessary for the fix, @ericonr suggested it and it seems helpful.
The second commit provides a `fontconfig` configuration file that sets `lcdfilter` to `lcddefault`, fixing the issue.
The config file provides a system-wide default without enforcing it, so the user/desktop environment can override the option in `~/.config/fontconfig/fonts.conf`. This doesn't break existing users: if they set the option anywhere then that is respected, if they didn't then subpixel rendering will work as intended.
Setting `lcdfilter` to `lcdlight` in `fonts.conf` is equivalent to the default "Harmony" engine, so it's the same as not having the patch in the first place.
## Why is this needed anyway?
A year ago I opened #13296, which enables ClearType in `freetype`. When testing it I had `lcdfilter` already set to `lcddefault` in my own `fonts.conf` and I didn't think about setting the option by default system-wide, so I never noticed any regression. Sorry for that.
I wrote the patch because without it I couldn't read text effortlessly, the font wasn't "right" for me. Major distros (Ubuntu, Debian and Fedora from the top of my head) have it enabled by default because, _generally speaking_, font rendering feels better with it.
A patch file from https://github.com/void-linux/void-packages/pull/23962.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fontconfig-23962.patch --]
[-- Type: text/x-diff, Size: 4336 bytes --]
From 15cbe4e55605ac2c63eb522bc96aa39f21ddf8b2 Mon Sep 17 00:00:00 2001
From: ibrokemypie <ibrokemypie@bastardi.net>
Date: Mon, 22 Feb 2021 23:45:17 +1100
Subject: [PATCH 1/3] New package: droidcam-1.7.2.
Closes: #28972 [via git-merge-pr]
---
srcpkgs/droidcam/template | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 srcpkgs/droidcam/template
diff --git a/srcpkgs/droidcam/template b/srcpkgs/droidcam/template
new file mode 100644
index 000000000000..665811688867
--- /dev/null
+++ b/srcpkgs/droidcam/template
@@ -0,0 +1,28 @@
+# Template file for 'droidcam'
+pkgname=droidcam
+version=1.7.2
+revision=1
+build_style=gnu-makefile
+make_build_args="USBMUXD=-lusbmuxd-2.0 JPEG=-lturbojpeg"
+hostmakedepends="pkg-config"
+makedepends="pkg-config libjpeg-turbo-devel ffmpeg-devel alsa-lib-devel
+ speex-devel libusbmuxd-devel libplist-devel gtk+3-devel"
+depends="v4l2loopback"
+short_desc="Tool for using your android device as a wireless/usb webcam"
+maintainer="ibrokemypie <ibrokemypie@bastardi.net>"
+license="GPL-2.0-or-later"
+homepage="https://www.dev47apps.com/"
+distfiles="https://github.com/dev47apps/droidcam/archive/v${version}.tar.gz"
+checksum=ea93a56f5e2291ea8546d047bb89c54f4b3ded3786d176a79148a62aaa0765e3
+
+post_patch() {
+ vsed -e "s/^Icon=.*/Icon=droidcam-icon.png/" -i droidcam.desktop
+}
+
+do_install() {
+ vbin droidcam
+ vbin droidcam-cli
+ vinstall icon2.png 644 usr/share/pixmaps droidcam-icon.png
+ vinstall droidcam.desktop 644 usr/share/applications
+ vdoc README.md
+}
From 2aacca0aff91e7daeed3720f9c6ce635710768d3 Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Tue, 23 Mar 2021 22:45:50 +0100
Subject: [PATCH 2/3] freetype: move ClearType patch to a build option
---
.../freetype/patches/enable-subpixel-rendering.patch | 11 -----------
srcpkgs/freetype/template | 6 ++++++
2 files changed, 6 insertions(+), 11 deletions(-)
delete mode 100644 srcpkgs/freetype/patches/enable-subpixel-rendering.patch
diff --git a/srcpkgs/freetype/patches/enable-subpixel-rendering.patch b/srcpkgs/freetype/patches/enable-subpixel-rendering.patch
deleted file mode 100644
index 5cba955ca2cf..000000000000
--- a/srcpkgs/freetype/patches/enable-subpixel-rendering.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/freetype/config/ftoption.h
-+++ include/freetype/config/ftoption.h
-@@ -126,7 +126,7 @@
- * macro is not defined, FreeType offers alternative LCD rendering
- * technology that produces excellent output without LCD filtering.
- */
--/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /**************************************************************************
diff --git a/srcpkgs/freetype/template b/srcpkgs/freetype/template
index ba4c6ad900c4..f327fcab8466 100644
--- a/srcpkgs/freetype/template
+++ b/srcpkgs/freetype/template
@@ -12,9 +12,15 @@ license="GPL-2.0-or-later, FTL"
homepage="https://www.freetype.org/"
distfiles="${NONGNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784
+build_options="cleartype"
+desc_option_cleartype="Enable subpixel rendering similar to ClearType"
+build_options_default="cleartype"
post_patch() {
vsed -i -e "s/%PKG_CONFIG%/pkg-config/" builds/unix/freetype-config.in
+ if [ "$build_option_cleartype" ]; then
+ vsed -i include/freetype/config/ftoption.h -e 's@/\* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING \*/@#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING@'
+ fi
}
post_install() {
From 1cbeb2edce3eda97812ee5696a09c8f018cecc2e Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Tue, 23 Mar 2021 22:42:51 +0100
Subject: [PATCH 3/3] fontconfig: set lcdfilter by default
---
srcpkgs/fontconfig/INSTALL | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/srcpkgs/fontconfig/INSTALL b/srcpkgs/fontconfig/INSTALL
index 1daa9b2a8f57..bf97a39b732a 100644
--- a/srcpkgs/fontconfig/INSTALL
+++ b/srcpkgs/fontconfig/INSTALL
@@ -5,6 +5,10 @@ case "${ACTION}" in
pre)
;;
post)
+ if [ "$UPDATE" = "no" ]; then
+ ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/
+ fi
+
echo "Building fonts cache... "
fc-cache -f >/dev/null
echo "done."
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR PATCH] [Updated] fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (12 preceding siblings ...)
2021-03-23 21:46 ` [PR PATCH] [Updated] " andry-dev
@ 2021-03-23 21:49 ` andry-dev
2022-04-18 2:11 ` github-actions
` (5 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: andry-dev @ 2021-03-23 21:49 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
There is an updated pull request by andry-dev against master on the void-packages repository
https://github.com/andry-dev/void-packages fontconfig
https://github.com/void-linux/void-packages/pull/23962
fontconfig: fix subpixel rendering in GTK applications
This PR hopefully closes #21429.
The first commit converts the freetype's ClearType patch to a build option; while it is not necessary for the fix, @ericonr suggested it and it seems helpful.
The second commit provides a `fontconfig` configuration file that sets `lcdfilter` to `lcddefault`, fixing the issue.
The config file provides a system-wide default without enforcing it, so the user/desktop environment can override the option in `~/.config/fontconfig/fonts.conf`. This doesn't break existing users: if they set the option anywhere then that is respected, if they didn't then subpixel rendering will work as intended.
Setting `lcdfilter` to `lcdlight` in `fonts.conf` is equivalent to the default "Harmony" engine, so it's the same as not having the patch in the first place.
## Why is this needed anyway?
A year ago I opened #13296, which enables ClearType in `freetype`. When testing it I had `lcdfilter` already set to `lcddefault` in my own `fonts.conf` and I didn't think about setting the option by default system-wide, so I never noticed any regression. Sorry for that.
I wrote the patch because without it I couldn't read text effortlessly, the font wasn't "right" for me. Major distros (Ubuntu, Debian and Fedora from the top of my head) have it enabled by default because, _generally speaking_, font rendering feels better with it.
A patch file from https://github.com/void-linux/void-packages/pull/23962.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fontconfig-23962.patch --]
[-- Type: text/x-diff, Size: 2794 bytes --]
From 9d49c635fed3533d54fcd31742fa86db16db8a42 Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Tue, 23 Mar 2021 22:45:50 +0100
Subject: [PATCH 1/2] freetype: move ClearType patch to a build option
---
.../freetype/patches/enable-subpixel-rendering.patch | 11 -----------
srcpkgs/freetype/template | 6 ++++++
2 files changed, 6 insertions(+), 11 deletions(-)
delete mode 100644 srcpkgs/freetype/patches/enable-subpixel-rendering.patch
diff --git a/srcpkgs/freetype/patches/enable-subpixel-rendering.patch b/srcpkgs/freetype/patches/enable-subpixel-rendering.patch
deleted file mode 100644
index 5cba955ca2cf..000000000000
--- a/srcpkgs/freetype/patches/enable-subpixel-rendering.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/freetype/config/ftoption.h
-+++ include/freetype/config/ftoption.h
-@@ -126,7 +126,7 @@
- * macro is not defined, FreeType offers alternative LCD rendering
- * technology that produces excellent output without LCD filtering.
- */
--/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /**************************************************************************
diff --git a/srcpkgs/freetype/template b/srcpkgs/freetype/template
index ba4c6ad900c4..f327fcab8466 100644
--- a/srcpkgs/freetype/template
+++ b/srcpkgs/freetype/template
@@ -12,9 +12,15 @@ license="GPL-2.0-or-later, FTL"
homepage="https://www.freetype.org/"
distfiles="${NONGNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784
+build_options="cleartype"
+desc_option_cleartype="Enable subpixel rendering similar to ClearType"
+build_options_default="cleartype"
post_patch() {
vsed -i -e "s/%PKG_CONFIG%/pkg-config/" builds/unix/freetype-config.in
+ if [ "$build_option_cleartype" ]; then
+ vsed -i include/freetype/config/ftoption.h -e 's@/\* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING \*/@#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING@'
+ fi
}
post_install() {
From 4df21cf586c5742c194f5a588e8e3677b75899d6 Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Tue, 23 Mar 2021 22:42:51 +0100
Subject: [PATCH 2/2] fontconfig: set lcdfilter by default
---
srcpkgs/fontconfig/INSTALL | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/srcpkgs/fontconfig/INSTALL b/srcpkgs/fontconfig/INSTALL
index 1daa9b2a8f57..bf97a39b732a 100644
--- a/srcpkgs/fontconfig/INSTALL
+++ b/srcpkgs/fontconfig/INSTALL
@@ -5,6 +5,10 @@ case "${ACTION}" in
pre)
;;
post)
+ if [ "$UPDATE" = "no" ]; then
+ ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/
+ fi
+
echo "Building fonts cache... "
fc-cache -f >/dev/null
echo "done."
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (13 preceding siblings ...)
2021-03-23 21:49 ` andry-dev
@ 2022-04-18 2:11 ` github-actions
2022-07-18 2:13 ` github-actions
` (4 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: github-actions @ 2022-04-18 2:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#issuecomment-1101026290
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (14 preceding siblings ...)
2022-04-18 2:11 ` github-actions
@ 2022-07-18 2:13 ` github-actions
2022-07-18 13:19 ` prez
` (3 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: github-actions @ 2022-07-18 2:13 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#issuecomment-1186693045
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (15 preceding siblings ...)
2022-07-18 2:13 ` github-actions
@ 2022-07-18 13:19 ` prez
2022-07-19 20:30 ` leahneukirchen
` (2 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: prez @ 2022-07-18 13:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 188 bytes --]
New comment by prez on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#issuecomment-1187406793
Comment:
What's so hard about merging a +10 −11 change?
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (16 preceding siblings ...)
2022-07-18 13:19 ` prez
@ 2022-07-19 20:30 ` leahneukirchen
2022-07-20 19:01 ` the-maldridge
2022-07-20 19:01 ` [PR PATCH] [Closed]: " the-maldridge
19 siblings, 0 replies; 21+ messages in thread
From: leahneukirchen @ 2022-07-19 20:30 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#issuecomment-1189522261
Comment:
I don't get why this PR is open. We have the subpixel rendering feature enabled by default, and a fresh installation of fontconfig also yields a `/etc/fonts/conf.d/11-lcdfilter-default.conf`.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (17 preceding siblings ...)
2022-07-19 20:30 ` leahneukirchen
@ 2022-07-20 19:01 ` the-maldridge
2022-07-20 19:01 ` [PR PATCH] [Closed]: " the-maldridge
19 siblings, 0 replies; 21+ messages in thread
From: the-maldridge @ 2022-07-20 19:01 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 209 bytes --]
New comment by the-maldridge on void-packages repository
https://github.com/void-linux/void-packages/pull/23962#issuecomment-1190645386
Comment:
Closing as superfluous. See @leahneukirchen's comment above.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PR PATCH] [Closed]: fontconfig: fix subpixel rendering in GTK applications
2020-07-30 21:59 [PR PATCH] fontconfig: fix subpixel rendering in GTK applications andry-dev
` (18 preceding siblings ...)
2022-07-20 19:01 ` the-maldridge
@ 2022-07-20 19:01 ` the-maldridge
19 siblings, 0 replies; 21+ messages in thread
From: the-maldridge @ 2022-07-20 19:01 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]
There's a closed pull request on the void-packages repository
fontconfig: fix subpixel rendering in GTK applications
https://github.com/void-linux/void-packages/pull/23962
Description:
This PR hopefully closes #21429.
The first commit converts the freetype's ClearType patch to a build option; while it is not necessary for the fix, @ericonr suggested it and it seems helpful.
The second commit provides a `fontconfig` configuration file that sets `lcdfilter` to `lcddefault`, fixing the issue.
The config file provides a system-wide default without enforcing it, so the user/desktop environment can override the option in `~/.config/fontconfig/fonts.conf`. This doesn't break existing users: if they set the option anywhere then that is respected, if they didn't then subpixel rendering will work as intended.
Setting `lcdfilter` to `lcdlight` in `fonts.conf` is equivalent to the default "Harmony" engine, so it's the same as not having the patch in the first place.
## Why is this needed anyway?
A year ago I opened #13296, which enables ClearType in `freetype`. When testing it I had `lcdfilter` already set to `lcddefault` in my own `fonts.conf` and I didn't think about setting the option by default system-wide, so I never noticed any regression. Sorry for that.
I wrote the patch because without it I couldn't read text effortlessly, the font wasn't "right" for me. Major distros (Ubuntu, Debian and Fedora from the top of my head) have it enabled by default because, _generally speaking_, font rendering feels better with it.
^ permalink raw reply [flat|nested] 21+ messages in thread