[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Printing Arabic UTF-8 text
- To: developer at arabeyes dot org
- Subject: Printing Arabic UTF-8 text
- From: Nadim Shaikli <shaikli at yahoo dot com>
- Date: Sun, 2 Jun 2002 15:05:12 -0700 (PDT)
Salam all...
We have a couple of command-line printing options available now :-)
1. I've been fortune enough to patch the latest development version
of txtbdf2ps.pl in order to include both bidi and Arabic shaping.
http://oldrus-ispell.sourceforge.net/txtbdf2ps.html
I've contacted the author of txtbdf2ps.pl to include the code to
the main trunk so hopefully that will happen at some point.
In the meanwhile, you can download the script here,
http://www.arabeyes.org/cvsweb/projects/external/txtbdf2ps/txtbdf2ps.pl
Some common examples on how to use it,
# If you do have fribidi in your path
$ txtbdf2ps.pl -UTF-8
-bidi
-bdf=/PATH/PATH/PATH/10x20.bdf -text=arabic_file > output.ps
# If you don't have fribidi in your path
$ txtbdf2ps.pl -UTF-8
-fribidi=/PATH/PATH/fribidi
-bdf=/PATH/PATH/PATH/10x20.bdf -text=arabic_file > output.ps
Then simply print the output.ps postscript file
$ lpr output.ps
Enjoy :-)
2. After both Anas Nashif and Sherif Dessouki independently hinted at
looking at yudit's uniprint. I wanted to note this 'hack' eventhough
it really isn't a complete/clean solution (for a clean solution Yudit
will need to fully support unicode's Bidi algorithm -- help is needed
in making this (fribidi+yudit) happen !!)
NOTE: TrueType fonts promise better quality and versatility compared
to BDF.
+ Download yudit & compile/install it
http://www.yudit.org/
+ Download the Arabic shaping perl script (shape_arabic.pl)*
http://www.arabeyes.org/cvsweb/tools/shape_bidi/shape_arabic.pl
+ $ shape_arabic.pl -f arabic_file |
fribidi |
uniprint -font /path/path/courbd.ttf -out output.ps
(*) this perl script notes how easy Arabic shaping really is and ought
to serve as an example for those looking to learn perl.
NOTE: if you don't have a printer, you will still be able to see the
postscript output via a postscript viewer like 'ghostview'
Lastly, I would like to note that there aren't that many options out there
for printing UTF-8 encoded text from the command-line. 'a2ps' surprisingly
doesn't even support utf-8 which we should try to either modify and pressure
for. The lack of utf-8 support has and will continue to harm us and as such
I ask all to always lobby for it.
Enjoy and I make the same plea - your help is much needed, so get involved
and get to coding and producing results :-)
Salam...
- Nadim
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com