Subject: A Generalisation of Chinese Font files

From: Ng Liang Shing <[email-masked]>
Date: Sat, 9 Jul 1994 02:06:41 MYT

A Generalisation of Chinese Font Files

I hope to make some generalisations about Chinese Font Files and at the same
time discuss some terminology. Finally I propose a method of making a unified
font file for both Guobiao and Big5 character sets.

>From CCLIB.16 to True Type Font Files

CCLIB.16 is the most primitive Chinese font file. It contain only the 'glyph'.
A glyph defines how a character is drawn. In CCLIB.16, the glyph is bitmap.

CCLIB.16 contains about 6768 bitmap glyphs. The position of a glyph in a font
file is called the glyph index. The glyph index is not exactly equivalent to
the character code. By definition, the character code is a number associated
with the position of a character in a certain character set. To be more exact,
character code applies to character set, glyph index applies to glyph table.

A table for mapping a certain character code to a glyph index is called the
character map, borrowing True Type terminology.

CCLIB.16 is purely a glyph table, with on glyph information. It assumes a
straight forward character mapping i.e. Guobiao Code == Glyph Index, with only
one or two exceptions.  In this case, an explicit character map table is not
necessary.  Since Guobiao mapping is implied, CCLIB.16 is often regarded as
a Guobiao Font. However, this notion is not strictly correct, for Guobiao is a
name for a character set, not a name for the font file. It is possible to use
CCLIB.16 for Big5 character set, provided a Big5 CCLIB.16 character map is
used. CCLIB.16 is CCLIB.16. It is neither GB nor Big5 font file.

This argument may seem trivial, but it is important to get the idea
right from the beginning as this may point to one very important application -
to unify GB and Big5 character set using a single font file. It is important
to distiguish character set from glyph table and character code from glyph
index.

True Type Font Files is much more complicated than CCLIB.16 in many sense.

First CCLIB.16 contains only glyph information. A TTF file contains glyph
information as well, but there are auxiliary information such as the character
map table. A TTF file is a collection of look-up tables, two of which are the
glyph table (GLYF) and character map table (CMAP).

Secondly the glyph in TTF file is vectored, rather than bitmap.

Thirdly, there can be more than 10 types of table in a TTF files.

A general method for getting the glyph of a character is as follow:

1. read character code.
2. convert character code to glyph index
3. make a pointer to the glyph data using the glyph index

In CCLIB.16, step 2 is directly conversion using Guobiao Code.
In TTF, step 2 is to lookup the character map to get the glyph index
corresponding to a character code.

Unified Font File for Guobiao and Big5 character sets

I remembered vaguely Prof. Simpson said it was 'ridiculous' to have two
character sets with so many overlapping characters. I agree with him.

But if we could produce a font file having all the characters in both Guobiao
and Big5, this idea may not seem too ridiculous after all.

I am not a language expert to sort out all the occurence of characters in both
character sets. I hereby propose a possible approach for building and using
such a font file.

GB has about 6768 Hanzi. Big5 has about 13000. If there were no overlapping,
the union will be about 19000. However, since there are many overlapping, so I
estimate the union will be about 14000, assuming there are 1000 Jiantizi.

And then we have a glyph table with 14000 characters. What we then need is two
character map tables, one for GB and the other for Big5. The role of the
character map is to relate a character code to the glyph index.

To determine the union and to prepare the character map is the job of the
language experts.

With TTF, Format 2 CMAP table allow up to 256x256 character codes. So we may
partition the CMAP table into two halves, one for GB and the other for Big5.

So to read such a union font file (either bitmap or TTF), the steps involved
will be the same as above i.e.

1. read the character code
2. convert character code to glyph index (this time by looking up the
character map)
3. make a pointer to the glyph data using the glyph index

The Benefit

A unified font file solved many problems for the programmers and software
vendors.

1. Programmers need to use only one font file at a time. It makes life easier.
It saves a lot of disk space. It makes sense. It is less ridiculous than
having two font files. (It is still quite ridiculous for having two character
sets....., never mind that. :-)

2.  By making a union font file, at last we netters can legally claim
ownership over such a font file, thus reducing (or possibly eliminating) the
possibility of legal conflict over font resources.

Volunteers needed. Comments welcome.

Yours,
Liangsheng Wu

--
Ng Liang Shing            |   This is an Internet node host inside
Sungai Petani, Malaysia   |   an old 286.  A few years back, this place
[email-masked]          |   was not more than a small town.