Package: fbi
Version: 2.09-1+b1
Severity: normal
Tags: patch

Dear Maintainer,

PDF documents can be hard to read using fbgs because text is not being 
antialiased. Some documents are so unpleasant to 
read that the program is essentially unusable.

Fortunately, it is a simple matter to enable antialiasing in ghostscript, if 
the output device is not monochrome.

I have created a patch which makes color and antialiasing work by default in 
fbgs. Of course, I have added flags to 
disable those defaults if someone should so wish. (-M for monochrome, -A for no 
antialiasing).

Note that since antialiasing requires "color" output, this patch includes the 
fixes I sent on BUG #780643.

A second patch is included for the man page.

Ben


-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i586)

Kernel: Linux 3.16.0-4-586
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages fbi depends on:
ii  ghostscript      9.06~dfsg-2
ii  libc6            2.19-15
ii  libcurl3-gnutls  7.38.0-4
ii  libexif12        0.6.21-2
ii  libfontconfig1   2.11.0-6.3
ii  libfreetype6     2.5.2-3
ii  libgif4          4.1.6-11
ii  libjpeg62-turbo  1:1.3.1-11+deb7u1
ii  libpng12-0       1.2.50-2+b2
ii  libtiff5         4.0.3-12.1
ii  zlib1g           1:1.2.8.dfsg-2+b1

fbi recommends no packages.

Versions of packages fbi suggests:
pn  imagemagick  <none>

-- no debconf information



*** antialiaspatch
--- fbgs.orig   2012-02-22 09:13:36.000000000 -0800
+++ fbgs        2015-03-14 12:31:17.468334244 -0700
@@ -14,8 +14,9 @@
 # parse options
 fbiopts=""
 gsopts=""
+antialias="-dTextAlphaBits=4 -dGraphicsAlphaBits=4"
 passwd=""
-device="tiffpack"
+device="png16m"
 opt=1
 bell="off"
 helptext="
@@ -24,12 +25,13 @@
 
 usage: fbgs [fbgs options] [fbi options] file
 
+   -A    --no-antialias      do not antialias (faster rendering)
    -b    --bell              emit a beep when the document is ready
    -h    --help              print this help text
    -p    --password <arg>    a <password> passed to the PDF
    -fp   --firstpage <arg>   begins on the <arg> page
    -lp  --lastpage <arg>    stops on the <arg> page
-   -c    --color             pages in color
+   -M    --monochrome        render in monochrome (B&W)
    -l                        pages rendered with 100 dpi
    -xl                       pages rendered with 120 dpi
    -xxl                      pages rendered with 150 dpi
@@ -41,6 +43,15 @@
 while test "$opt" = "1"; do
        case "$1" in
                # fbgs options
+               -A | --no-antialias)
+                       antialias=""
+                       shift
+                       ;;
+               --antialias)
+                       # Needless since this is the default, but just in case.
+                       antialias="-dTextAlphaBits=4 -dGraphicsAlphaBits=4"
+                       shift
+                       ;;
                -b | --bell)
                        bell="on"
                        shift
@@ -61,7 +72,12 @@
                        gsopts="$gsopts -dLastPage=$2"
                        shift; shift
                        ;;
+               -M | --monochrome)
+                       device="tiffpack"
+                       shift
+                       ;;
                -c | --color)
+                       echo "The $1 flag is deprecated. Color is now the 
default." >&2
                        device="png16m"
                        shift
                        ;;
@@ -116,7 +132,7 @@
 gs     -dSAFER -dNOPAUSE -dBATCH                       \
        -sPDFPassword="$password"                       \
        -sDEVICE=${device} -sOutputFile=$DIR/ps%03d.tiff \
-       $gsopts                                         \
+       $antialias $gsopts                              \
        "$1"
 
 # tell the user we are done :-)



*** antialiaspatchmanpage
--- fbgs.1.orig 2014-10-14 11:51:07.000000000 -0700
+++ fbgs.1      2015-03-14 12:20:35.212408494 -0700
@@ -8,7 +8,8 @@
 .SH SYNOPSIS
 \fBfbgs\fP\
  [\fB\-l\fP|\fB\-xl\fP|\fB\-xxl\fP|\fB\-r\fP \fIn\fP]\
