<?xml version="1.0"?>
<!DOCTYPE abiword PUBLIC "-//ABISOURCE//DTD AWML 1.0 Strict//EN" "http://www.abisource.com/awml.dtd">
<abiword xmlns:awml="http://www.abisource.com/awml.dtd" version="" fileformat="1.0">
<!-- =====================================================================  -->
<!-- This file is an AbiWord document.                                      -->
<!-- AbiWord is a free, Open Source word processor.                         -->
<!-- You may obtain more information about AbiWord at www.abisource.com     -->
<!-- You should not edit this file by hand.                                 -->
<!-- =====================================================================  -->

<pagesize pagetype="Letter" orientation="portrait" width="8.500000" height="11.000000" units="inch" page-scale="1.000000"/>
<section>
<p props="text-align:center"><c props="lang:en-US"></c></p>
<p props="text-align:center"></p>
<p props="text-align:center"><c props="lang:en-US; font-size:22pt; font-weight:bold">Using AbiWord on Unix with non-Latin1 Locales</c></p>
<p props="text-align:center"></p>
<p props="text-align:center"><c props="lang:en-US; font-size:14pt; font-weight:bold; font-style:italic">Tomas Frydrych &lt;tomas@frydrych.uklinux.net&gt;</c></p>
<p props="text-align:center"></p>
<p props="text-align:center"></p>
<p><c props="font-weight:bold; font-size:16pt">Contents</c></p>
<p><a xlink:href="#intro"><c props="font-weight:bold; font-size:14pt">1. Introduction</c></a></p>
<p><a xlink:href="#8-bit"><c props="font-weight:bold; font-size:14pt">2. 8-bit locales</c></a></p>
<p><c props="font-weight:bold; font-size:12pt">     </c><a xlink:href="#8-bit-fonts"><c props="font-weight:bold; font-size:12pt">2.1 Fonts</c></a></p>
<p><c props="font-weight:bold; font-size:12pt">     </c><a xlink:href="#8-bit-keyboard"><c props="font-weight:bold; font-size:12pt">2.2 Keyboard</c></a></p>
<p><a xlink:href="#utf-8"><c props="font-weight:bold; font-size:14pt">3. UTF-8 locale</c></a></p>
<p><c props="font-weight:bold; font-size:12pt">     </c><a xlink:href="#utf-8-fonts"><c props="font-weight:bold; font-size:12pt">3.1 Fonts</c></a></p>
<p><c props="font-weight:bold; font-size:12pt">     </c><a xlink:href="#utf-8-keyboard"><c props="font-weight:bold; font-size:12pt">3.2 Keyboard</c></a></p>
<p></p>
<p></p>
<p><bookmark type="start" name="intro"/><bookmark type="end" name="intro"/><c props="font-weight:bold; font-size:16pt">1. Introduction</c></p>
<p></p>
<p>AbiWord supports the standard localization mechanism using LANG and LC_ variables (if you are not familiar with this mechanism see `man locale' as well as the relevant Linux HOWTOs). It works  with both 8-bit locales and UTF-8 locale. However, if you are using locale different than Latin-1 (iso 8859-1) there are some things you will need to do to get correct behavior. Please note that this document does not contain instructions how to set up a particular locale on your machine, only things you will need to do to get AbiWord working under non-Latin-1 locales. (For general instructions on how to setup a particular locale on your computer, you should see the relevant Linux HOWTO.)</p>
<p></p>
<p>In the following a command prompt will be indicated by '#'.</p>
<p></p>
<p><bookmark type="start" name="8-bit"/><bookmark type="end" name="8-bit"/><c props="font-weight:bold; font-size:16pt">2. 8-bit locales</c></p>
<p><bookmark type="start" name="8-bit-fonts"/><bookmark type="end" name="8-bit-fonts"/><c props="font-weight:bold; font-size:14pt">2.1 Fonts</c></p>
<p>The default AbiWord locale is en_US. If you use a different, non-Latin-1 locale, you will need to provide your own fonts. AbiWord fonts should be located in <c props="font-style:italic">/usr/share/AbiSuite/fonts </c><c props="font-style:normal">or </c><c props="font-style:italic">/usr/local/AbiSuite/fonts</c> directory (unless you chose to install elsewhere, of course). You need to create a subdirectory in the fonts directory named according to your encoding. For instance if you are going to use Hebrew locale, you create a directory ISO-8859-8. <c props="font-weight:bold">The name of this directory has to correspond exactly to the encoding reported by your locale variables. </c>If you are using Bash, try</p>
<p></p>
<p><c props="font-weight:bold"># echo $LANG</c></p>
<p></p>
<p>You should see something like </p>
<p></p>
<p><c props="font-weight:bold"># he_IL.ISO-8859-8</c></p>
<p></p>
<p>It is important that the encoding (the part after the dot) is specified <c props="font-weight:bold">explicitly</c>, i.e., if you see something like</p>
<p></p>
<p><c props="font-weight:bold"># he_IL</c></p>
<p></p>
<p>it will not work. Setting the LANG variable prior to starting AbiWord is easy, in Bash you do something like</p>
<p></p>
<p><c props="font-weight:bold"># LANG=he_IL.ISO-8859-8</c></p>
<p><c props="font-weight:bold"># export $LANG</c></p>
<p></p>
<p>You do not have to make a system-wide modification of your $LANG setting, all that is needed is that the variable is set prior to running AbiWord. I personally use a short script to run Czech localization of AbiWord which I call <c props="font-style:italic">abicz</c><c props="font-style:normal"> and which looks something like this:</c></p>
<p></p>
<p><c props="font-weight:bold; font-style:normal">#!/bin/sh</c></p>
<p><c props="font-weight:bold; font-style:normal">LANG=cs_CZ.ISO-8859-2</c></p>
<p><c props="font-weight:bold; font-style:normal">export $LANG</c></p>
<p><c props="font-weight:bold; font-style:normal">abiword</c></p>
<p></p>
<p><c props="font-weight:normal; font-style:normal">This way I do not have to change my normal LANG setting, and do not have to remember modifying it manually when I want to run Czech localization of AbiWord.</c></p>
<p></p>
<p>But now back to the fonts; once you have created the locale specific directory, you put your fonts in it in the same manner you would install additional fonts into the main fonts directory; you will find instructions in the separate document <c props="font-style:italic">AbiWord_and_Unix_Fonts.zabw</c>.</p>
<p></p>
<p></p>
<p><bookmark type="start" name="8-bit-keyboard"/><bookmark type="end" name="8-bit-keyboard"/><c props="font-weight:bold; font-size:14pt">2.2 Keyboard</c></p>
<p>There are some keyboard issues to be taken care of as well, not because AbiWord would require something unusual, but because keyboard on non-Latin1 localizations of common Linux distributions is frequently set up incorrectly. You will find the details in the <c props="font-style:italic">Troubleshooting </c><c props="font-style:normal">section of </c><c props="font-style:italic">AbiWord_and_Unix_Fonts.zabw</c><c props="font-style:normal">.</c></p>
<p></p>
<p></p>
<p><bookmark type="start" name="utf-8"/><bookmark type="end" name="utf-8"/><c props="font-weight:bold; font-size:16pt">3. UTF-8 locale</c></p>
<p><bookmark type="start" name="utf-8-fonts"/><bookmark type="end" name="utf-8-fonts"/><c props="font-weight:bold; font-size:14pt">3.1 Fonts</c></p>
<p>To use UTF-8 locale with AbiWord, you will need to install Unicode fonts; AbiWord does not support font sets. In my experience, it is not possible to set up pfa/pfb font under XFree86 4 to behave as a Unicode font (if you find a way to register a pfa font with the server as a Unicode font, please let me know, so that I can update this document). Thus you will have to use TTF fonts only. <c props="font-family:Times New Roman; text-decoration:none; color:000000; font-size:12pt; text-position:normal; font-weight:normal; font-style:normal; lang:en-US">Otherwise, the general procedure is the same as for 8-bit locales, although it might be better installing the fonts directly into the font directory, rather than a subdirectory, replacing any AbiWord fonts, with your own. </c>You will find the procedure described in <c props="font-style:normal">the document </c><c props="font-style:italic">AbiWord_and_Unix_Fonts.zabw</c><c props="font-style:normal">. There are two important things to remember:</c></p>
<p></p>
<p><c props="font-weight:bold; font-style:normal">(1)</c><c props="font-style:normal"> your LANG has to specify utf-8 as the encoding, i.e., </c></p>
<p></p>
<p><c props="font-weight:bold; font-style:normal"># echo $LANG</c></p>
<p></p>
<p><c props="font-weight:normal; font-style:normal">should return something like</c></p>
<p></p>
<p><c props="font-weight:bold; font-style:normal"># en_GB.utf-8</c></p>
<p></p>
<p><c props="font-weight:normal; font-style:normal">If it does not, you need to modify $LANG along the lines described in section </c><a xlink:href="#8-bit-fonts"><c props="font-weight:normal; font-style:normal">2.1</c></a></p>
<p></p>
<p><c props="font-weight:bold">(2)</c><c props="font-weight:normal"> The encoding part of the fonts entry in </c><c props="font-style:italic; font-weight:normal">fonts.dir</c><c props="font-style:normal; font-weight:normal"> has to be be iso10646-1, e.g.,</c></p>
<p></p>
<p><c props="font-style:italic; font-weight:normal">arial.ttf   -monotype-Arial-medium-r-normal--0-0-0-0-p-0-</c><c props="font-weight:bold; font-style:italic">iso10646-1</c></p>
<p></p>
<p></p>
<p><bookmark type="start" name="utf-8-keyboard"/><bookmark type="end" name="utf-8-keyboard"/><c props="font-weight:bold; font-size:14pt">3.2 Keyboard</c></p>
<p>Under UTF-8 locale AbiWord uses the same keyboard handling mechanism that the UTF-8 enabled xterm does, and your keyboard can generate arbitrary Unicode values. The details of assigning these values to your keyboard are found in the <c props="font-style:italic">Troubleshooting </c><c props="font-style:normal">section of </c><c props="font-style:italic">AbiWord_and_Unix_Fonts.zabw</c><c props="font-style:normal">.</c></p>
</section>
</abiword>
