Changes

Jump to navigation Jump to search
438 bytes added ,  00:41, 19 January 2006
should be readable now. I'm tired.
by Prof. Idris Samawi Hamid
 
< [[Aleph]] | [[Arabian and Hebrew]] >
==Introduction==
[[Aleph ]] is a typesetting engine derived from Omega and eTeX. Reasons for Aleph:
# ConTeXt depends on the eTeX extensions, and even LaTeX now defaults to pdfeTeX.
''Aleph'', inheriting from ''Omega'', provides many ready-to-go filters, using a Times Roman like font for Latin, Greek, and Cyrillic scripts.
The ConTeXt module for this setup is called ''Gamma'' ([[source:m-gamma.tex|m-gamma.tex]]); this is a port of the ''Lambda'' (i.e., LaTeX) style files to ConTeXt. The font typescript is called type-omg.
==Installing==
* Some configuration points:
** Make sure you have the following line in <tt>texexec.ini</tt> set to "true": "<code>set UseEnginePath to true</code>"
** In <tt>texmf-local\web2c\texmf.cnf</tt>, <tt>texmf-local\web2c\context.cnf</tt>, and <tt>texmf\web2c\texmf.cnf</tt>comment this line as follows
<texcode>%extra_mem_bot.context = 2000000</texcode>
otherwise Aleph will crash under some conditions, like overfull boxes and the like...
The [[XeTeX]] developer found the source to this bug, and a fix; hopefully Giuseppe will get to it :-))
a* Get the omega support files [http://www.ctan.org/get?fn=/systems/win32/fptex/0.7/package/omega.zip omega.zip] and [http://www.ctan.org/get?fn=/systems/win32/fptex/0.7/package/omegafonts.zip omegafonts.zip]. Make sure you have the following line in
ConTeXt\tex\* Get rid of two directories from omega.zip (not really necessary but if you want to be efficient): <tt>texmf-local\context\config\texexec.ini/eomega</tt> and <tt>texmf/omega/encodings</tt>
set to "true", viz* Put support files in <tt>texmf-local</tt>.,
set UseEnginePath to true* Compile the Aleph format:
b. In texmf-local\web2c\texmf.cnf,texmf-local\web2c\context.cnf, andtexmf\web2c\texmf.cnf, comment this line as follows %extra_mem_bot.context = 2000000 otherwise aleph will crash under some conditions, like overfull boxes and the like... The XeTeX developer found the source to this bug, and a fix; hopefully Giuseppe will get to it-)) 3. Get the omega support files: http://www.ctan.org/get?fn=/systems/win32/fptex/0.7/package/omega.ziphttp://www.ctan.org/get?fn=/systems/win32/fptex/0.7/package/omegafonts.zip 4. Get rid of the following directories from omega.zip (not really necessary but if u want to beefficient): texmf/eomegatexmf/omega/encodings 5. Put support files in texmf-local; 6. Compile the Aleph format:  mktexlsr texexec --make en -tex=aleph 7. Here is a test file. Note the preamble
* Here is a test file. Note the preamble
<texcode>
% tex=aleph output=dvipdfmx
</texcode>
at the beginning of every Aleph file.
at the beginning of every aleph file. '''===omarb.tex'''===
<texcode>
% tex=aleph output=dvipdfmx
\usemodule[gamma] % or \input m-gamma.tex
\input type-omg.tex
</texcode>
8. * For Arabic script you will probably want to use an [[Encodings_and_Regimes|encoding ]] that supports direct Arabic-script editing. There are three: utf-8, iso-8859-6 (apple-unixApple/Unix), and cp1256 (micro$oftMicrosoft). We can define the following, using ConTeXt macros for managing filter sequences. Maybe I will add these to [[source:m-gamma -tex|m-gamma]] and ask Hans to distribute. In the meantime, here are some definitions, samples of all three encodings, and an example of mixed lr-rl text: {{todo|the Unicode characters got mixed up in the mail, please fix it, Idris!}}
'''===m-arabic-enc.tex'''===
<texcode>
% tex=aleph output=dvipdfmx
%\usemodule[gamma] \input m-gamma.tex%\input type-omg.tex
\usetypescriptfile[type-omg]
\usetypescript[OmegaArab]
==Going beyond==
The last example shows how to make and apply your own filter sequences beyond the basic Gamma module. To go further u you need to learn some low-level business. You will also need some working utilities. I have put together a windows package that you can unzip to <tt>C:\ConTeXt</tt>. These utilities do work, but they are cobbled together from old fpTeX and MiKTeX versions. just place  {{todo|store the tree in C:\ConTeXt\utilities on the wiki server and link to them}}
1. ===Example: If you want to get the final Persian kaaf instead of the default Arabic one:===
Check to see if your glyph is in the Arabic font. The Arabic font is made of 6 raw fonts: 3 regular and three bold:
 C:\ConTeXt\tex\ texmf-local\/fonts\/type1\/public\/omega  omsea1, omsea1b,...omsea3b
