unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Chinese characters missing in .ps output file
@ 2008-12-20 15:49 Rodolfo Medina
  2008-12-20 16:21 ` Peter Dyballa
       [not found] ` <mailman.3168.1229790102.26697.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Rodolfo Medina @ 2008-12-20 15:49 UTC (permalink / raw)
  To: help-gnu-emacs

With Emacs, I correctly open a file including chinese characters.  The
characters are correctly displayed in the text file, but when I try to create
the ps file, with `C-u M-x pr-ps-print-buffer-preview' or `C-u M-x
pr-ps-print-buffer-print', they are not displayed.

What am I missing, how can I work it out?

Thanks for any help
Rodolfo


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

* Re: Chinese characters missing in .ps output file
  2008-12-20 15:49 Chinese characters missing in .ps output file Rodolfo Medina
@ 2008-12-20 16:21 ` Peter Dyballa
       [not found] ` <mailman.3168.1229790102.26697.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2008-12-20 16:21 UTC (permalink / raw)
  To: Rodolfo Medina; +Cc: help-gnu-emacs


Am 20.12.2008 um 16:49 schrieb Rodolfo Medina:

> What am I missing, how can I work it out?


You are missing CID mapped PostScript fonts or a means to teach GNU  
Emacs to use TrueType or OpenType fonts instead.

Remember: a PostScript font can have thousands or millions of glyphs,  
but its encoding can only be 256 elements. It took years until  
PostScript was expanded to support CJK scripts.


Instead try 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).


Can you add a bit to the Emacs wiki?

--
Greetings

   Pete

Programming today is a race between software engineers striving to  
build bigger and better idiot-proof programs, and the Universe trying  
to produce bigger and better idiots. So far, the Universe is winning.
				– Rich Cook







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

* Re: Chinese characters missing in .ps output file
  2008-12-21 20:30   ` Rodolfo Medina
@ 2008-12-21 20:25     ` Peter Dyballa
       [not found]     ` <mailman.3207.1229891161.26697.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2008-12-21 20:25 UTC (permalink / raw)
  To: Rodolfo Medina; +Cc: help-gnu-emacs


Am 21.12.2008 um 21:30 schrieb Rodolfo Medina:

> With `http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el' I can  
> convert the text
> file into html format.  But, I still can't print it.  My post was  
> wishing to
> have a nice .ps file, then to convert also in pdf with ps2pdf.  Is  
> that that
> difficult?  How can I achieve that?

Why so complicated? Can't you tell your browser to print the HTML  
version or save it as PDF?

The other question is: did you understand what I wrote about  
PostScript fonts? If so, can you explain why it's not so easy to  
print a PostScript file with CJK content?

--
Greetings

   Pete

One doesn't expect governments to obey the law because of some higher  
moral development.  One expects them to obey the law because they  
know that if they don't, those who aren't shot will be hanged.
				– Michael Shirley







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

* Re: Chinese characters missing in .ps output file
       [not found] ` <mailman.3168.1229790102.26697.help-gnu-emacs@gnu.org>
@ 2008-12-21 20:30   ` Rodolfo Medina
  2008-12-21 20:25     ` Peter Dyballa
       [not found]     ` <mailman.3207.1229891161.26697.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Rodolfo Medina @ 2008-12-21 20:30 UTC (permalink / raw)
  To: help-gnu-emacs

Rodolfo Medina <rodolfo.medina@gmail.com> writes:

> With Emacs, I correctly open a file including chinese characters.  The
> characters are correctly displayed in the text file, but when I try to create
> the ps file, with `C-u M-x pr-ps-print-buffer-preview' or `C-u M-x
> pr-ps-print-buffer-print', they are not displayed.
>
> What am I missing, how can I work it out?


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> You are missing CID mapped PostScript fonts or a means to teach GNU Emacs to
> use TrueType or OpenType fonts instead.
>
> Remember: a PostScript font can have thousands or millions of glyphs, but its
> encoding can only be 256 elements. It took years until  PostScript was
> expanded 
> to support CJK scripts.
>
>
> Instead try 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).


Thanks!

With `http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el' I can convert the text
file into html format.  But, I still can't print it.  My post was wishing to
have a nice .ps file, then to convert also in pdf with ps2pdf.  Is that that
difficult?  How can I achieve that?


> Can you add a bit to the Emacs wiki?


I will with great pleasure whan I have solved the problem!

Bye
Rodolfo


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

* Re: Chinese characters missing in .ps output file
       [not found]     ` <mailman.3207.1229891161.26697.help-gnu-emacs@gnu.org>
