|
| 以 PDF 格式下载本书 (1013 KB)
Part III System Administrator InformationThis part includes system administrator information. Chapter 7 Configuring a Simplified Chinese Solaris SystemYou can use the procedures this chapter to set a system-wide default locale or to add a new locale from the Solaris DVD and CD media. You also change the font path set by the Xsession script included in the Simplified Chinese Solaris Operating System. The following sections are included in this chapter. Setting the Default LocaleYou can make a system-wide change to the default locale with the following procedure. How to Set the Default Locale
Using Aliases to Set the LocaleYou can use aliases to change locales in a terminal window without typing long command lines or editing your .dtlogin file and running source every time. How to Set Locale Aliases for the Korn Shell
How to Set Locale Aliases for the C Shell
Chapter 8 Managing the htt Input Method ServerThis chapter describes the basic display features of the input method server. The input method server (IM server) handles Simplified Chinese input for Simplified ChineseSolaris software. The IM server receives keyboard input and makes the input available as Simplified Chinese characters to Simplified Chinese Solaris applications. The IM server can serve any internationalized X Window application that uses X Window Input Method (XIM) application program interfaces (API) to receive language input. The following sections of this chapter explain the basic display features of the IM Server. Input Method Server Basic PropertiesThe Simplified Chinese Solaris Operating System starts the IM server automatically when you start the Simplified Chinese in a locale that requires an input method. The IM server continues to run and service applications that are started and connected to it. Simplified Chinese Solaris applications that use the IM server for Simplified Chinese character input typically find the IM server running when they start. To user the IM server's service for language input, the IM server should be running before an application is started. If the IM server is not running when an application is started, the application might not be able to get the input service even if IM server is started later. Three htt ProcessesThe input method server comprises three related processes running together. The processes are htt, htt_xbe, and htt_server. One process controls the input method server properties, another controls the population of the input method server (that is, a “watchdog” process), and the third handles input methods of clients. Usually, you don't need to know the details of these three processes. When htt is started, htt_xbe and htt_server are started automatically. htt Application DisplayThe following figure shows a typical application display when using the htt input method.
How and When htt Is StartedThe htt process must be running before an application starts in order for the application to use the htt input method server to receive Simplified Chinese input. The C locale does not require htt. If you change the default locale from C to another locale that requires htt, you must start htt in same terminal window. You can start htt with a command such as the one shown in the following example.
When the locale is set tozh, htt is started automatically when the Simplified Chinese windowing environment starts. In CDE, htt is started from the /usr/dt/config/Xsession.d/0020.dtims script. This script is executed by Xsession, which runs at every initialization stage upon a user's login from dtlogin. This script ensures that htt is started before other applications in CDE. Using the iiim Server in zh.UTF-8 and zh_CN.UTF-8 LocalesThe Internet Intranet Input Method Server (iiim) supports the European Local Input Methods that use the Compose Key. The iiim server supports the Asian Remote Input Methods using IIIM Protocol. The default Language Engine is English/European which supports ASCII and some European Languages such as German and French. To switch to Chinese input methods, press Control-spacebar. To switch to other language engines, click the left mouse button in the status area. The following language engine list appears:
The following language engines appear if their corresponding locales are installed:
After the Simplified Chinese language engine is selected, you can use the following function keys to switch between different input methods:
For more detailed information about Input Methods, see Chapter 4, Entering Simplified Chinese Text. Chapter 9 FontsThis chapter describes the PostScript, TrueType and bitmap fonts supported for use in the Simplified Chinese Solaris Operating System. The following sections discuss how to use and to edit the fonts. Display PostScript System (DPS)The Simplified Chinese Solaris Operating System provides PostScript fonts in the Display PostScript System (DPS). This section describes the fonts and the DPS facilities. For further details, see Programming the Display PostScript System with X, published by Adobe® Systems. Using Simplified Chinese PostScript Fonts and DPS FacilitiesThe Simplified Chinese Solaris Operating System includes the fonts listed in the following table. Table 9–1 Simplified Chinese Solaris Operating System PostScript Fonts
The following figure shows a sample of the Song-Medium font.
Creating Composite Roman and Simplified Chinese FontsYou can create composite fonts using any a Roman font and any of the Simplified Chinese fonts. For example, the following PostScript code defines a composite font, Times-Italic+Kai-Medium. The Times-Italic is used for the ASCII characters and Kai-Medium font is used for the Simplified Chinese characters. /makeEUCfont {
/AsianFont exch def
/WestFont exch def
/NewFont exch def
/CIDInit /ProcSet findresource
begin
NewFont [ AsianFont WestFont ]
beginrearrangedfont
1 usefont
1 beginbfrange
<00> <7e> <00>
endbfrange
endrearrangedfont
end
} bind def
/LC_Times-Roman /Times-Roman /Kai-Medium makeEUCfont
Using Simplified Chinese Fonts in DPS ProgrammingYou can use Simplified Chinese fonts just as you use Roman fonts in DPS wrap definitions. The following code sample creates the display in the Hello World figure. defineps PSWDisplayText(char *text)
/pointSize 50 def
/Helvetica pointSize selectfont
(Hello World) stringwidth pop 2 div neg 0 moveto
(Hello World) show
/cpSize 40 def
/Song-Medium cpSize selectfont
(text) stringwidth pop 2 div neg pointSize neg moveto
(text) show
endps
You can call PSWDisplayText(Chinese text) in a C program to display the designated Chinese text. ![]() The Simplified Chinese Solaris software provides TrueType support in DPS. BDF to PCF ConversionYou must convert BDF fonts to PCF format to make the fonts usable in Simplified Chinese Solaris applications. How to Convert BDF Fonts to PCF Format
How to Install and Check the Edited Font
All Simplified Chinese fonts have XLFD font names. You can use the xlsfonts utility to display the font names.
Creating Characters With sdtudctoolThe sdtudctool utility supports bitmap, Type 1, and CID fonts. This section contains instructions for using the sdtudctool to create, input, and print new characters for the Simplified Chinese locales in the following code ranges. Table 9–2 Code Points for Locales
How to Use the sdtudctoolYou can use the following procedure to create characters in the zh locale.
How to Specify sdtudctool Options
How to View a Character Reference
How to Register the UDC to the NewPinYin Input Method
How to Type the New CharactersUse the NewPinyin or NeiMa input method to type the UDC's PinYin spelling for the characters you create. How to Print the New Characters
Changing Font DirectoriesThe Xsession script in the /usr/dt/bin directory includes the following font path: /usr/openwin/lib/locale/locale/X11/fonts, where locale is either zh, zh.GBK, or zh_CN.GB18030. To dynamically add a different font directory path, type the following commands.
How to Add a Font Directory PathBefore using the xset command, ensure that the fonts.dir file exists in the specified font directory. If fonts.dir does not exist, use mkfontdir to create the fonts.dir for the Bitmap font. Type the following commands to dynamically add a different font directory path.
Bitmap and TrueType FontsThe tables in this section list the TrueType and bitmap fonts that are available for the zh_CN.EUC, the zh_CN.GBK, and the zh_CN.GB18030 locales. The following table shows the TrueType fonts for the zhlocale. Table 9–3 TrueType Fonts for the zh_CN.EUC Locale
The following table shows the bitmap fonts for the zh locale. Table 9–4 Bitmap Fonts for the zh_CN.EUC Locale
Table 9–5 TrueType Fonts for the zh_CN.GBK Locale
The following table shows the bitmap fonts for the zh_CN.GBK locale. Table 9–6 Bitmap Fonts for the zh_CN.GBK Locale
The following table shows the TrueType fonts for the zh_CN.GB18030 locale. Table 9–7 TrueType Fonts for the zh_CN.GB18030 Locale
The following table shows bitmap fonts for the zh_CN.GB18030 locale. Table 9–8 Bitmap Fonts for the zh_CN.GB18030 Locale
Chapter 10 Simplified Chinese Printing FacilitiesThis chapter describes how to print Simplified Chinese text to a line printer. The chapter also provides information on how to use the mp utilities to print to a PostScript printer or to a line printer. Printing Chinese Output From a Command LineThis section provides information that you can use to print from a command line with the lp command and the mp program. Printing With a Line PrinterYou can use the commands in this section to print files of different formats to a line printer. Use this command to print an EUC file.
Use this command to print a GB format file to a printer that supports GB format.
Printing With the mp UtilityThe enhanced mp print utility is available in the current Simplified Chinese Solaris release. You can use mp to print zh files in zh locale or UTF-8 files in zh.UTF-8 locales. The output from the utility is standard PostScript that you can send to any PostScript printer. Use the following command to print a file with the mp utility.
You can also use the utility as a filter because mp accepts stdin stream.
You can set the utility as a print filter for a line printer. For example, the following command sequence signals the print service that the printer lp1 accepts only mp format files. The command also installs the printer lp1 on port /dev/ttya. See the lpadmin(1M) man page for more details.
You can use the following command to add a filter for an LP print service.
The filter converts the default input type to PostScript output with the /usr/bin/mp command. To print a UTF-8 text file, use a command line such as the following.
For more details on the mp(1), see the man page. Using mp as an Xprt (X Print Server) ClientUsing mp as an Xprt client enables mp to print the output of any printer connected to a network supported by an Xprt print service. As an Xprt client, mp supports PostScript and many versions of PCL. The Xprt client attempts a connection to an Xprt server based on the following rules:
Chapter 11 TTY Environment and SupportThis chapter assumes that you are familiar with the following information.
This chapter includes the following sections: Refer to the termio(7I)man page for background information on STREAMS and TTY drivers. Terminal SupportThe Simplified Chinese Solaris Operating System supports Chinese terminals (EUC-GB). The terminals should have built-in Simplified Chinese fonts and input methods. Installing a TerminalIf you have not added a terminal to your system before, install a terminal in ASCII mode only. How to Install a TerminalYou can use the serial ports option from the Admintool menu to configure serial ports for terminals. Serial ports provide the easiest means of installing a terminal.
How to Set Up a ttya Port from the Command LineUse the following procedure is required tto set up a terminal on ttya port from the command line.
How to Verify TTY Set UpDo the Use the following procedure to verify that your TTY is properly set up .
This is the last step in setting up a terminal. The default setting of a Simplified Chinese terminal is the completion-code mode. Continue to the next section to install a Packed-code TTY. Chapter 12 Backward CompatibilityThis chapter contains information for making programs backward-compatible with earlier versions of Asian Solaris software. Every utility described is supported. For this version of Solaris, you are encouraged to use the XPG4 internationalization APIs described in International Language Environments Guide. Simplified Chinese Test UtilitiesThese utilities test various aspects of the Simplified Chinese (GB-2312-80) national standard character set. They also assume that the character being tested is part of the national standard character set. The arguments for the functions in these tables must be a character in WC, wchar_t. For more information, see the cctype(3x)man page. Table 12–1 Simplified Chinese Character Classification Functions
Two additional routines for Simplified Chinese, iscgb and isceuc, test for characters from the GB-2312-80 character set. The iscgb routine expects a wide character, and isceuc expects a GB-2312-80 character in EUC format. For more information, see the cctype(3x) man page. Table 12–2 General Simplified Chinese General Character Classification Functions
Simplified Chinese Conversion UtilitiesThis section describes functions for wide character and string input and output, character classification, and conversion functions for the Simplified Chinese character sets. Solaris 2.7 software implements a wide character library for handling Simplified Chinese character codes according to industry standards. Routines that have Chinese language-specific dependency are in their own language-specific library, which is linked with the corresponding C compiler option. Simplified Chinese Solaris libcle is linked with -lcle Refer to the appropriate man pages for more information. Asian Solaris software defines WC as a constant-width, four-byte code. WC uses the ANSI C data type wchar_t, which Solaris software defines in wchar.h as follows: typedef long wchar_h; In Solaris software, long is four bytes. Conversion UtilitiesThe conversion functions described in this section are available, but you should use iconv() as a standard function. Simplified Chinese Solaris software provides facilities for various conversions, for example:
Programs using the general multibyte conversion utilities should include the header files widec.h and wctype.h. Simplified Chinese Solaris specific routines (such as iscxxx) are declared in zh/xctype.h. Programs using general multibyte conversion utilities should include three header files: wctype.h, widec.h, and zh/xctype.h. The locale/xctype.h file declares the Chinese locale-specific routines, which have names of the form iscxxxx: As with the classification functions described in the previous section, the use of these functions can be controlled by the setlocale function (described elsewhere in this and other chapters). Locale-specific conversion routines (such as Chinese cgbtoeuc) are contained in the libcle library: This library can be linked during compilation using the C compiler option -lcle. Conversion Within a Code SetThe multibyte conversion functions are similar to the one-byte conversion functions toupper and tolower. These functions convert wide-characters to other wide characters. For more information on conversion routines, see the man pages for wconv(3) and cconv(3). The following routines are in the regular Chinese C library. Table 12–3 Simplified Chinese Case Conversion Functions (declared in zh/xctype.h)
Conversion Between Simplified Chinese Code SetsIn the Simplified Chinese character sets, the Roman characters and numbers in code set 0 are repeated in code set 1. The following functions test wide characters. Table 12–4 Simplified Chinese Code Set Conversion Functions
For further information on these functions, see the man page for cconv()(3x). Conversion for Simplified Chinese Character CodesThe following routines do character-based code conversion on the GB-2312-80 character set. They convert characters and strings between EUC format and GB-2312-80 format. To use these routines, the library libcle must be linked using the C compiler option -lcle. For further information, see the cconv(3) man page. Table 12–5 Simplified Chinese Character-Based Functions
Binary Compatibility Package (BCP)Applications compiled under Chinese OpenWindows 2.x or Solaris 1.x or SunOS 4.x systems have different binary formats than the current Chinese Solaris release. Older applications can nevertheless be run under the current Chinese release without being recompiled by using its included binary compatibility package (BCP). Note – SUNWowbcp must be included in your system configuration in order for you to run the following commands. See your system administrator for installation. Running Earlier Binary CodeThe following BCP command runs the compiled binary code of earlier SunOS4.x, Solaris 1.x, or Chinese OpenWindows 2.x applications without recompilation, However, OpenWindows V2 Chinese applications will display no input server status region. As shown in the following examples, the command calls the application by its old name (old_application_name) and sets the basic locale, input language, and display language using the older version's specific locale name (old-locale):
The following example shows the command for running the compiled binary code of an earlier version of the textedit application in the current Simplified Chinese Solaris environment:
Due to incompatibilities between Simplified Chinese Solaris 2.x and 1.x applications, you cannot cut and paste Chinese characters between them. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||