OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #2 Display DBCS characters
Displaying DBCS characters on SBCS requires at least two things.
First is a font driver supporting UNICODE fonts correctly, second is fonts themselves for DBCS. Other than these, there are some other things needed.
1. Font Driver
Nowadays, most of fonts are True Type Font. OS/2 also supports it. However, default true type font driver does not support unicode fonts correctly. Especially, DBCS fonts. So if you want to use DBCS fonts, you should install another font driver for a true type font. It's <FreeType/2>.
FreeType/2 has several versions. 1.0.x and 1.1.x released by Michael Necasek, 1.2.x released by me, 1.3.x and 2.x released by Alex Taylor. Out of these, you should use 1.2.x or later. You can get them here.
For installations, see their README.
2. Font
IBM provided fonts containing CJK glyphs by default. They are <Times New Roman WT> family. Out of these, <Times New Roman WT J> is shipped with eComStation. Although 'J' means 'Japan', it contains China and Korean glyphs, too. As well as, <Times New Roman MT 30> in TTF may be used if you have. These are variable-width fonts. Where as, <Monotype Sans Duospace WT J> is a fixed-width font.
It's possible to use any public true type fonts, of course. Or I think, it woud be a good way to use fonts of Windows.
If you got them, install with [Font Palette], which is in [Local System] - [System Setup] - [Apperance] on eComStation.
Even if you installed DBCS fonts, to see DBCS characters with these fonts you should execute a program in a DBCS code page and select a proper font with its font selection option.
3. Font Association
It's very annoying that setting DBCS fonts on every program on which DBCS characters should be displayed is required.
Fortunately, OS/2 provides [Font Association] to avoid this annoyance. Font association is to associate a specific DBCS font to SBCS fonts. OS/2 finds a glyph in the DBCS font unless a glyph is not found in a SBCS font specified by a program. That is, it's a kind of fall-back font. In this way, it is possible to see DBCS characters without selecting a DBCS font in programs.
To enable font association, it is needed to create a new key, [PM_AssociateFont], in a [HINI_USER_PROFILE] - [PM_SystemFonts].
Let's do that like this.
To have an effect of font association, it is required to reboot the system.
4. VIO
Now, normal PM programs will show you DBCS characters. However, you cannot still see DBCS characters on VIO windows. On VIO windows, a fixed-width system font which is a bitmap font not a true type font is used.
On DBCS OS/2, bitmap fonts such as MINCHO for DBCS characters are provided. Those fonts seem to require a special font driver not available on SBCS OS/2. So, another strategy is needed. That is, emulation of VIO window. For this, I've made <KShell>.
<KShell> redirects outputs of a VIO program to a PM window, and passes inputs on a PM window to a VIO program. For this, <KShell> uses a full screen session. Because of this, a size of VIO window is restricted to the size of the full screen. In other words, the full screen session is 80x25 in text mode, a VIO window is restricted to 80x25 in text mode. It's not possible to resize a VIO window to arbitrary size.
You can get [KShell] here.
For details, see documents of [KShell].
Unforutnatley, however, it is not known to see DBCS characters on a full screen session.
Next, let's find the way to input DBCS characters.
First is a font driver supporting UNICODE fonts correctly, second is fonts themselves for DBCS. Other than these, there are some other things needed.
1. Font Driver
Nowadays, most of fonts are True Type Font. OS/2 also supports it. However, default true type font driver does not support unicode fonts correctly. Especially, DBCS fonts. So if you want to use DBCS fonts, you should install another font driver for a true type font. It's <FreeType/2>.
FreeType/2 has several versions. 1.0.x and 1.1.x released by Michael Necasek, 1.2.x released by me, 1.3.x and 2.x released by Alex Taylor. Out of these, you should use 1.2.x or later. You can get them here.
- FreeType/2 1.2.x: http://www.ecomstation.co.kr/komh/os2factory/#freetype2
- FreeType/2 IFI 1.3.x and 2.x: http://www.altsan.org/programming/os2/index.html#ft2
For installations, see their README.
2. Font
IBM provided fonts containing CJK glyphs by default. They are <Times New Roman WT> family. Out of these, <Times New Roman WT J> is shipped with eComStation. Although 'J' means 'Japan', it contains China and Korean glyphs, too. As well as, <Times New Roman MT 30> in TTF may be used if you have. These are variable-width fonts. Where as, <Monotype Sans Duospace WT J> is a fixed-width font.
It's possible to use any public true type fonts, of course. Or I think, it woud be a good way to use fonts of Windows.
If you got them, install with [Font Palette], which is in [Local System] - [System Setup] - [Apperance] on eComStation.
Even if you installed DBCS fonts, to see DBCS characters with these fonts you should execute a program in a DBCS code page and select a proper font with its font selection option.
3. Font Association
It's very annoying that setting DBCS fonts on every program on which DBCS characters should be displayed is required.
Fortunately, OS/2 provides [Font Association] to avoid this annoyance. Font association is to associate a specific DBCS font to SBCS fonts. OS/2 finds a glyph in the DBCS font unless a glyph is not found in a SBCS font specified by a program. That is, it's a kind of fall-back font. In this way, it is possible to see DBCS characters without selecting a DBCS font in programs.
To enable font association, it is needed to create a new key, [PM_AssociateFont], in a [HINI_USER_PROFILE] - [PM_SystemFonts].
Let's do that like this.
- Execute <regedit2.exe>
- Expand [HINI_USER_PROFILE]
- Expand [PM_SystemFonts]
- Check [PM_AssociateFont] key if it is there
- If it is there, go to Step 9
- Click Right-Mouse-Button
- Click [New]
- Click [String Value]
- Enter [PM_AssociateFont] in [Name] field
- Click Right-Mouse-Button on [PM_AssociateFont] key
- Click [Modify]
- Enter a registered font name such as <Times New Roman WT J> in [Data] field
To have an effect of font association, it is required to reboot the system.
4. VIO
Now, normal PM programs will show you DBCS characters. However, you cannot still see DBCS characters on VIO windows. On VIO windows, a fixed-width system font which is a bitmap font not a true type font is used.
On DBCS OS/2, bitmap fonts such as MINCHO for DBCS characters are provided. Those fonts seem to require a special font driver not available on SBCS OS/2. So, another strategy is needed. That is, emulation of VIO window. For this, I've made <KShell>.
<KShell> redirects outputs of a VIO program to a PM window, and passes inputs on a PM window to a VIO program. For this, <KShell> uses a full screen session. Because of this, a size of VIO window is restricted to the size of the full screen. In other words, the full screen session is 80x25 in text mode, a VIO window is restricted to 80x25 in text mode. It's not possible to resize a VIO window to arbitrary size.
You can get [KShell] here.
For details, see documents of [KShell].
Unforutnatley, however, it is not known to see DBCS characters on a full screen session.
Next, let's find the way to input DBCS characters.
댓글
댓글 쓰기