New debconf question for fontconfig-config package
Hi,
I'm planning to add a new debconf question in the fontconfig-config package.
Apparently it's advised to ask on this mailing list.
The debconf template is:
Template: fontconfig/hinting_style
Type: select
__Choices: None, Slight, Medium, Full
Default: Slight
_Description: Automatic hinting style (system default):
Please select the preferred automatic hinting style.
.
The hinting style is the amount of font reshaping done to line up to the grid.
Slight will make the font more fuzzy to line up to the grid but will be better in
retaining font shape, while Full will be a crisp font that aligns well to
the pixel grid but will lose a greater amount of font shape. Slight is the
default setting.
.
To revert to the pre-2.12 behavior, select Full.
The text is coming is coming from:
https://wiki.archlinux.org/index.php/font_configuration#Hintstyle
Any remarks?
Kind regards,
Laurent Bigonville
diff -Nru fontconfig-2.12.3/debian/changelog fontconfig-2.12.3/debian/changelog
--- fontconfig-2.12.3/debian/changelog 2017-06-22 09:53:55.000000000 +0200
+++ fontconfig-2.12.3/debian/changelog 2017-07-04 21:16:21.000000000 +0200
@@ -1,3 +1,12 @@
+fontconfig (2.12.3-0.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Add a NEWS file to describe the change in the default hinting style. Also
+ add a debconf question to allow the administrator to change it (Closes:
+ #866950)
+
+ -- Laurent Bigonville <bigon@debian.org> Tue, 04 Jul 2017 21:16:21 +0200
+
fontconfig (2.12.3-0.1) unstable; urgency=medium
* Non-maintainer upload.
diff -Nru fontconfig-2.12.3/debian/fontconfig-config.config fontconfig-2.12.3/debian/fontconfig-config.config
--- fontconfig-2.12.3/debian/fontconfig-config.config 2016-08-06 10:24:50.000000000 +0200
+++ fontconfig-2.12.3/debian/fontconfig-config.config 2017-06-27 12:39:17.000000000 +0200
@@ -23,6 +23,29 @@
db_set fontconfig/hinting_type "$hinting_type"
+hinting_style="Slight"
+
+hintnone="10-hinting-none.conf"
+hintslight="10-hinting-slight.conf"
+hintmedium="10-hinting-medium.conf"
+hintfull="10-hinting-full.conf"
+
+if [ -h $CONFDIR/$hintnone ]; then
+ hinting_style="None"
+fi
+if [ -h $CONFDIR/$hintslight ]; then
+ hinting_style="Slight"
+fi
+if [ -h $CONFDIR/$hintmedium ]; then
+ hinting_style="Medium"
+fi
+if [ -h $CONFDIR/$hintfull ]; then
+ hinting_style="Full"
+fi
+
+db_set fontconfig/hinting_style "$hinting_style"
+
+
subpixel_rendering="Automatic"
subpixel_2_3="20-debconf-sub-pixel.conf"
@@ -65,6 +88,7 @@
db_set fontconfig/enable_bitmaps "$enable_bitmaps"
db_input low fontconfig/hinting_type || true
+db_input low fontconfig/hinting_style || true
db_input low fontconfig/subpixel_rendering || true
db_input low fontconfig/enable_bitmaps || true
db_go
diff -Nru fontconfig-2.12.3/debian/fontconfig-config.NEWS fontconfig-2.12.3/debian/fontconfig-config.NEWS
--- fontconfig-2.12.3/debian/fontconfig-config.NEWS 1970-01-01 01:00:00.000000000 +0100
+++ fontconfig-2.12.3/debian/fontconfig-config.NEWS 2017-07-04 21:16:21.000000000 +0200
@@ -0,0 +1,9 @@
+fontconfig (2.12.3-0.2) unstable; urgency=medium
+
+ Starting with version 2.12, fontconfig is using "Slight" (hintslight) as
+ automatic hinting style. This might change the rendering of the fonts.
+
+ If you want the to restore the old hinting, run "dpkg-reconfigure
+ fontconfig-config" and select "Full" as hinting style.
+
+ -- Laurent Bigonville <bigon@debian.org> Tue, 04 Jul 2017 21:10:57 +0200
diff -Nru fontconfig-2.12.3/debian/fontconfig-config.postinst fontconfig-2.12.3/debian/fontconfig-config.postinst
--- fontconfig-2.12.3/debian/fontconfig-config.postinst 2016-08-06 10:24:50.000000000 +0200
+++ fontconfig-2.12.3/debian/fontconfig-config.postinst 2017-07-04 20:45:04.000000000 +0200
@@ -22,6 +22,12 @@
return 1
}
+# Create /etc/fonts/conf.d/10-hinting-slight.conf symlink on upgrade, this is
+# upstream default
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le-nl "2.12.3-0.2~"; then
+ ln -s $CONFAVAIL/10-hinting-slight.conf $CONFDIR/10-hinting-slight.conf
+fi
+
if is_initial_configuration "$@"; then
db_get fontconfig/hinting_type
hinting_type="$RET"
@@ -47,6 +53,41 @@
;;
esac
+ db_get fontconfig/hinting_style
+ hinting_style="$RET"
+
+ hintnone="10-hinting-none.conf"
+ hintslight="10-hinting-slight.conf"
+ hintmedium="10-hinting-medium.conf"
+ hintfull="10-hinting-full.conf"
+
+ if [ -h $CONFDIR/$hintnone ]; then
+ rm $CONFDIR/$hintnone
+ fi
+ if [ -h $CONFDIR/$hintslight ]; then
+ rm $CONFDIR/$hintslight
+ fi
+ if [ -h $CONFDIR/$hintmedium ]; then
+ rm $CONFDIR/$hintmedium
+ fi
+ if [ -h $CONFDIR/$hintfull ]; then
+ rm $CONFDIR/$hintfull
+ fi
+
+ case "$hinting_style" in
+ "None")
+ ln -s $CONFAVAIL/$hintnone $CONFDIR/$hintnone
+ ;;
+ "Slight")
+ ln -s $CONFAVAIL/$hintslight $CONFDIR/$hintslight
+ ;;
+ "Medium")
+ ln -s $CONFAVAIL/$hintmedium $CONFDIR/$hintmedium
+ ;;
+ "Full")
+ ln -s $CONFAVAIL/$hintfull $CONFDIR/$hintfull
+ ;;
+ esac
db_get fontconfig/subpixel_rendering
subpixel_rendering="$RET"
diff -Nru fontconfig-2.12.3/debian/fontconfig-config.postrm fontconfig-2.12.3/debian/fontconfig-config.postrm
--- fontconfig-2.12.3/debian/fontconfig-config.postrm 2017-03-12 19:07:31.000000000 +0100
+++ fontconfig-2.12.3/debian/fontconfig-config.postrm 2017-06-27 12:41:44.000000000 +0200
@@ -8,12 +8,16 @@
# in postinst
unhinted="10-unhinted.conf"
autohint="10-autohint.conf"
+hintnone="10-hinting-none.conf"
+hintslight="10-hinting-slight.conf"
+hintmedium="10-hinting-medium.conf"
+hintfull="10-hinting-full.conf"
subpixel="10-sub-pixel-rgb.conf"
no_subpixel="10-no-sub-pixel.conf"
yes_bitmaps="70-yes-bitmaps.conf"
no_bitmaps="70-no-bitmaps.conf"
-CONFFILES="$unhinted $autohint $subpixel $no_subpixel $yes_bitmaps $no_bitmaps"
+CONFFILES="$unhinted $autohint $hintnone $hintslight $hintmedium $hintfull $subpixel $no_subpixel $yes_bitmaps $no_bitmaps"
CONFDIR=/etc/fonts/conf.d
case "$1" in
diff -Nru fontconfig-2.12.3/debian/fontconfig-config.templates fontconfig-2.12.3/debian/fontconfig-config.templates
--- fontconfig-2.12.3/debian/fontconfig-config.templates 2016-08-06 10:24:50.000000000 +0200
+++ fontconfig-2.12.3/debian/fontconfig-config.templates 2017-07-04 21:16:21.000000000 +0200
@@ -18,6 +18,21 @@
any of the Microsoft fonts. Select 'Autohinter' if you mostly use other
TrueType fonts. Select 'None' if you want blurry text.
+Template: fontconfig/hinting_style
+Type: select
+__Choices: None, Slight, Medium, Full
+Default: Slight
+_Description: Automatic hinting style (system default):
+ Please select the preferred automatic hinting style.
+ .
+ The hinting style is the amount of font reshaping done to line up to the grid.
+ Slight will make the font more fuzzy to line up to the grid but will be better in
+ retaining font shape, while Full will be a crisp font that aligns well to
+ the pixel grid but will lose a greater amount of font shape. Slight is the
+ default setting.
+ .
+ To revert to the pre-2.12 behaviour, select Full.
+
Template: fontconfig/subpixel_rendering
Type: select
__Choices: Automatic, Always, Never
diff -Nru fontconfig-2.12.3/debian/rules fontconfig-2.12.3/debian/rules
--- fontconfig-2.12.3/debian/rules 2017-03-12 18:57:08.000000000 +0100
+++ fontconfig-2.12.3/debian/rules 2017-07-04 21:08:44.000000000 +0200
@@ -40,3 +40,6 @@
cd debian/fontconfig-config/usr/share/fontconfig/conf.avail && \
mv 70-yes-bitmaps.conf 70-force-bitmaps.conf
cp debian/70-yes-bitmaps.conf debian/fontconfig-config/usr/share/fontconfig/conf.avail/
+# Do not ship 10-hinting-slight.conf symlink by default, let debconf handle
+# that so the administrator can configure it. Still default to slight hinting.
+ rm debian/fontconfig-config/etc/fonts/conf.d/10-hinting-slight.conf
Reply to: