Korean Solaris User's Guide

Chapter 6 Font Editor

This chapter describes the PostScript fonts included in the Korean Solaris operating environment, what you need to use them, and how to edit them.

This chapter also describes how to work with Portable Compiled Format (PCF) fonts and edit existing characters or create and install new characters used by the Korean Solaris operating environment. You can then save your changes and use the edited font(s) on your local system. This process is a sequence of several steps:

  1. Preparing a workspace for the font(s) you edit or create

  2. Editing Bitmap Distribution Format (BDF) font file(s) with Font Editor

  3. Converting BDF font file(s) to PCF format

  4. Making the font(s) usable on your system


Note -

ko.UTF-8 messages are not supported by Font Editor. If you run Font Editor under the ko.UTF-8 locale, the Font Editor interface will be in English.


Display PostScript System (DPS)

The Korean Solaris operating environment provides PostScript fonts in the Display PostScript System (DPS). This section describes what you need to use DPS in Korean Solaris software. For further details, see Programming the Display PostScript System with X, published by Adobe Systems.

Using Korean PostScript Fonts and DPS Facilities

The Korean Solaris operating environment DPS provides the fonts listed in the following table.

Table 6-1 Korean Solaris Operating Environment DPS Fonts

Font Name 

Description 

Kodig-Medium-COMB-H 

Kodig-Medium font, 9/7 composite font encoding for horizontal display of Johap encoded Hangul and Roman text. 

Kodig-Medium-COMB-V 

Kodig-Medium font, 9/7 composite font encoding for vertical display of Johap encoded Hangul and Roman text. 

Kodig-Medium 

Kodig-Medium font, an alias of Kodig-Medium-EUC-H font; can be used like a Roman font. 

Kodig-Medium-EUC-H 

Kodig-Medium font, 9/7 composite font encoding for horizontal display of EUC text, can be used like a Roman font. 

Kodig-Medium-EUC-V 

Kodig-Medium font, 9/7 composite font encoding for vertical display of EUC text; can be used like a Roman font. 

Kodig-Medium-H 

Kodig-Medium font, 8/8 composite font encoding for horizontal display of shifted out ISO2022 text. 

Kodig-Medium-V 

Kodig-Medium font, 8/8 composite font encoding for vertical display of shifted out ISO2022 text. 

Myeongjo-Medium-COMB-H 

Myeongjo-Medium font, 9/7 composite font encoding for horizontal display of Johap encoded Hangul and Roman text. 

Myeongjo-Medium-COMB-V 

Myeongjo-Medium font, 9/7 composite font encoding for vertical display of Johap encoded Hangul and Roman text. 

Myeongjo-Medium 

Myeongjo-Medium font, an alias of Myeongjo-Medium-EUC-H font; can be used like a Roman font. 

Myeongjo-Medium-EUC-H 

Myeongjo-Medium font, 9/7 composite font encoding for horizontal display of EUC text; can be used like a Roman font. 

Myeongjo-Medium-EUC-V 

Myeongjo-Medium font, 9/7 composite font encoding for vertical display of EUC text; can be used like a Roman font. 

Myeongjo-Medium-H 

Myeongjo-Medium font, 8/8 composite font encoding for horizontal display of shifted out ISO2022 text. 

Myeongjo-Medium-V 

Myeongjo-Medium font, 8/8 composite font encoding for vertical display of shifted out ISO2022 text. 

You can use the following Korean fonts just as you would use Roman fonts:

The following figure shows a sample of Kodig-Medium and Myeongjo-Medium text.

GraphicGraphic

You can also use the following Korean fonts just like Roman fonts for an ISO2022 encoded Hangul string, that is, for a pure Hangul string between SO and SI characters with no intermediate ASCII (0x20) characters:

Creating Composite Korean Fonts

You can create composite fonts using one Roman font and one of the following Korean fonts:

For example, the following PostScript code defines a sample composite font, Times-Italic+Kodig-Medium, which uses Times-Italic for ASCII characters and Kodig-Medium horizontal font for Korean characters:


