The code is as follow:

         //創建繁体字字体
            BaseFont bfFan = BaseFont.createFont("MHei-Medium", 
"UniCNS-UCS2-H",BaseFont.NOT_EMBEDDED);
             //使用
            cb.setFontAndSize(bfFan, 18);
            //输出繁体字
            cb.setTextMatrix(150 ,700) ;        
            cb.showText("窩窩協會") ;
            //创建香港字字体
            BaseFont bfHK = BaseFont.createFont("c:\\winnt\\fonts\\hkscsm3u.ttf", 
BaseFont.IDENTITY_H,                             BaseFont.NOT_EMBEDDED);
            //使用
            cb.setFontAndSize(bfHK, 18);
            //输出香港字
            cb.setTextMatrix(150 ,800) ;//\u3F63\uF3A0
            cb.showText("\u3F63\uF3A0") ;

Now I can output both Traditional Chinese and Specific charaters
of HongKong.

To my strange, I can not output Tranditional Chinese by HK Font!

Rick
----- Original Message ----- 
From: "Bruno" <[EMAIL PROTECTED]>
To: "Rick" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, August 21, 2002 2:57 PM
Subject: Re: [iText-questions] Question about Itext lib on Chinese characters


> Quoting Rick <[EMAIL PROTECTED]>:
> 
> > Now my question is mainly about this:
> > 
> > I want to use a font that supports HKSCS, like this
> > "BaseFont bf = BaseFont.createFont("c:\\winnt\\fonts\\hkscsm3u", "???",
> > BaseFont.NOT_EMBEDDED);"
> > I donot know the meaning of the second parameters in this function.And
> > I have tried some and an exception throwed say hkscsm3u with ??? is
> > not available.
> > 
> > I want to know according to a ttf file, how to know what should be filled
> > in the second parameter?
> 
> I think your first parameter should be something like this:
> "c:\\winnt\\fonts\\hkscsm3u.ttf"
> "c:\\winnt\\fonts\\hkscsm3u.ttc,1"
> Check if the file is actually there.
> 
> The second parameter should be BaseFont.IDENTITY_H or
> BaseFont.IDENTITY_V (As you can read at the bottom of Chapter 9
> of the tutorial marked with 'Important').
> 
> As I already mentioned, the third parameter will be ignored.
> A subset of the font will be embedded.
> 
> Bruno
> 
����^�����)�{(��[��58�y�������W\zYi����Z��!z����QHm��?�
0�za�x�r����)��.�ǟ��ַ�r�^��7��"M�m�笶*'�f��)��+-�7�����ب��b��,���y�+��޶m����+-��.�ǟ�����+-��b�ا~���m�笶*'


Reply via email to