@ 2008-12-21 22:18       ` Rodolfo Medina
  2008-12-21 22:20         ` Peter Dyballa
       [not found]         ` <mailman.3210.1229898011.26697.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Rodolfo Medina @ 2008-12-21 22:18 UTC (permalink / raw)
  To: help-gnu-emacs


Rodolfo Medina <rodolfo.medina@gmail.com> writes:

> With Emacs, I correctly open a file including chinese characters.  The
> characters are correctly displayed in the text file, but when I try to create
> the ps file, with `C-u M-x pr-ps-print-buffer-preview' or `C-u M-x
> pr-ps-print-buffer-print', they are not displayed.
>
> What am I missing, how can I work it out?


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> You are missing CID mapped PostScript fonts or a means to teach GNU Emacs to
> use TrueType or OpenType fonts instead.
>
> Remember: a PostScript font can have thousands or millions of glyphs, but its
> encoding can only be 256 elements. It took years until  PostScript was
> expanded 
> to support CJK scripts.
>
>
> Instead try 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).


Am 21.12.2008 um 21:30 schrieb Rodolfo Medina:

>> With `http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el' I can convert the text
>> file into html format.  But, I still can't print it.


No, it was my printer having problems.  Now I can print the html file fine!


> Can't you tell your browser to print the HTML version or save it as PDF?


Now I can print the HTML version.  As to save it as PDF, my Mozilla version
does not seem to be able to.  What browser do you know can do it?


> The other question is: did you understand what I wrote about PostScript
> fonts?  If so, can you explain why it's not so easy to print a PostScript
> file with CJK content?


Well, in fact no, I didn't understand what you wrote about PS fonts.  How can
obtain a .ps file from a text file including chinese characters?

Bare with my ignorance, thanks indeed
Rodolfo


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

* Re: Chinese characters missing in .ps output file
  2008-12-21 22:18       ` Rodolfo Medina
@ 2008-12-21 22:20         ` Peter Dyballa
       [not found]         ` <mailman.3210.1229898011.26697.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2008-12-21 22:20 UTC (permalink / raw)
  To: Rodolfo Medina; +Cc: help-gnu-emacs


Am 21.12.2008 um 23:18 schrieb Rodolfo Medina:

> Now I can print the HTML version.  As to save it as PDF, my Mozilla  
> version
> does not seem to be able to.  What browser do you know can do it?

All those running on Mac OS X.

>
>
>> The other question is: did you understand what I wrote about  
>> PostScript
>> fonts?  If so, can you explain why it's not so easy to print a  
>> PostScript
>> file with CJK content?
>
>
> Well, in fact no, I didn't understand what you wrote about PS  
> fonts.  How can
> obtain a .ps file from a text file including chinese characters?

By using complex commercial CJK fonts. Times, Helvetica, Courier have  
no CJK glyphs. And they only have a 256 elements encoding, maximally!

--
Greetings

   Pete

One person with a belief is a social power equal to ninety-nine who  
have only interests.
				– John Stuart Mill







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

* Re: Chinese characters missing in .ps output file
       [not found]         ` <mailman.3210.1229898011.26697.help-gnu-emacs@gnu.org>
@ 2008-12-22 15:41           ` Rodolfo Medina
  2008-12-22 20:22             ` Peter Dyballa
                               ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Rodolfo Medina @ 2008-12-22 15:41 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> try 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).


This way I can immediately have an HTML file.  Then, Debian Testing's Firefox
will convert it to .ps or .pdf format, so my problem is solved in practice.

But still I wish I could get the .ps file directly from within Emacs using the
pr-ps-print commands, as I do with files containing `normal' characters:


Rodolfo Medina <rodolfo.medina@gmail.com> writes:

> With Emacs, I correctly open a file including chinese characters.  The
> characters are correctly displayed in the text file, but when I try to create
> the ps file, with `C-u M-x pr-ps-print-buffer-preview' or `C-u M-x
> pr-ps-print-buffer-print', they are not displayed.
>
> What am I missing, how can I work it out?


Peter:

> You are missing CID mapped PostScript fonts or a means to teach GNU Emacs to
> use TrueType or OpenType fonts instead.
>
> Remember: a PostScript font can have thousands or millions of glyphs, but its
> encoding can only be 256 elements. It took years until  PostScript was
> expanded 
> to support CJK scripts.



Rodolfo:

>> How can obtain a .ps file from a text file including chinese characters?


Peter:

> By using complex commercial CJK fonts. Times, Helvetica, Courier have no CJK
> glyphs. And they only have a 256 elements encoding, maximally!


Can you give some more indications about where to download and how to install
those fonts?

Thanks
Rodolfo


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

* Re: Chinese characters missing in .ps output file
  2008-12-22 15:41           ` Rodolfo Medina
@ 2008-12-22 20:22             ` Peter Dyballa
  2008-12-23 22:22             ` James Cloos
       [not found]             ` <mailman.3297.1230070986.26697.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2008-12-22 20:22 UTC (permalink / raw)
  To: Rodolfo Medina; +Cc: help-gnu-emacs


Am 22.12.2008 um 16:41 schrieb Rodolfo Medina:

> Can you give some more indications about where to download and how  
> to install
> those fonts?

Internet, probably Adobe. *I* never needed such fonts, so I can't  
give more hints.

