Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
print with DejaVu font from emacs
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
harven  
View profile  
 More options Nov 9, 10:38 am
Newsgroups: gnu.emacs.help
From: harven <har...@free.fr>
Date: Mon, 09 Nov 2009 16:38:34 +0100
Local: Mon, Nov 9 2009 10:38 am
Subject: print with DejaVu font from emacs
I recently switched to emacs23.1.1 and the unicode support is great.
I use the default DejaVuSansMono font in emacs, but when I try to do
a ps-print-buffer or ps-spool-buffer, it uses the Courier font.
Thus the result is disappointing because Courier does not support
a lot of unicode characters.

I tried to set ps-font-family to "Monospace" or "DejaVuSansMono"
which is the default font on my DE (gnome 2.28). But I get the warning
"don't have data to scale font Monospace. Known fonts family are (Courier..."
The list of known fonts is pretty short and I don't think that any of them
supports the whole unicode range.

I am a bit clueless about that scaling issue. (this is not an problem related
to the printer or system, gedit prints without problem with that font).
How can I make emacs use the Monospace font for printing ?

Thanks for your help,
--
Harven


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Dyballa  
View profile  
 More options Nov 9, 11:36 am
Newsgroups: gnu.emacs.help
From: Peter Dyballa <Peter_Dyba...@Web.DE>
Date: Mon, 9 Nov 2009 17:36:12 +0100
Local: Mon, Nov 9 2009 11:36 am
Subject: Re: print with DejaVu font from emacs

Am 09.11.2009 um 16:38 schrieb harven:

> I recently switched to emacs23.1.1 and the unicode support is great.
> I use the default DejaVuSansMono font in emacs, but when I try to do
> a ps-print-buffer or ps-spool-buffer, it uses the Courier font.
> Thus the result is disappointing because Courier does not support
> a lot of unicode characters.

In Unicode forget ps-print-<whatever>! PostScript only handles  
encodings of 256 elements (and with some difficulty also CJK fonts  
with thousands of code points). What you need is a conversion from  
text to Unicode encoded HTML which then can easily be handled by your  
OS or desktop.

Htmlize.el by Hrvoje Nikšić: http://fly.srk.fer.hr/~hniksic/emacs/
htmlize.el. A sample of its capabilities can be seen here: http://
fly.srk.fer.hr/~hniksic/emacs/htmlize.el.html – missing some CJK and  
other non-Latin content. Lennart Borgman's htmlize-view.el helps a  
bit to handle printing (http://piprim.tuxfamily.org/home/pi/emacs.d/
site-lisp/htmlize-view.el).

So using DejaVu in the buffer will produce HTML output using the same  
fonts which then can be converted to PDF for the purpose of printing,  
still using DejaVu.

--
Greetings

   Pete

Give a man a fish, and you've fed him for a day. Teach him to fish,  
and you've depleted the lake.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
harven  
View profile  
 More options Nov 11, 11:12 am
Newsgroups: gnu.emacs.help
From: harven <har...@free.fr>
Date: Wed, 11 Nov 2009 17:12:00 +0100
Subject: Re: print with DejaVu font from emacs
Thanks for your reply.
Instead of converting to html, I think I will just open the file in the
browser and print from there. DejaVu is also used as the default monospace
in my browser.

I am a bit surprised by your comment on postscript not supporting unicode.
I successfully print unicode/DejaVu text files from gedit. Redirecting
the output to a virtual printer, I get a well behaved postscript file
that displays the DejaVu fonts without problem. From what I have seen,
the unicode characters appearing in the text file are redefined in
the postscript. I don't know what part of the gnome desktop generates the
postscript though.

Is there some plan (or obstruction) to implement that feature in emacs
with ps-print ? That is, being able to print a buffer with the (unicode, ttf)
font actually displayed in the buffer instead of the bdf default Courier ?
Or maybe I can put it on the wishlist.

Sincerely,


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Dyballa  
View profile  
 More options Nov 11, 2:23 pm
Newsgroups: gnu.emacs.help
From: Peter Dyballa <Peter_Dyba...@Web.DE>
Date: Wed, 11 Nov 2009 20:23:11 +0100
Local: Wed, Nov 11 2009 2:23 pm
Subject: Re: print with DejaVu font from emacs

Am 11.11.2009 um 17:12 schrieb harven:

> Thanks for your reply.
> Instead of converting to html, I think I will just open the file in  
> the
> browser and print from there. DejaVu is also used as the default  
> monospace
> in my browser.

