2002-09-01 21:37:00 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.7//EN" "/usr/GNUstep/System/Libraries/Resources/DTDs/gsdoc-0_6_6.dtd" >
|
|
|
|
<gsdoc base="LanguageSetup">
|
|
|
|
<head>
|
|
|
|
<title>Using Traditional Chinese and Other Languages</title>
|
|
|
|
<author name="Yen-Ju Chen">
|
|
|
|
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
|
|
|
|
</author>
|
2003-07-17 03:24:27 +00:00
|
|
|
<author name="Kazunobu Kuriyama">
|
|
|
|
</author>
|
2002-09-01 21:37:00 +00:00
|
|
|
<version>$Revision$</version>
|
|
|
|
<date>$Date$</date>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<chapter>
|
|
|
|
<heading>Using Traditional Chinese and Other Languages</heading>
|
2003-07-17 03:24:27 +00:00
|
|
|
<p>This brief article illustrates how to set up your GNUstep for
|
|
|
|
the East Asian languages known as CJK (Chinese, Japanese, and
|
|
|
|
Korean) in literature. We assume that you already know how to
|
|
|
|
set up your X Window System for your language environment such
|
|
|
|
as locale, fonts, and input methods. We also assume that you
|
|
|
|
selected 'art' as the backend of GNUstep's GUI.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>Like other computer software made outside the region, GNUstep
|
|
|
|
requires some adjustment to use those languages. The adjustment
|
|
|
|
consists of the following steps:
|
|
|
|
</p>
|
|
|
|
<enum>
|
|
|
|
<item>
|
|
|
|
Prepare one or more true type font files which contain characters
|
|
|
|
of your native language, and organize them in a certain way so that
|
|
|
|
the art backend can use them.
|
|
|
|
</item>
|
|
|
|
<item>
|
|
|
|
Set the environmental variable GNUSTEP_STRING_ENCODING to an
|
|
|
|
appropriate value for the language in use.
|
|
|
|
</item>
|
|
|
|
<item>
|
|
|
|
Set the NSGlobalDomain variables such as NSFont, NSFontSize,
|
|
|
|
and NSUserFont, to name a few, to appropriate values using the
|
|
|
|
GNUstep's utility 'defaults'.
|
|
|
|
</item>
|
|
|
|
</enum>
|
|
|
|
|
|
|
|
<p>Now we explain each step in detail.</p>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<heading>Fonts</heading>
|
|
|
|
|
|
|
|
<p>The art backend expects font files to be found in the
|
|
|
|
specified directories, such as
|
|
|
|
<file>$GNUSTEP_USER_ROOT/Library/Fonts</file> and
|
|
|
|
<file>$GNUSTEP_SYSTEM_ROOT/Library/Fonts</file>. You need to
|
|
|
|
organize font files in a certain way so that the art
|
|
|
|
backend can recognize them.</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Check out these documents about installation and usage of nfonts:
|
|
|
|
<uref url="http://wiki.gnustep.org/index.php/back-art%20Installation">
|
|
|
|
back-art Installation</uref>,
|
|
|
|
<uref url=
|
|
|
|
"http://wiki.gnustep.org/index.php/nfont%20packages">nfont
|
|
|
|
package</uref>.</p>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<heading>Encoding</heading>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
By default, GNUstep assumes that a character is encoded in
|
|
|
|
ISO8859-1 unless the escape character \u precedes it (This
|
|
|
|
exception applies to other encodings). Hence, if you want to
|
|
|
|
use the characters of your native language with GNUstep, you
|
|
|
|
have to tell it which encoding you use. This can be done by
|
|
|
|
setting the environmental variable GNUSTEP_STRING_ENCODING to an
|
|
|
|
appropriate value.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>Some possible values for GNUSTEP_STRING_ENCODING are as follows:</p>
|
|
|
|
<list>
|
|
|
|
<item>NSJapaneseEUCStringEncoding // Japanese</item>
|
|
|
|
<item>NSUTF8StringEncoding</item>
|
|
|
|
<item>NSISOLatin1StringEncoding // ISO-8859-1; West European</item>
|
|
|
|
<item>NSShiftJISStringEncoding // Japanese</item>
|
|
|
|
<item>NSISOLatin2StringEncoding // ISO-8859-2; East European</item>
|
|
|
|
<item>NSUnicodeStringEncoding</item>
|
|
|
|
<item>NSWindowsCP1251StringEncoding</item>
|
|
|
|
<item>NSWindowsCP1252StringEncoding // WinLatin1</item>
|
|
|
|
<item>NSWindowsCP1253StringEncoding // Greek</item>
|
|
|
|
<item>NSWindowsCP1254StringEncoding // Turkish</item>
|
|
|
|
<item>NSWindowsCP1250StringEncoding // WinLatin2</item>
|
|
|
|
<item>NSISO2022JPStringEncoding // Japanese</item>
|
|
|
|
<item>NSMacOSRomanStringEncoding</item>
|
|
|
|
<item>NSKOI8RStringEncoding // Russian/Cyrillic</item>
|
|
|
|
<item>NSISOLatin3StringEncoding // ISO-8859-3; South European</item>
|
|
|
|
<item>NSISOLatin4StringEncoding // ISO-8859-4; North European</item>
|
|
|
|
<item>NSISOCyrillicStringEncoding // ISO-8859-5</item>
|
|
|
|
<item>NSISOArabicStringEncoding // ISO-8859-6</item>
|
|
|
|
<item>NSISOGreekStringEncoding // ISO-8859-7</item>
|
|
|
|
<item>NSISOHebrewStringEncoding // ISO-8859-8</item>
|
|
|
|
<item>NSISOLatin5StringEncoding // ISO-8859-9; Turkish</item>
|
|
|
|
<item>NSISOLatin6StringEncoding // ISO-8859-10; Nordic</item>
|
|
|
|
<item>NSISOThaiStringEncoding // ISO-8859-11</item>
|
|
|
|
<item>NSISOLatin7StringEncoding // ISO-8859-13</item>
|
|
|
|
<item>NSISOLatin8StringEncoding // ISO-8859-14</item>
|
|
|
|
<item>NSISOLatin9StringEncoding // ISO-8859-15; Replaces ISOLatin1</item>
|
|
|
|
<item>NSGB2312StringEncoding</item>
|
|
|
|
<item>NSUTF7StringEncoding // RFC 2152</item>
|
|
|
|
<item>NSGSM0338StringEncoding // GSM (mobile phone) default alphabet</item>
|
|
|
|
<item>NSBIG5StringEncoding // Traditional chinese</item>
|
|
|
|
</list>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Of these values, choose an appropriate one for your purpose and
|
|
|
|
set the environmental variable to it. For example, for sh or
|
|
|
|
bash,
|
|
|
|
</p>
|
|
|
|
<example>
|
|
|
|
export GNUSTEP_STRING_ENCODING=NSBIG5StringEncoding
|
|
|
|
</example>
|
|
|
|
|
|
|
|
<p>or, for csh,</p>
|
|
|
|
<example>
|
|
|
|
setenv GNUSTEP_STRING_ENCODING NSBIG5StringEncoding
|
|
|
|
</example>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
2002-09-01 21:37:00 +00:00
|
|
|
<section>
|
2003-07-17 03:24:27 +00:00
|
|
|
<heading>User Default Values</heading>
|
|
|
|
|
2002-09-01 21:37:00 +00:00
|
|
|
<p>
|
2003-07-17 03:24:27 +00:00
|
|
|
Now that you specify the encoding, you have to determine which fonts you
|
|
|
|
use to display the characters of your native language.</p>
|
|
|
|
|
|
|
|
<p>Becuase the fonts used in GNUstep GUI are initially set to
|
|
|
|
those that are appropriate for European languages, you have to
|
|
|
|
overwrite them to display the characters correctly.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>At least, you need to change the user default value NSFont.
|
|
|
|
For example, suppose you have an .nfont package called MyFont
|
|
|
|
and want to use it to display the characters. To do this, use
|
|
|
|
the GNUstep's utility 'defaults' as follows:
|
2002-09-01 21:37:00 +00:00
|
|
|
</p>
|
|
|
|
<example>
|
2003-07-17 03:24:27 +00:00
|
|
|
defaults write NSGlobalDomain NSFont "MyFont"
|
|
|
|
defaults write NSGlobalDomain NSFontSize 16
|
2002-09-01 21:37:00 +00:00
|
|
|
</example>
|
2003-07-17 03:24:27 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
Depending on situation, you may also need to set NSUserFont to
|
|
|
|
the same font. For further details about the user default values, the
|
|
|
|
reader can refer to the documents DefaultsSummary.html and
|
|
|
|
NSFont.html shipped with the GNUstep packages.
|
|
|
|
</p>
|
2002-09-01 21:37:00 +00:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2003-07-17 03:24:27 +00:00
|
|
|
<heading>Examples</heading>
|
|
|
|
|
|
|
|
<subsect>
|
|
|
|
<heading>Chinese</heading>
|
|
|
|
|
|
|
|
<example>
|
|
|
|
export GNUSTEP_STRING_ENCODING=NSBIG5StringEncoding
|
|
|
|
</example>
|
|
|
|
<example>
|
|
|
|
defaults write NSGlobalDomain NSFont "Ar Pl Kaitim Big5"
|
|
|
|
defaults write NSGlobalDomain NSFontSize 16
|
|
|
|
</example>
|
|
|
|
</subsect>
|
|
|
|
|
|
|
|
<subsect>
|
|
|
|
<heading>Japanese</heading>
|
|
|
|
|
|
|
|
</subsect>
|
|
|
|
|
|
|
|
<subsect>
|
|
|
|
<heading>Korean</heading>
|
|
|
|
|
|
|
|
</subsect>
|
2002-09-01 21:37:00 +00:00
|
|
|
</section>
|
|
|
|
|
2003-07-17 03:24:27 +00:00
|
|
|
|
2002-09-01 21:37:00 +00:00
|
|
|
<section>
|
2003-07-17 03:24:27 +00:00
|
|
|
<heading>Concluding Remarks</heading>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Although this article has focused on the CJK languages, most part of it
|
|
|
|
is also applicable to other languages if GNUstep supports the enconding
|
|
|
|
you need.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
If you find a way to set up GNUstep with your native language
|
|
|
|
other than CJK, please consider to contribute it to the GNUstep
|
|
|
|
community to share your invaluable experience with others. We'll
|
|
|
|
greatly appreciate it. Comments or suggestions are also welcome.
|
|
|
|
</p>
|
2002-09-01 21:37:00 +00:00
|
|
|
</section>
|
|
|
|
|
2003-07-17 03:24:27 +00:00
|
|
|
</chapter>
|
2002-09-01 21:37:00 +00:00
|
|
|
</body>
|
|
|
|
</gsdoc>
|
|
|
|
|
|
|
|
|