- [\fB\-c\fP]\
+ [\fB\-A\fP]\
+ [\fB\-M\fP]\
  [\fB\-b\fP]\
  [\fB\-p\fP\ \fIpassword\fP]\
  [\fB\--fp\fP\ \fInumber\fP]\
@@ -37,11 +38,14 @@
 .B -h, --help
 Print usage info (overwrites fbi option).
 .TP
+.B -A, --no-antialias
+Disable antialiasing (smoothing). Faster, but can make text very hard to read.
+.TP
 .B -b, --bell
 Emit a beep when the document is ready.
 .TP
-.B -c, --color
-To render the pages in color (default is N&B).
+.B -M, --monochrome
+To render the pages in monochrome (black and white). Faster, but also disables 
antialiasing.
 .TP
 .B -l
 To get the pages rendered with 100 dpi (default is 75).
--- fbgs.orig	2012-02-22 09:13:36.000000000 -0800
+++ fbgs	2015-03-14 12:31:17.468334244 -0700
@@ -14,8 +14,9 @@
 # parse options
 fbiopts=""
 gsopts=""
+antialias="-dTextAlphaBits=4 -dGraphicsAlphaBits=4"
 passwd=""
-device="tiffpack"
+device="png16m"
 opt=1
 bell="off"
 helptext="
@@ -24,12 +25,13 @@
 
 usage: fbgs [fbgs options] [fbi options] file
 
+   -A    --no-antialias      do not antialias (faster rendering)
    -b    --bell              emit a beep when the document is ready
    -h    --help              print this help text
    -p    --password <arg>    a <password> passed to the PDF
    -fp   --firstpage <arg>   begins on the <arg> page
    -lp	 --lastpage <arg>    stops on the <arg> page
-   -c    --color             pages in color
+   -M    --monochrome        render in monochrome (B&W)
    -l                        pages rendered with 100 dpi
    -xl                       pages rendered with 120 dpi
    -xxl                      pages rendered with 150 dpi
@@ -41,6 +43,15 @@
 while test "$opt" = "1"; do
 	case "$1" in
 		# fbgs options
+		-A | --no-antialias)
+			antialias=""
+			shift
+			;;
+		--antialias)
+			# Needless since this is the default, but just in case.
+			antialias="-dTextAlphaBits=4 -dGraphicsAlphaBits=4"
+			shift
+			;;
 		-b | --bell)
 			bell="on"
 			shift
@@ -61,7 +72,12 @@
 			gsopts="$gsopts -dLastPage=$2"
 			shift; shift
 			;;
+		-M | --monochrome)
+			device="tiffpack"
+			shift
+			;;
 		-c | --color)
+			echo "The $1 flag is deprecated. Color is now the default." >&2
 			device="png16m"
 			shift
 			;;
@@ -116,7 +132,7 @@
 gs	-dSAFER -dNOPAUSE -dBATCH			\
 	-sPDFPassword="$password"			\
 	-sDEVICE=${device} -sOutputFile=$DIR/ps%03d.tiff \
-	$gsopts						\
+	$antialias $gsopts				\
 	"$1"
 
 # tell the user we are done :-)
--- fbgs.1.orig	2014-10-14 11:51:07.000000000 -0700
+++ fbgs.1	2015-03-14 12:20:35.212408494 -0700
@@ -8,7 +8,8 @@
 .SH SYNOPSIS
 \fBfbgs\fP\
  [\fB\-l\fP|\fB\-xl\fP|\fB\-xxl\fP|\fB\-r\fP \fIn\fP]\
- [\fB\-c\fP]\
+ [\fB\-A\fP]\
+ [\fB\-M\fP]\
  [\fB\-b\fP]\
  [\fB\-p\fP\ \fIpassword\fP]\
  [\fB\--fp\fP\ \fInumber\fP]\
@@ -37,11 +38,14 @@
 .B -h, --help
 Print usage info (overwrites fbi option).
 .TP
+.B -A, --no-antialias
+Disable antialiasing (smoothing). Faster, but can make text very hard to read.
+.TP
 .B -b, --bell
 Emit a beep when the document is ready.
 .TP
-.B -c, --color
-To render the pages in color (default is N&B).
+.B -M, --monochrome
+To render the pages in monochrome (black and white). Faster, but also disables antialiasing.
 .TP
 .B -l
 To get the pages rendered with 100 dpi (default is 75).

Reply via email to