/Times-Italic+Kodig-Medium
13 dict begin
				/FontName 1 index def
				/FMapType 4 def
				/Encoding [ 0 1 ] def
				/WMode 0 def
				/FontType 0 def
				/FontMatrix [1.0 0.0 0.0 1.0 0.0 0.0] def
				/FDepVector [
								/Times-Italic findfont
								/Kodig-Medium-COMB-H findfont
				] def
currentdict
end
definefont pop

Using Korean Fonts in DPS Programming

You can use Korean fonts just as you use Roman fonts in DPS wrap definitions. The following sample code creates the display which follows:


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
			/Kodig-Medium-KO cpSize selectfont
			(text) stringwidth pop 2 div neg pointSize neg moveto
			(text) show
endps

You can tell PSWDisplayText (Korean text) in a C program to display the designated Korean text:.

Graphic

Using the Font Editor

Setting Up in a Working Directory

  1. Create a new directory workspace for editing fonts, for example:


    system% mkdir /tmp/newfont 
    
  2. Change your working directory to that directory:


    system% cd /tmp/newfont 
    

Starting Up the Font Editor

Korean Solaris software provides the Font Editor for editing fonts.

    Start up Font Editor:


system% fontedit 

A Font Editor window is displayed.

Font Editor does not operate on PCF format font files (file extension.pcf), which are used by the Solaris operating environment. This tool handles only fonts in BDF, a portable format defined by the MIT X Consortium.

Preparing a Font File

    Get the font file you plan to edit in BDF format.

Its encoding should start at 8481 (0x2121). For an example, consider that you have a BDF file like the following myfont14.bdf:


STARTFONT 2.1
COMMENT Sample Font
FONT Myfont-Medium14
SIZE 14 75 75
...
STARTCHAR C101
ENCODING 8481
...

Editing a BDF Font File

  1. Hold down the MENU mouse button on the Font Editor window's File button and select Load... on the pull-down menu.

  2. Type the name of the BDF file you plan to edit, for example myfont14.bdf, in the Font Name field of the Load pop-up window.

  3. Click SELECT on the Load button in the popup.

    This loads the file.

  4. Click SELECT on the Font Editor main window Select button.

    This displays the Select window, where you do the following steps.

  5. Type the high and low bytes of the font encoding code for the character you want to edit, for example 0x4751.

    You can use the Next (right arrow) button or Previous (left arrow) button to increase or decrease the high or low byte.

    Graphic
  6. Set Code Length to MultiByte for this Korean font.

    You would set Code Length to SingleByte for an ASCII/English font.

  7. Click on the Edit button (in the Fontedit: Select window) to display the glyph on the main canvas.

    The specified glyph appears in the Font Editor window, resembling the following:

    Graphic
  8. Edit this glyph on the main canvas by turning pixels on/off:

    • Click the SELECT mouse button to turn on a pixel.

    • Click the ADJUST mouse button to turn off a pixel.

    • Hold down the MENU mouse button for a menu of additional functions.


    Note -

    The character glyph in the upper left corner of the main window shows the actual appearance of the glyph as you turn its pixels on and off.


  9. When you finish editing the glyph, click SELECT on the Store button.

  10. Repeat the preceding steps 5 through 9 to edit each glyph you choose in this font.

  11. After you finish editing the glyph(s) in this font, hold down MENU on the File button and select Save... to save the edited glyph(s) in the font file.

Converting BDF to PCF Format

Before Solaris applications can use the modified BDF file, it must be converted to an PCF format file.

    Use the bdftopcf command to make the BDF font file usable by the Korean Solaris operating environment by converting it to PCF format as follows:


    system% bdftopcf -o myfont14.pcf myfont14.bdf
    

For more information, see the bdftopcf(1) man page and the mkfont(1) man page.

Installing and Checking the Edited Font

  1. To add a new bitmap to the Solaris operating environment, put the .pcf font file in your font directory. You may compress the .pcf font file before moving it to your font directory:


    system% compress myfont14.pcf
    

  2. Run the following commands in your font directory.

    Note that the .bdf file should not be in the font directory.


    system% cat >> fonts.alias
    -new-myfont-medium-r-normal--16-140-75-75-c-140-ksc5601.1987-0 
    Myfont-Medium14
    ^D
    system% mkfontdir
    system% xset +fp `pwd`
    

  3. You can view your font by entering:


    system% xfd -fn Myfont-Medium14