Using a font viewer or editor you will find the Persian final kaaf in omsea2, named kafswashfin.
Now go to
 C:\ConTeXt\tex\<tt>texmf-local\/omega\/lambda\/misc</tt>
and open
 <tt>omarab.cfg</tt>
you will find a line
04AA N kafswashfin
This means that the 044A is the virtual font position for kafswashfin. Open cuni2oar.otp and add the following at line 263:
%@"E343 => @"04AA;
Following this line you should see
% remaining Arabic glyphs @"E000-@"E3FF => #(\1 - @"DF00);
Basically, in uni2cuni.otp final-kaaf gets mapped to E343. In the font, we want it mapped to kafswashfin, so we did that. Now recompile the otp:
otp2ocp cuni2oar
Now you will get kafswashfin for the final kaaf.
2. ===Want new fonts (Arabic or Latin). Here are the instructions: 1. Read the following two papers carefully again and again; they are your friends:-) http://omega.enstb.org/papers/tsukuba-methods97.pdfhttp://omega.enstb.org/papers/ridt-omega98.pdf 2. Make a pfb file containing the glyphs you need, or use an existing font 3.Make a cfg file a la texmf\omega\lambda\misc\omlgc.cfg Make sure u list your glyph positions in hexadecimal notation. 5. Get the following from an old TeXLive distro: \support\makeovp.zip, containing makeovp.pl. There is a SH file with a sample of its use using omlgc.===
4* Read the following two papers carefully again and again; they are your friends :-)** [http://omega.enstb.org/papers/tsukuba-methods97.pdf tsukuba-methods]** [http://omega.enstb.org/papers/ridt-omega98.pdf ridt-omega]* Make a pfb file containing the glyphs you need, or use an existing font* Make a cfg file a la <tt>texmf\omega\lambda\misc\omlgc.cfg</tt>. Make sure you list your glyph positions in hexadecimal notation.* Get the following from an old TeXLive distro: <tt>\support\makeovp.zip</tt>, containing <tt>makeovp.pl</tt>. There is a SH file with a sample of its use using omlgc.* Following are instructions for cooking omarab.ovf. ** You want your own ovf, say, omlgcch.ovf (<ch> for <cherokee>). ** Generate an afm file for your private glyph pfb/pfa plus the afm files that are listed in the SH file (base files for omlgc found in <tt>\texmf\fonts\afm\public\omega </tt>)** Using the instructions below and the SH file ('''ignore''' the kernings.afm file!)you can figure out how to make your own ovp and ovf.** Before making the ovf file, examine the ovp file created, especially the first few lines, to see how the font-metric info from the afm's are concatenated. Very instructive.* Don't forget the rest of the accounting:** adding lines to a map file and pointing dvips/dvipdfm to it;** create a typescript file;** edit your otp's. If you get stuck be sure to read [http://omega.enstb.org/papers/tsukuba-arabic97.pdf tsukuba-arabic]
Using the instructions below and the SH file (IGNORE the kernings====How to cook omarab.afmovf====file!) you can figure out how to make your own ovp and ovfIngredients: omarab. Beforemaking the ovf filecfg, examine the ovp file createdomseco.afm, especially thefirst few linesomsea1.afm, to see how the font-metric info from the omsea2.afm's areconcatenated. Very instructive, omsea3.afm
6 #perl makeovp. Don't forget the rest of the accounting:pl omarab.cfg omseco.afm omsea1.afm omsea2.afm omsea3.afm omarab.ovp #pltotf omseco.pl omseco.tfm #pltotf omsea1.pl omsea1.tfm #pltotf omsea2.pl omsea2.tfm #pltotf omsea3.pl omsea3.tfm #ovp2ovf omarab.ovp omarab.ovf omarab.ofm
a) adding lines to a map file and pointing dvips/dvipdfm to it;b) create a typescript file;c) edit your otp's. If u get stuck be sure to readthe last line does not work, try
http://omega #ovp2ovf omarab.enstbovp omarab.org/papers/tsukuba-arabic97ovf omarab.pdftfm
<code>[How to cook rename omarab.ovf:][Ingredients: tfm to omarab.cfg, omseco.afm, omsea1.afm, omsea2.afm, omsea3.afm]ofm --> ofm directory
#perl makeovp.pl ====How to distill omarab.cfg omseco.afm omsea1.afm omsea2.afm omsea3.afm ovp from omarab.ovf:====Use a different directory or a different name for the output ovp#pltotf omseco.pl omseco.tfm#pltotf omsea1.pl omsea1.tfm#pltotf omsea2.pl omsea2.tfm#pltotf omsea3.pl omsea3.tfm#ovp2ovf so that omarab.ovp omarab.ovf omarabcreated above is not overwritten.ofm
[If the last line does not work, try#ovp2ovf get omarab.ovp omarab.ovf omarab.tfmofm & rename to omarab.tfm to omarab.ofm ===> ofm directory]
-----------------------------[How to distill #ovf2ovp omarab.ovp from ovf omarab.tfm omarab.ovf:]ovp
[Use a different directory or a different name for====How to cook omarabb.ovf====the output ovp so that Ingredients: omarab.ovp created above is not overwritten]cfg, omsecob.afm, omsea1b.afm, omsea2b.afm, omsea3b.afm
[get #perl makeovp.pl omarab.ofm & rename to omarabcfg omsecob.afm omsea1b.afm omsea2b.afm omsea3b.afm omarabb.ovp #pltotf omsecob.pl omsecob.tfm #pltotf omsea1b.pl omsea1b.tfm #pltotf omsea2b.pl omsea2b.tfm #pltotf omsea3b.pl omsea3b.tfm] #ovp2ovf omarabb.ovp omarabb.ovf omarabb.ofm
#ovf2ovp omarab.ovf omarab.tfm omarab.ovp
=========================================================
[How to cook omarabb.ovf:]
[Ingredients: omarab.cfg, omsecob.afm, omsea1b.afm, omsea2b.afm, omsea3b.afm]
#perl makeovp.pl omarab.cfg omsecob.afm omsea1b.afm omsea2b.afm omsea3b.afm omarabb.ovp#pltotf omsecob.pl omsecob.tfm#pltotf omsea1b.pl omsea1b.tfm#pltotf omsea2b.pl omsea2b.tfm#pltotf omsea3b.pl omsea3b.tfm#ovp2ovf omarabb.ovp omarabb.ovf omarabb.ofmIf the last line does not work, try
[If the last line does not work, try #ovp2ovf omarabb.ovp omarabb.ovf omarabb.tfmrename omarab.tfm to omarab.ofm ===> ofm directory]-----------------------------[How to distill omarabb.ovp from omarabb.ovf:]
[Use a different rename omarab.tfm to omarab.ofm --> ofm directory or a different name forthe output ovp so that omarabb.ovp created above is not overwritten]
[get omarab====How to distill omarabb.ofm & rename to omarabovp from omarabb.ovf====Use a different directory or a different name for the output ovp so that omarabb.tfm]ovp created above is not overwritten
#ovf2ovp omarabbget omarab.ovf omarabbofm & rename to omarab.tfm omarabb.ovp</code>
3 #ovf2ovp omarabb. For more info, there is also the (mostly cryptic) Omega manual [http://omegaovf omarabb.enstbtfm omarabb.org/roadmap/doc-1.12.ps in PS-Format]. Don't ask me why it's not in PDF. <tt>:-(</tt>ovp
* For more info, there is also the (mostly cryptic) Omega manual [http://omega.enstb.org/roadmap/doc-1.12.ps in PS-Format]. Don't ask me why it's not in PDF. <tt>:-(</tt>See also [http://omega.enstb.org/papers/tsukuba-arabic97.pdftsukuba-arabic]
==Miscellaneous==
# * Some people have gotten large OpenType fonts to work in Aleph/Omega. Probably they used [http://fontforge.sourceforge.net FontForge ] to convert to CFF-enriched type1. FF can produce ofm files (large tfms) so that's a help too.# * Me, I'm working on an advanced Arabic-script typesetting system that really pushes Aleph to the max. At present I don't actually use [[source:m-gamma.tex|m-gamma]], etc, but my own macros. I really hope to release something this year...#* See also [http://www.dtek.chalmers.se/~d97ost/omega-example.htmlOmega example]
==To the future==
# * The otp mechanism does not seem well suited to support, e.g., opentype GPOS tables, important for really advanced Arabic (though GDEF and GSUB should work fine with the present mechanism for most purposes). We need a better model for horizontal and vertical glyph substitutions.# * The low-level filtersequence mechanism needs to abstract language processing from font mapping. Right now both are hardwired into a single sequence, so setting up more than one font for a single language is more of a pain than it should be.# * The otp language is a bit cryptic. Hans has suggested switching otp's to a new language (like lua or io) but I don't know how hard that will be...# * One very important feature which may work better at the primitive/engine level by extending the pdfetex pdfeTeX engine:glyph substitution that depends on the paragraph. For example: In traditional Arabic typography, one way to compensate for "underfull" paragraphs is to substitute a "swash" version of a letter. Another way is bystretching the cursive tie between joining characters (which is already implemented in my own Arabicsystem). Combined with HZ we can get some pretty interesting high-level options, effects, etc. that the user can choose etc.

Navigation menu