unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24724: 25.1; Arabic Printing Problem
  2016-10-18 16:21 bug#24724: 25.1; Arabic Printing Problem Waleed Yousef
@ 2016-10-18 15:07 ` Eli Zaretskii
  2016-10-18 17:17   ` Waleed Yousef
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-10-18 15:07 UTC (permalink / raw)
  To: Waleed Yousef; +Cc: 24724

> From: Waleed Yousef <wyousef@fcih.net>
> Date: Tue, 18 Oct 2016 16:21:45 +0000
> 
> When I write Arabic in Emacs buffer, it writes well. However, to print
> the buffer I use ps-spool-buffer, then save the buffer to tmp.ps then
> open using gs. However, the ps file has letters in revers order.

How does this work with other software which produces PostScript?
Does PostScript have a way to ask the printer to reorder the text? if
so, how?  Or is the program that generates PS supposed to reorder the
text?  In the latter case, we need to modify ps-print to do that.

> I use this in my .emacs:

Can you explain why and how this does the job?  Is there something
special in djvmono.bdf font?  Or am I missing the part that reorders
the bidirectional text?





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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-18 17:17   ` Waleed Yousef
@ 2016-10-18 15:44     ` Eli Zaretskii
  2016-10-18 18:16       ` Waleed Yousef
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-10-18 15:44 UTC (permalink / raw)
  To: Waleed Yousef; +Cc: 24724

> From: Waleed Yousef <wyousef@fcih.net>
> Cc: 24724@debbugs.gnu.org
> Date: Tue, 18 Oct 2016 17:17:04 +0000
> 
> I just want to be able to print Arabic buffers to pdf or to printer. I
> searched alot and then found the .emacs snippet that I included in my
> email. If there is another easier way that will be great.

So you are saying that djvmono.bdf font (or maybe BDF fonts in
general) make the bidirectional text look in the correct order, while
other fonts don't?  My guess would be that Ghostscript is reordering
the text, I see a bidi module in its sources.  So I think the key to
this puzzle is to use Ghostscript.





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

* bug#24724: 25.1; Arabic Printing Problem
@ 2016-10-18 16:21 Waleed Yousef
  2016-10-18 15:07 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Waleed Yousef @ 2016-10-18 16:21 UTC (permalink / raw)
  To: 24724


When I write Arabic in Emacs buffer, it writes well. However, to print
the buffer I use ps-spool-buffer, then save the buffer to tmp.ps then
open using gs. However, the ps file has letters in revers order. I use
this in my .emacs:

(require 'ps-print)
 (eval-after-load 'ps-print
  '(progn
     (require 'ps-mule)
     (setq ps-multibyte-buffer 'bdf-font) ;; print everything with bdf
     (setq ps-font-size 10) ;; change according your tastes
     (setq bdf-directory-list '("/usr/share/fonts/MyBDF"))
     (setq ps-mule-font-info-database-bdf
	   '((unicode-bmp  ; everything in the world should be printed with this font
	      (normal bdf "djvmono.bdf")
	      (bold bdf "djvmono-b.bdf")
	      (italic bdf "djvmono-o.bdf")
	      (bold-italic bdf "djvmono-bo.bdf"))
	     (iso-8859-1   ; please, latin-1 TOO, I said everything!
	      (normal bdf "djvmono.bdf")
	      (bold bdf "djvmono-b.bdf")
	      (italic bdf "djvmono-o.bdf")
	      (bold-italic bdf "djvmono-bo.bdf"))))))




In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9)
 of 2016-09-18 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe
 -fstack-protector-strong' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  openwith-mode: t
  dired-async-mode: t
  ido-grid-mode: t
  ido-everywhere: t
  shell-dirtrack-mode: t
  pdf-occur-global-minor-mode: t
  delete-selection-mode: t
  override-global-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  smartparens-global-mode: t
  smartparens-global-strict-mode: t
  smartparens-strict-mode: t
  smartparens-mode: t
  show-paren-mode: t
  guide-key-mode: t
  winner-mode: t
  image-diredx-async-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Saving file /home/wyousef/.emacs...
Wrote /home/wyousef/.emacs
Formatting...done
File ‘~/Downloads/tmp.ps’ exists; overwrite? (y or n) y
A buffer is visiting /home/wyousef/Downloads/tmp.ps; proceed? (y or n) y
Type C-c C-c to toggle between editing or viewing the document.
Saving file /home/wyousef/Downloads/tmp.ps...
Wrote /home/wyousef/Downloads/tmp.ps
C-x C-g is undefined
Quit

Load-path shadows:
~/.emacs.d/loadpath/ps-mule hides /usr/share/emacs/25.1/lisp/ps-mule
~/.emacs.d/loadpath/subr-x hides /usr/share/emacs/25.1/lisp/emacs-lisp/subr-x

Features:
(shadow sort mail-extr emacsbug message idna rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils man align
tabify two-column iso-transl face-remap gnus-dired autorevert filenotify
pcmpl-unix em-unix em-term term disp-table ehelp em-script em-prompt
em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner
em-alias esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg
esh-groups eshell esh-module esh-mode esh-util doc-view subr-x ps-mode
smie ps-bdf flyspell ispell ace-window avy misearch multi-isearch
sage-view sage-mode apropos sage-compat tramp-cache
python-el-fgallina-expansions smartparens-python python tramp-sh json
map sage sage-load reftex reftex-vars magic-latex-buffer iimage
smartparens-latex tex-mode dired-tar openwith dired-async async dired+
image-file dired-x dired-aux ido-grid-mode ido bbdb bbdb-site timezone
impatient-mode htmlize cl simple-httpd url-util bash-completion tramp
tramp-compat tramp-loaddefs trampver shell pcomplete eimp warnings
ps-mule ps-print ps-def lpr pdftools pdf-occur ibuf-ext ibuffer tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local find-func cedet
pdf-isearch let-alist pdf-misc imenu pdf-tools compile comint ansi-color
cus-edit cus-start cus-load wid-edit pdf-view bookmark pp jka-compr
pdf-cache pdf-info tq pdf-util image-mode delsel ffap url-parse
auth-source eieio eieio-core cl-macs gnus-util mm-util help-fns
mail-prsvr password-cache url-vars expand-region text-mode-expansions
er-basic-expansions expand-region-core expand-region-custom bind-key
easy-mmode smartparens-config smartparens thingatpt paren guide-key s
ucs-normalize popwin dash re-builder smart-mode-line-dark-theme
smart-mode-line-light-theme cl-seq smart-mode-line rich-minority
faff-theme winner ring edmacro kmacro finder-inf tex-site
bash-completion-autoloads bbdb--autoloads bbdb-csv-import-autoloads
image-dired+ image-dired format-spec dired advice log4e-autoloads
openwith-autoloads pcsv-autoloads professional-theme-autoloads rx
w3-autoloads info package epg-config seq byte-opt gv bytecomp
byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 498762 33596)
 (symbols 48 44593 0)
 (miscs 40 1114 1007)
 (strings 32 105615 16866)
 (string-bytes 1 3339653)
 (vectors 16 68923)
 (vector-slots 8 2071717 198621)
 (floats 8 719 996)
 (intervals 56 6938 867)
 (buffers 976 47))





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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-18 15:07 ` Eli Zaretskii
@ 2016-10-18 17:17   ` Waleed Yousef
  2016-10-18 15:44     ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Waleed Yousef @ 2016-10-18 17:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24724


Ok, thanks so much for your fast reply.

I just want to be able to print Arabic buffers to pdf or to printer. I
searched alot and then found the .emacs snippet that I included in my
email. If there is another easier way that will be great.

Regarding printing from other software, yes I am able to print, e.g.,
from Libreoffice. However, I did not try others.

Thanks and looking forward.



Eli Zaretskii <eliz@gnu.org> writes:

>> From: Waleed Yousef <wyousef@fcih.net>
>> Date: Tue, 18 Oct 2016 16:21:45 +0000
>> 
>> When I write Arabic in Emacs buffer, it writes well. However, to print
>> the buffer I use ps-spool-buffer, then save the buffer to tmp.ps then
>> open using gs. However, the ps file has letters in revers order.
>
> How does this work with other software which produces PostScript?
> Does PostScript have a way to ask the printer to reorder the text? if
> so, how?  Or is the program that generates PS supposed to reorder the
> text?  In the latter case, we need to modify ps-print to do that.
>
>> I use this in my .emacs:
>
> Can you explain why and how this does the job?  Is there something
> special in djvmono.bdf font?  Or am I missing the part that reorders
> the bidirectional text?





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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-18 15:44     ` Eli Zaretskii
@ 2016-10-18 18:16       ` Waleed Yousef
  2016-10-18 19:43         ` Waleed Yousef
  0 siblings, 1 reply; 11+ messages in thread
