all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Printing fonts
@ 2007-10-15 18:43 Joel J. Adamson
  2007-10-17 21:32 ` Peter Dyballa
  0 siblings, 1 reply; 5+ messages in thread
From: Joel J. Adamson @ 2007-10-15 18:43 UTC (permalink / raw)
  To: help-gnu-emacs

Dear Group,

I'm using Emacs 23.0.0.1 on Slackware Linux 12.0.  I have tons of
fonts installed, including all the defaults that come with Slackware
and OpenOffice.org.

What's the best way to print a buffer in a particular font?  I would
like to print in a monospaced font other than courier, perhaps Luxi
Mono or Dejavu Sans Mono (my screen font); I know that I can change
ps-font-family to Palatino, Times etc., and that's fine for printing
emails or buffers that are mostly text.

Is there a way to specify an arbitrary font (not just the set allowed
by ps-font-family) for ps-print-buffer or print-buffer?  What about
the other printing commands (e.g., lpr-buffer)?

Thanks,
Joel
-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Printing fonts
  2007-10-15 18:43 Printing fonts Joel J. Adamson
@ 2007-10-17 21:32 ` Peter Dyballa
  2007-10-18 13:14   ` Joel J. Adamson
       [not found]   ` <mailman.2240.1192713450.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Dyballa @ 2007-10-17 21:32 UTC (permalink / raw)
  To: Joel J. Adamson; +Cc: help-gnu-emacs


Am 15.10.2007 um 20:43 schrieb Joel J. Adamson:

> Is there a way to specify an arbitrary font (not just the set allowed
> by ps-font-family) for ps-print-buffer or print-buffer?

Have you tried to customise a bit? The Ps Print group contains the  
Font group, in which you can add more entries to the Ps Font Info  
Database. Then you can select from this new set.

This will have one problem: no non-built-in font will be downloaded  
to the PostScript printer. This might make it necessary to use an  
external utility to actually create the PS output.

And there is one more problem: it's not necessarily a PostScript font  
that you want to use for printing ...

> What about the other printing commands (e.g., lpr-buffer)?

Have you tried to look up what's behind that function? I found: Print  
buffer contents without pagination or page headers ... So it's up to  
your system's setup how text gets printed.

--
Greetings

   Pete     === -Q
              ==<__/% >>
_____________(_)____@_____________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Printing fonts
  2007-10-17 21:32 ` Peter Dyballa
@ 2007-10-18 13:14   ` Joel J. Adamson
       [not found]   ` <mailman.2240.1192713450.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Joel J. Adamson @ 2007-10-18 13:14 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 15.10.2007 um 20:43 schrieb Joel J. Adamson:
>
>> Is there a way to specify an arbitrary font (not just the set allowed
>> by ps-font-family) for ps-print-buffer or print-buffer?
>
> Have you tried to customise a bit? The Ps Print group contains the
> Font group, in which you can add more entries to the Ps Font Info
> Database. Then you can select from this new set.

I'll check that out; I presumed that the given choices were _it_ since
those would be all the printer would automatically have.

> This will have one problem: no non-built-in font will be downloaded
>to the PostScript printer. This might make it necessary to use an
>external utility to actually create the PS output.

That's the solution I've found; I created postscript fonts from my
..ttf fonts via ttf2afm and ttf2pt1 in a personal font directory, then
used them with GNU enscript (shell-command-on-region or
shell-command-on-buffer).  I used mkafmmap to create an afm map file,
then added that directory to my font path in .enscriptrc.  I figured
this out from the enscript FAQ.  This works just fine: I can still get
the Emacs "ps-print-buffer" style header, highlighting a la a2ps, and
the fonts I like.  This is simpler than redesigning prologues like the
a2ps info recommends.

I only discovered enscript after writing my initial message.

Thanks for responding,
Joel
-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109


The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Printing fonts
       [not found]   ` <mailman.2240.1192713450.18990.help-gnu-emacs@gnu.org>
@ 2007-10-18 18:00     ` Joel J. Adamson
  2007-10-19 14:43       ` Giorgos Keramidas
  0 siblings, 1 reply; 5+ messages in thread
From: Joel J. Adamson @ 2007-10-18 18:00 UTC (permalink / raw)
  To: help-gnu-emacs

jadamson@partners.org (Joel J. Adamson) writes:

[...]


> I only discovered enscript after writing my initial message.

Here's a little function to do the hard work, suggestions welcome:


(defun my-print-buffer (font)
  (interactive "sFont: ")
  (let ((cmd-string
	 (format "enscript -u\"Joel J. Adamson\" --ul-font=Times-Roman100 --ul-style=filled -f%s -G --style=a2ps" font))) ;include page title of current buffer
    (shell-command-on-region
     (point-min) (point-max) cmd-string)))

Can I split that string across lines?  The comment is really a TODO; I
tried inserting a page header like in a2ps, but "-b%s" corresponding
to (buffer-name (current-buffer)) didn't work.

Thanks,
Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Printing fonts
  2007-10-18 18:00     ` Joel J. Adamson
@ 2007-10-19 14:43       ` Giorgos Keramidas
  0 siblings, 0 replies; 5+ messages in thread
From: Giorgos Keramidas @ 2007-10-19 14:43 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 18 Oct 2007 14:00:56 -0400, jadamson@partners.org (Joel J. Adamson) wrote:
> jadamson@partners.org (Joel J. Adamson) writes:
>
> [...]
>
>> I only discovered enscript after writing my initial message.
>
> Here's a little function to do the hard work, suggestions welcome:
>
>
> (defun my-print-buffer (font)
>   (interactive "sFont: ")
>   (let ((cmd-string
> 	 (format "enscript -u\"Joel J. Adamson\" --ul-font=Times-Roman100 --ul-style=filled -f%s -G --style=a2ps" font))) ;include page title of current buffer
>     (shell-command-on-region
>      (point-min) (point-max) cmd-string)))
>
> Can I split that string across lines?

I'm sure there are probably better ways to do this, but the following
may help:

    (let ((ps-options '("-u\"Joel J. Adamson\""
                        "--ul-font=Times-Roman100")))
      (apply 'concat
             (apply 'append
                    (mapcar (lambda (s)
                              (list s " "))
                            ps-options))))

    => "-u\"Joel J. Adamson\" --ul-font=Times-Roman100 "

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-19 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-15 18:43 Printing fonts Joel J. Adamson
2007-10-17 21:32 ` Peter Dyballa
2007-10-18 13:14   ` Joel J. Adamson
     [not found]   ` <mailman.2240.1192713450.18990.help-gnu-emacs@gnu.org>
2007-10-18 18:00     ` Joel J. Adamson
2007-10-19 14:43       ` Giorgos Keramidas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.