SC UniPad – The Unicode Plain Text Editor

It was very nice for me to find “SC UniPad”. I had been wondering how to deal with Cyrillics using keyboard (Should I buy another keyboard merely for the input of Cyrillic letters?). “SC UniPad” provides virtual keyboards.

The wonderful thing is — UniPad is also able to convert Unicode characters into XML character reference, easily.
e.g. Меня зовут Тэцуя. (Меня зо вут Тэцуя.)
e.g. किताहाता तेतुया (किताहात ा तेतुया)

— ah, plus UniPad can convert them into UCN (\u…). Java engineers who should deal with “Resource Bundles” can reap the maximum fruit from it.
e.g. ىيتاﺦاثا (\u0649\u064a\u062a\u0627\ufea6\u0627\u062b\u0627)

I learned Russian/Hindi/Arabic etc… @ the university (more than 10 years ago). Perhaps, I will remember them.

HOWTO: Apache Forrest + Japanese (PDF rendering)

Feedbacks welcome. (tetsuya at apache dot org)

0. Download Apache Forrest 🙂

blah-blah … (run “forrest seed” whereever you want: /$PATH/$TO/ — edit/create xdocs/***.xml in japanese … etc. etc.)

1. Download Free Japanese Fonts (“Sazanami Fonts” might be the best). (1) (2)

2. Create Font-Metric Files (XML)
% java -cp $FORREST_HOME/lib/core/fop-0.20.5.jar org.apache.fop.fonts.apps.TTFReader /$PATH/$TO/sazanami-gothic.ttf /$PATH/$TO/sazanami-gothic.xml
% java -cp $FORREST_HOME/lib/core/fop-0.20.5.jar org.apache.fop.fonts.apps.TTFReader /$PATH/$TO/sazanami-mincho.ttf /$PATH/$TO/sazanami-mincho.xml
Note: You can download and use sazanami-gothic.xml and sazanami-mincho.xml if you use (1) and (2) above. If you download other font files or use Windows default fonts (MS-Mincho/MS-Gothic), you should create font-metric files equivalent for them by yourself.

3. Create new “userconfig.xml” file — e.g. /$PATH/$TO/font/userconfig.xml

<font metrics-file=”/$PATH/$TO/sazanami-gothic.xml” embed-file=”/$PATH/$TO/sazanami-gothic.ttf” kerning=”yes”>
<font-triplet name=”Gothic” style=”normal” weight=”normal”/>
<font-triplet name=”Gothic” style=”normal” weight=”bold”/>
<font-triplet name=”Gothic” style=”italic” weight=”normal”/>
<font-triplet name=”Gothic” style=”italic” weight=”bold”/>
<font metrics-file=”/$PATH/$TO/sazanami-mincho.xml” embed-file=”/$PATH/$TO/sazanami-mincho.ttf” kerning=”yes”>
<font-triplet name=”Mincho” style=”normal” weight=”normal”/>
<font-triplet name=”Mincho” style=”normal” weight=”bold”/>
<font-triplet name=”Mincho” style=”italic” weight=”normal”/>
<font-triplet name=”Mincho” style=”italic” weight=”bold”/>

4. Edit /$PATH/$TO/resources/conf/sitemap.xmap (“fo2pdf” section)
<map:serializer name=”fo2pdf” src=”org.apache.cocoon.serialization.FOPSerializer” mime-type=”application/pdf”>
<user-config src=”/$PATH/$TO/font/userconfig.xml”/>

Note: Apache Forrest 0.7 provides PLUGIN functionality, so perhaps you should do above for these 2 files

5. Change “Skin” config— edit $FORREST_HOME/main/webapp/skins/common/xslt/fo/document2fo.xsl
REPLACE: font-family=”serif” -> font-family=”Gothic”
REPLACE: font-family=”sans-serif” -> font-family=”Mincho”
REPLACE: <fo:root xmlns:fo=””&gt; into <fo:root xmlns:fo=”; language=”ja”>

6. Yell out! “Run Forrest! Run!” with girlish voice — 🙂
% cd /$PATH/$TO/
% forrest site