From: Waleed Yousef @ 2016-10-18 18:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24724


Sorry I did not say that; I just said when I write in libreoffice, I can
print well.

When I write Arabic in emacs, the buffer looks great. However, when I
spool to ps and open this ps using Ghostscript the letters are
reversed. Another clue is this: when I run ps2pdf to the ps file it
fails converting.



Eli Zaretskii <eliz@gnu.org> writes:

>> From: Waleed Yousef <wyousef@fcih.net>
>> Cc: 24724@debbugs.gnu.org
>> Date: Tue, 18 Oct 2016 17:17:04 +0000
>> 
>> I just want to be able to print Arabic buffers to pdf or to printer. I
>> searched alot and then found the .emacs snippet that I included in my
>> email. If there is another easier way that will be great.
>
> So you are saying that djvmono.bdf font (or maybe BDF fonts in
> general) make the bidirectional text look in the correct order, while
> other fonts don't?  My guess would be that Ghostscript is reordering
> the text, I see a bidi module in its sources.  So I think the key to
> this puzzle is to use Ghostscript.





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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-18 18:16       ` Waleed Yousef
@ 2016-10-18 19:43         ` Waleed Yousef
  2016-10-19  6:10           ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Waleed Yousef @ 2016-10-18 19:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24724

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

I reread your reply; it seems that I misunderstood you.

