Re: fonts setting in X for pango, gtk 1.3



Patrick Sung <phsung ualberta ca> writes:

> Patrick Sung wrote:
> 
> > I am trying to run the gtk-demo and various demo to see how pango
> > displays CJK chars.  But unfortunately I can't get the Japanese example
> > to display the japanese.  In particular, I can't see the Kanji character
> > displayed using the example in "tests/testtext".  I can see all the
> > other characters displayed except the Kanji (or Chinese char if I am
> > trying to open a UTF8 CJK encoded file).
> >
> > How did you setup X and what fonts (and where to get it?) did you use?
> > I have been trying to use the Microsoft unicode fonts (truetype) with no
> > success.
> 
> Ok.. so now I have Japanese BDF fonts set up on X... and I can read all the
> Kanji and even some others meant to be in Chinese (i convert a text from
> Big5 to UTF8 and use the testtext program to load it, about 80% of chars is
> displayed)
> 
> So I dig through some of the Pango code, and found that the Basic
> engine didn't convert to Big5.. rather it goes to GB and JIS. So now
> my question becomes, will there be big5 support? so I can see all
> the Traditional chinese char on my doc? (i didn't try with the
> simplied GB fonts yet).

Yes, Big5 support hasn't been added yet. We are also missing 
JISx0212 support currently. There is a bug open about it:

 http://bugzilla.gnome.org/show_bug.cgi?id=50633
 
> Also my second is, how can I setup TrueType fonts (in particular
> unicode truetype fonts) and let pango use it?  (i've heard the GDK_USE_XFT=1
> environment variable will do the tricks, but what about using unicode fonts?
> i.e. ISO10646-1 encoding)

Almost all TrueType fonts are Unicode encoded. This is what
the Xft backend expects (GDK_USE_XFT=1)
 
> I would love to try to add BIG5 conversion to the basic engine if it is
> needed.

Some of the engineers at Sun were working on adding additional encodings
a while ago - I'm not sure how far they got with this. It's
actually pretty simple -- appended is a mail from me about how
to go about doing it.

Regards,
                                        Owen 

====
From: Owen Taylor <otaylor redhat com>
Subject: Re: A bug report: Pango cannnot handle some CJK character sets
To: tajima <hidetoshi tajima eng sun com>
Cc: chookij vanatham eng sun com,  ienup sung eng sun com
Date: 14 Dec 2000 19:54:44 -0500

tajima <hidetoshi tajima eng sun com> writes:

> Hi Owen,
> 
> >What I meant by "I don't seem to have that patch around any more",
> >is that I probably deleted it from my hard disk at some point.
> >
> >I'll either try to redo this or to write up some more detailed
> >instructions for how to additional charsets.
> 
> It's great! Please send us some instructions for how to modify basic.c
> and table-big.i. We'd like to try to make a patch for jisx02*, and
> some others like big-5*, cns11643-*. That will help us get better
> understanding in Pango.
> 
> BTW, we've confirmed that iso10646 font works fine for displaying
> jisx0212 and jisx0201 characters. - just FYI.

tables-big.i is generated by the scripts in the tools/ directory
of Pango. 

The way it works is that you put the mapping files from the Unicode
data files for the encodings you want to cover in the maps/ subdirectory
The current tables-big.i is from the files:

gb-2312
iso-8859-1
iso-8859-10
iso-8859-13
iso-8859-14
iso-8859-15
iso-8859-2
iso-8859-3
iso-8859-4
iso-8859-5
iso-8859-6
iso-8859-7
iso-8859-8
iso-8859-9
jis-0208
koi8-r
ksc-5601
tis-620

The names here are significant and differ a bit from the file names
Unicode data names, but the contents should be identical.

[ I only distribute the tis-620 file which I created myself - the
  other files aren't distributable, though anybody can download
  them from the Unicode consortium. ]

So, to add jisx0212, copy the file from the Unicode mapping data
JIS0212.TXT to this directory and name it jis-0212.

Then run the script "make-table.sh". This generates the file "table".

Then run "compress-table.pl", which takes the data from the file
'table', converts it into the C code for the tables and writes
it to standard out.

This code can be used to replace the two tables char_mask_map[]
and char_masks[] in tables-big.i. The resulting code will
reference ENC_JIS_0212, which will need to be add to the enumeration
at the top of the file, and also into the charsets[] table.

The charsets table includes three things:

 - the name for the charset according to iconv()
 - the registry/encoding fields for the XLFD
 - the conversion function to be used

So, the additional line would look something lke:

  { 18, "EUC-JP",       "jisx0212.1990-0", conv_euc },

Finally, you'll have to modify conv_euc to properly handle
the 0x8f.... 3 byte forms of EUC-JP and convert them into the 
proper index into the jisx0212.1990-0 font.

I think that's it.

Regards,
                                        Owen
 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]