Difference between revisions 641638 and 646747 on dewikibooks

== Installation on Ubuntu ==
<small><pre>
 sudo apt-get install subversion ghc libghc6-regex-compat-dev libghc6-http-dev python3.2
 sudo apt-get install texlive-latex-extra texlive-fonts-extra librsvg2-bin imagemagick texlive-games
 sudo apt-get install texlive-fonts-recommended texlive-lang-cyrillic texlive-lang-greek arabtex texlive-science
 sudo apt-get install texlive-humanities python3.2-tk texlive-full libghc6-missingh-dev ttf-freefont cm-super
 sudo apt-get install libghc6-split-dev cabal-install libghc6-hxt-dev latex-cjk-all cm-super-minimal ttf-unifont
 sudo apt-get install ttf-wqy-zenhei python-fontforge ttf-mph-2b-damase
 cabal update
 svn co https://wb2pdf.svn.sourceforge.net/svnroot/wb2pdf@12291 wb2pdf 
 cd wb2pdf/trunk
 cabal install --global --root-cmd=sudo
 cd src
 python3.2 makelinuxbins.py
</pre></small>

If you get an error in the last step about <code>ghc: -rtsopts</code> you have to manually remove the <code>-rtsopts</code> in <code>makelinuxbins.py</code>. It is a problem that some versions of the ghc compiler require it and others don't allow it. Especially since different versions of Ubuntu are shipped with different versions of ghc. Currently I am testing my code with ghc version 7.2.2, but other version are very likely to work too.

You need combine unifont.ttf , FreeSerif.ttf and wqy-zenhei.ttc into one file called megafont.ttf and install it into the LaTeX tree. This is needed to allow for a full 16 Bit Unicode coverage, with good looking fonts where possible. This will take a long time, (I got 3 minutes on an Celeron G540)
<small><pre>
cd ../font/
sudo python3.2 installunifont.py
</pre></small>
Open: 
<small><pre>
sudo gedit /usr/share/texmf/web2c/texmf.cnf
</pre></small>
In the line starting with <code>TTFONTS</code> add:
<small><pre>
/usr/share/texmf-texlive/fonts/truetype//
</pre></small>
After adding the line looked like this on my system
<small><pre>
TTFONTS = .;$TEXMF/fonts/truetype//;$OSFONTDIR//;/usr/share/texmf-texlive/fonts/truetype//
</pre></small>


save and exit editor.
Open
<small><pre>
sudo gedit /usr/share/texmf-config/pdftex/config/pdftex.cfg 
</pre></small>
Add the lines (the file was initially emtpy or nonexsitant on my system):
<small><pre>
map +megafont.map
</pre></small>
save and exit editor. 
Open:
<small><pre>
sudo gedit /usr/share/texmf-texlive/fonts/map/ttf2pk/config/ttfonts.map
</pre></small>
Add the lines:
<small><pre>
megafont@Unicode@  megafont.ttf Pid = 3 Eid = 1
</pre></small>
save and exit editor. 
<small><pre>
sudo texhash 
</pre></small>
Finally run the programm.
<small><pre>
cd ../src/
python3.2 gui.py
</pre></small>