That's exactly what htmlize.el and htmlize-view.el do: they prepare  
an Unicode encoded buffer easily as HTML which is then "sent" to an  
external HTML viewer (a so-called "browser") which can use the OS'  
desktop mechanisms to print that Unicode contents as PDF Unicode.

> I am a bit surprised by your comment on postscript not supporting  
> unicode.

PostScript is 8 bit! It might be elder then you. PostScript fonts can  
larger, maybe contain 1,000 glyphs. These are accessed by an  
encoding, which is 8 bit. TeX, a bit elder then PS, is essentially 7  
bit. The trick of a "virtual font, " something like a "fontset" in  
GNU Emacs, allows it to access two 7-bit encoded fonts as if it were  
one 8-bit font. Similarly by using a whole stack of encodings TeX is  
able to access some percent of Unicode. Particular mechanisms in TeX  
and in PostScript allow to print in CJK.

BTW, I am not that sure that your GNOME desktop creates PostScript  
files! (It would necessitate CID fonts.) You can easily check this by  
disabling the printer queue. Then any print output is queued in but  
not sent to the printer. So you have (almost) infinite time to locate  
the queue's content and check the files' type – possibly with super-
user privileges. And I am sure you'll find PDF...

--
Greetings

   Pete

Encryption, n.:
        A powerful algorithmic encoding technique employed in the creation  
of computer manuals.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
harven  
View profile  
 More options Nov 11, 4:43 pm
Newsgroups: gnu.emacs.help
From: harven <har...@free.fr>
Date: Wed, 11 Nov 2009 22:43:15 +0100
Local: Wed, Nov 11 2009 4:43 pm
Subject: Re: print with DejaVu font from emacs

Peter Dyballa <Peter_Dyba...@Web.DE> writes:
> Am 11.11.2009 um 17:12 schrieb harven:
> BTW, I am not that sure that your GNOME desktop creates PostScript
> files! (It would necessitate CID fonts.) You can easily check this by
> disabling the printer queue. Then any print output is queued in but
> not sent to the printer. So you have (almost) infinite time to locate
> the queue's content and check the files' type – possibly with super-
> user privileges. And I am sure you'll find PDF...

I just tried your suggestion. From the virtual printer, I can choose
ps or pdf for the output. When I choose ps, I get a file starting with

%!PS-Adobe-3.0
%%Creator: cairo 1.8.0 (http://cairographics.org)
%%CreationDate: Wed Nov 11 22:06:56 2009
%%Pages: 1
%%BoundingBox: 0 0 612 792
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
...

From the cairographics webpage, I see that the fonts are always subsetted
and embedded. Later in the file, I find

  Encoding 1 /uni222C put
  Encoding 2 /uni006D put
  Encoding 3 /uni006F put
  ...
 /sfnts [  
 <00010000000a008000030020636d61700043f0c90000080c0000005863767420e997070c00 00
 0864000002306670676d5b026bdf00000a94000000ac676c79663d08b488000000ac0000076 0

which corresponds to the unicode characters I typed. Finally, when I open
the file on a computer which does not have the DejaVu fonts, the "postscript"
correctly displays the text with the DejaVu fonts. So what do you think ?
I may be fooled by the headers, I don't know much about postscript.

BTW, Am I wrong, or emacs23 now depends on cairo for 2D display ?

Cheers


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Dyballa  
View profile  
 More options Nov 11, 6:10 pm
Newsgroups: gnu.emacs.help
From: Peter Dyballa <Peter_Dyba...@Web.DE>
Date: Thu, 12 Nov 2009 00:10:33 +0100
Local: Wed, Nov 11 2009 6:10 pm
Subject: Re: print with DejaVu font from emacs

Am 11.11.2009 um 22:43 schrieb harven:

> Finally, when I open
> the file on a computer which does not have the DejaVu fonts, the  
> "postscript"
> correctly displays the text with the DejaVu fonts. So what do you  
> think ?

Cairo obviously has expanded PostScript use remarkably. It is  
embedding the TT font (large number of glyphs), as it should, and it  
seems to create one or more arbitrary encodings to encode just the  
characters used. Clever! (Could you send me privately this PS file?  
You don't need to print anything, lprm will remove anything from the  
queue.)

> BTW, Am I wrong, or emacs23 now depends on cairo for 2D display ?

I cannot explain a thing on this issue, but I can tell that Cairo is  
part of GNOME/GTK – and nowhere in GNU Emacs code some Cairo function  
is used. So it's some part of GTK which needs Cairo functions.

--
Greetings

   Pete

Life is the only flaw in an otherwise perfect nonexistence
                                – Schopenhauer


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google