--
Greetings

   Pete

The human animal differs from the lesser primates in his passion for  
lists of "Ten Best."
				– H. Allen Smith







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

* Re: Chinese characters missing in .ps output file
  2008-12-22 15:41           ` Rodolfo Medina
  2008-12-22 20:22             ` Peter Dyballa
@ 2008-12-23 22:22             ` James Cloos
       [not found]             ` <mailman.3297.1230070986.26697.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: James Cloos @ 2008-12-23 22:22 UTC (permalink / raw)
  To: Rodolfo Medina; +Cc: help-gnu-emacs

The real answer for how to obtain ps or pdf from text supporting all of
unicode is to use libraries like cairo and pango.  Cairo knows how to
embed all of the typical outline fonts in both ps and pdf, and pango can
handle formatting the plain text for even complex scripts like Arabic
or Tibetan.

Emacs will eventually have such support (when compiled with m17n and
libotf), but it does not yet.  Until then, a bit of elisp can output a
given buffer to a script in eg perl or python -- or a compiled C, C++
or similar program -- which uses pangocairo to create a ps or pdf file
to submit to lp or lpr.  (call-process-region) is the elisp function to
call, using (point-min) and (point-max) as the first two args, to send
the buffer's contents to the external program or script.

You could also try going through CJKlatex, or if in a gui saving the
buffer and using something like gedit or firefox to view the file; both
of those (if using the current versions) use pango and cairo to output
ps or pdf for printing.

If you want to do it directly from emacs, you will need to write some
code.  If you don't mind using another gui program, reasonably current
versions of web browsers and the default gnome/kde text editors should
as well.  (The latter may be painful for editing, but you'd only need
to load the file and select print from the menu....)

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6




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

* Re: Chinese characters missing in .ps output file
       [not found]             ` <mailman.3297.1230070986.26697.help-gnu-emacs@gnu.org>
@ 2008-12-24 19:15               ` Rodolfo Medina
  0 siblings, 0 replies; 10+ messages in thread
From: Rodolfo Medina @ 2008-12-24 19:15 UTC (permalink / raw)
  To: help-gnu-emacs

Rodolfo Medina <rodolfo.medina@gmail.com> writes:

> With Emacs, I correctly open a file including chinese characters.  The
> characters are correctly displayed in the text file, but when I try to create
> the ps file, with `C-u M-x pr-ps-print-buffer-preview' or `C-u M-x
> pr-ps-print-buffer-print', they are not displayed.
>
> What am I missing, how can I work it out?


James Cloos <cloos@jhcloos.com> writes:

> The real answer for how to obtain ps or pdf from text supporting all of
> unicode is to use libraries like cairo and pango.  Cairo knows how to
> embed all of the typical outline fonts in both ps and pdf, and pango can
> handle formatting the plain text for even complex scripts like Arabic
> or Tibetan.
>
> Emacs will eventually have such support (when compiled with m17n and
> libotf), but it does not yet.  Until then, a bit of elisp can output a
> given buffer to a script in eg perl or python -- or a compiled C, C++
> or similar program -- which uses pangocairo to create a ps or pdf file
> to submit to lp or lpr.  (call-process-region) is the elisp function to
> call, using (point-min) and (point-max) as the first two args, to send
> the buffer's contents to the external program or script.
>
> You could also try going through CJKlatex, or if in a gui saving the
> buffer and using something like gedit or firefox to view the file; both
> of those (if using the current versions) use pango and cairo to output
> ps or pdf for printing.
>
> If you want to do it directly from emacs, you will need to write some
> code.  If you don't mind using another gui program, reasonably current
> versions of web browsers and the default gnome/kde text editors should
> as well.  (The latter may be painful for editing, but you'd only need
> to load the file and select print from the menu....)



Well, since I'm not able to write any code, I only have to wait for Emacs to
have the support you mention...

Rodolfo


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

end of thread, other threads:[~2008-12-24 19:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-20 15:49 Chinese characters missing in .ps output file Rodolfo Medina
2008-12-20 16:21 ` Peter Dyballa
     [not found] ` <mailman.3168.1229790102.26697.help-gnu-emacs@gnu.org>
2008-12-21 20:30   ` Rodolfo Medina
2008-12-21 20:25     ` Peter Dyballa
     [not found]     ` <mailman.3207.1229891161.26697.help-gnu-emacs@gnu.org>
2008-12-21 22:18       ` Rodolfo Medina
2008-12-21 22:20         ` Peter Dyballa
     [not found]         ` <mailman.3210.1229898011.26697.help-gnu-emacs@gnu.org>
2008-12-22 15:41           ` Rodolfo Medina
2008-12-22 20:22             ` Peter Dyballa
2008-12-23 22:22             ` James Cloos
     [not found]             ` <mailman.3297.1230070986.26697.help-gnu-emacs@gnu.org>
2008-12-24 19:15               ` Rodolfo Medina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).