However, I think we have two possibilties: either the ps file is produced
in reverse character order or the gs program renders it this way.

On Oct 18, 2016 6:13 PM, "Waleed Yousef" <wyousef@fcih.net> wrote:

>
> Sorry I did not say that; I just said when I write in libreoffice, I can
> print well.
>
> When I write Arabic in emacs, the buffer looks great. However, when I
> spool to ps and open this ps using Ghostscript the letters are
> reversed. Another clue is this: when I run ps2pdf to the ps file it
> fails converting.
>
>
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Waleed Yousef <wyousef@fcih.net>
> >> Cc: 24724@debbugs.gnu.org
> >> Date: Tue, 18 Oct 2016 17:17:04 +0000
> >>
> >> I just want to be able to print Arabic buffers to pdf or to printer. I
> >> searched alot and then found the .emacs snippet that I included in my
> >> email. If there is another easier way that will be great.
> >
> > So you are saying that djvmono.bdf font (or maybe BDF fonts in
> > general) make the bidirectional text look in the correct order, while
> > other fonts don't?  My guess would be that Ghostscript is reordering
> > the text, I see a bidi module in its sources.  So I think the key to
> > this puzzle is to use Ghostscript.
>

[-- Attachment #2: Type: text/html, Size: 1869 bytes --]

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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-18 19:43         ` Waleed Yousef
@ 2016-10-19  6:10           ` Eli Zaretskii
  2016-10-20 18:41             ` Waleed Yousef
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-10-19  6:10 UTC (permalink / raw)
  To: Waleed Yousef; +Cc: 24724

> From: Waleed Yousef <wyousef@fcih.net>
> Date: Tue, 18 Oct 2016 19:43:09 +0000
> Cc: 24724@debbugs.gnu.org
> 
> However, I think we have two possibilties: either the ps file is produced in reverse character order or the gs
> program renders it this way.

That is my conclusion, yes.





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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-19  6:10           ` Eli Zaretskii
@ 2016-10-20 18:41             ` Waleed Yousef
  2016-10-20 19:28               ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Waleed Yousef @ 2016-10-20 18:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24724

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

So, could you direct me please. I tried manythings and searched alot. Any
advice?

On Oct 19, 2016 8:10 AM, "Eli Zaretskii" <eliz@gnu.org> wrote:

> > From: Waleed Yousef <wyousef@fcih.net>
> > Date: Tue, 18 Oct 2016 19:43:09 +0000
> > Cc: 24724@debbugs.gnu.org
> >
> > However, I think we have two possibilties: either the ps file is
> produced in reverse character order or the gs
> > program renders it this way.
>
> That is my conclusion, yes.
>

[-- Attachment #2: Type: text/html, Size: 847 bytes --]

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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-20 18:41             ` Waleed Yousef
@ 2016-10-20 19:28               ` Eli Zaretskii
  2019-11-08  2:41                 ` Stefan Kangas
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-10-20 19:28 UTC (permalink / raw)
  To: Waleed Yousef; +Cc: 24724

> From: Waleed Yousef <wyousef@fcih.net>
> Date: Thu, 20 Oct 2016 18:41:18 +0000
> Cc: 24724@debbugs.gnu.org
> 
> So, could you direct me please. I tried manythings and searched alot. Any advice?

The only viable option right now is to use a new enough version of
Ghostript, I think.





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

* bug#24724: 25.1; Arabic Printing Problem
  2016-10-20 19:28               ` Eli Zaretskii
@ 2019-11-08  2:41                 ` Stefan Kangas
  2019-11-08 10:21                   ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kangas @ 2019-11-08  2:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24724, Waleed Yousef

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Waleed Yousef <wyousef@fcih.net>
>> Date: Thu, 20 Oct 2016 18:41:18 +0000
>> Cc: 24724@debbugs.gnu.org
>> 
>> So, could you direct me please. I tried manythings and searched alot. Any advice?
>
> The only viable option right now is to use a new enough version of
> Ghostript, I think.

If I read this thread correctly, the solution here is to use a recent
version of GhostScript.  In other words, this is not a bug in Emacs.

Or is there anything else to do here?

Best regards,
Stefan Kangas





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

* bug#24724: 25.1; Arabic Printing Problem
  2019-11-08  2:41                 ` Stefan Kangas
@ 2019-11-08 10:21                   ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2019-11-08 10:21 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 24724, wyousef

> From: Stefan Kangas <stefan@marxist.se>
> Cc: Waleed Yousef <wyousef@fcih.net>,  24724@debbugs.gnu.org
> Date: Fri, 08 Nov 2019 03:41:35 +0100
> 
> If I read this thread correctly, the solution here is to use a recent
> version of GhostScript.  In other words, this is not a bug in Emacs.
> 
> Or is there anything else to do here?

It might be a missing feature, if PostScript supports commands to tell
the printer to reorder text.  But I don't know enough about PostScript
to tell whether this is so, and I never saw any PostScript output from
any program that prints R2L script, so I have no idea how this is done
by programs, Like LibreOffice, which reportedly do support printing of
such text.

If someone knows about that, I'm all ears.





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

end of thread, other threads:[~2019-11-08 10:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-18 16:21 bug#24724: 25.1; Arabic Printing Problem Waleed Yousef
2016-10-18 15:07 ` Eli Zaretskii
2016-10-18 17:17   ` Waleed Yousef
2016-10-18 15:44     ` Eli Zaretskii
2016-10-18 18:16       ` Waleed Yousef
2016-10-18 19:43         ` Waleed Yousef
2016-10-19  6:10           ` Eli Zaretskii
2016-10-20 18:41             ` Waleed Yousef
2016-10-20 19:28               ` Eli Zaretskii
2019-11-08  2:41                 ` Stefan Kangas
2019-11-08 10:21                   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

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