Github messages for voidlinux
 help / color / mirror / Atom feed
From: andry-dev <andry-dev@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] fontconfig: fix subpixel rendering in GTK applications
Date: Tue, 23 Mar 2021 22:46:23 +0100	[thread overview]
Message-ID: <20210323214623.rqfzkG_U0WPxvmfFlyTiEAERkfT6bZPHyyKRPP4kang@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23962@inbox.vuxu.org>

[-- 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."

  parent reply	other threads:[~2021-03-23 21:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 21:59 [PR PATCH] " 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
2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
2020-07-30 23:34 ` ahesford
2020-07-31  0:05 ` ericonr
2020-07-31  0:06 ` ericonr
2020-07-31  0:15 ` ahesford
2020-07-31  8:17 ` [PR PATCH] [Updated] " andry-dev
2021-03-23 15:57 ` prez
2021-03-23 21:46 ` andry-dev [this message]
2021-03-23 21:49 ` [PR PATCH] [Updated] " andry-dev
2022-04-18  2:11 ` github-actions
2022-07-18  2:13 ` github-actions
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210323214623.rqfzkG_U0WPxvmfFlyTiEAERkfT6bZPHyyKRPP4kang@z \
    --to=andry-dev@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).