Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

make ps-print-buffer-with-faces all bold

24 views
Skip to first unread message

myglc2

unread,
Jul 23, 2016, 8:40:15 PM7/23/16
to help-gn...@gnu.org
I alway want emacs printout in color but find the 'normal' faces
frustratingly unreadable, especially in low contrast colors. So... Here
is how to make everything bold in ps-print-buffer-with-faces, etc.

;; ps-print in all bold fonts
(ps-extend-face-list
(mapcar (function (lambda (x) (list x
(face-attribute x :foreground)
(face-attribute x :background)
'bold)))
(face-list)) 'MERGE)


Emanuel Berg

unread,
Jul 24, 2016, 9:06:07 AM7/24/16
to
Cool, but perhaps you should change the "low
contrast colors" instead? Or do they look good
on the screen, only not so when printed?

In what context should one use the code? I.e.,
do you run it once or every time you print?

And: I don't think you need `function' before
`lambda'.

Last, aren't there other attributes than
foreground and background? Perhaps you can find
a function that returns the whole thing, and
then just set it to bold?

Otherwise keep it up...

--
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
- so far: 58 Blogomatic articles -

myglc2

unread,
Jul 24, 2016, 11:51:20 AM7/24/16
to help-gn...@gnu.org
Emanuel Berg <embe...@student.uu.se> writes:

> myglc2 wrote:
>
>> I alway want emacs printout in color but find
>> the 'normal' faces frustratingly unreadable,
>> especially in low contrast colors. So... Here
>> is how to make everything bold in
>> ps-print-buffer-with-faces, etc.
>>
>> ;; ps-print in all bold fonts
>> (ps-extend-face-list
>> (mapcar (function (lambda (x) (list x
>> (face-attribute x :foreground)
>> (face-attribute x :background)
>> 'bold)))
>> (face-list)) 'MERGE)
>
> Cool, but perhaps you should change the "low
> contrast colors" instead?

To print I use a light theme and I want color to match the screen. Dark
themes are generally unreadable printed this way. Something clever needs
to be done with the color if you want to print dark themes.

> Or do they look good on the screen, only not so when printed?

On my printer normal fonts are ~ unreadable.

> In what context should one use the code? I.e.,
> do you run it once or every time you print?

emacs init file.

> And: I don't think you need `function' before
> `lambda'.

elisp noobie ;-)

> Last, aren't there other attributes than
> foreground and background? Perhaps you can find
> a function that returns the whole thing, and
> then just set it to bold?

The ps-print.el public interface requires this custom structure.


Emanuel Berg

unread,
Jul 24, 2016, 4:42:40 PM7/24/16
to
myglc2 wrote:

>> Last, aren't there other attributes than
>> foreground and background? Perhaps you can
>> find a function that returns the whole
>> thing, and then just set it to bold?
>
> The ps-print.el public interface requires
> this custom structure.

OK, because if you use `describe-function' you
get a whole lot of stuff!

But perhaps PostScript in this case (?) only
uses what you mention?

Actually it all I use for faces. Foreground,
background, and bold or not (the foreground).

(modify-face 'erc-header-line "white" "magenta" nil t)

The fourth argument is the foreground boldness;
the third is "stipple".

A lot of the properties are not supported in
the Linux VTs. Maybe they look cool in X?

Ironic thing is, rms wanted to make Emacs
a word processor for the masses. Instead it
stayed, and became even more so, a text editor
and programming tool for the computer elite.

Family: unspecified
Foundry: unspecified
Width: unspecified
Height: unspecified
Weight: normal
Slant: normal
Foreground: blue
DistantForeground: unspecified
Background: unspecified
Underline: nil
Overline: unspecified
Strike-through: unspecified
Box: unspecified
Inverse: nil
Stipple: unspecified
Font: unspecified
Fontset: unspecified
Inherit: unspecified

myglc2

unread,
Jul 25, 2016, 11:10:11 AM7/25/16
to help-gn...@gnu.org
Emanuel Berg <embe...@student.uu.se> writes:

> myglc2 wrote:
>
>>> Last, aren't there other attributes than
>>> foreground and background? Perhaps you can
>>> find a function that returns the whole
>>> thing, and then just set it to bold?
>>
>> The ps-print.el public interface requires
>> this custom structure.
>
> OK, because if you use `describe-function' you
> get a whole lot of stuff!
>
> But perhaps PostScript in this case (?) only
> uses what you mention?

Restating the function under discussion for handy reference ...

;; ps-print in all bold fonts
(ps-extend-face-list
(mapcar (function (lambda (x) (list x
(face-attribute x :foreground)
(face-attribute x :background)
'bold)))
(face-list)) 'MERGE)

OK I think I missed your earlier point. Yes, you can specify additional
attributes, to the extent that ps-print supports them, using the
'ps-extend-face-list' interface.

The reason I specify the colors is that with nil or t for foreground and
background, ps-print prints in B&W. So this function re-states the
colors that ps-print already knows about in order to bold the faces w/o
clobbering the color. HTH - George


0 new messages