Operating System - HP-UX
1748042 Members
5054 Online
108757 Solutions
New Discussion юеВ

Re: truetype scalable fonts in hp

 
uiqbal
Advisor

truetype scalable fonts in hp

Hi,
I am trying to load truetype unicode scaleable fonts in hp.

I have started the xfs with path to
/usr/lib/X11/fonts/ms.st already there in the xfs font server configuration and also added tcp/localhost:7000 to fontpath of x server.

I want to display fonts with iso10646-1 encoding so that i take care of most of the internationalization.

I also had a look at .sym files require by fonts and i created an iso10646-1.sym file based on /usr/lib/X11/fonts/TrueType/chinese_s.st/typefaces/ttiso10646-cn.sym -- i am attaching this file for inspection whether it is correct or not.

I have then called ttmkdirs and it created a new entry in charset.dir in ms_st/typefaces directory.
ttiso10646-1.sym 0x00000000C8000001;3,1 iso10646-1 ISO10646-1

Now i am able to do
xlsfonts -fn "*-0-0-0-0-*" | grep iso10646-1

and i get this list, which shows that proper fonts are loaded.

-microsoft-comic sans ms-medium-r-normal--0-0-0-0-p-0-iso10646-1
-microsoft-verdana-bold-i-normal--0-0-0-0-p-0-iso10646-1
-microsoft-verdana-bold-r-normal--0-0-0-0-p-0-iso10646-1
-microsoft-verdana-medium-i-normal--0-0-0-0-p-0-iso10646-1
-microsoft-verdana-medium-r-normal--0-0-0-0-p-0-iso10646-1
-mono-arial-black-r-normal--0-0-0-0-p-0-iso10646-1
-monotype-arial-bold-i-normal--0-0-0-0-p-0-iso10646-1
-monotype-arial-bold-r-normal--0-0-0-0-p-0-iso10646-1
-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso10646-1
-monotype-arial-medium-r-normal--0-0-0-0-p-0-iso10646-1
-monotype-courier new-bold-i-normal--0-0-0-0-m-0-iso10646-1
-monotype-courier new-bold-r-normal--0-0-0-0-m-0-iso10646-1
-monotype-courier new-medium-i-normal--0-0-0-0-m-0-iso10646-1
-monotype-courier new-medium-r-normal--0-0-0-0-m-0-iso10646-1
-monotype-times new roman-bold-i-normal--0-0-0-0-p-0-iso10646-1
-monotype-times new roman-bold-r-normal--0-0-0-0-p-0-iso10646-1
-monotype-times new roman-medium-i-normal--0-0-0-0-p-0-iso10646-1
-monotype-times new roman-medium-r-normal--0-0-0-0-p-0-iso10646-1
-ms-comic sans ms-bold-r-normal--0-0-0-0-p-0-iso10646-1


Now if i draw using the scalable fonts nothing mentionable is drawn and garbage is drawn to screen -- i am using xlib api for rendering fonts.
My questions is am i doing it right with the .sym format, also can somebody give me an idea about .sym file format.
I have tried creating encoding file with some help form solaris dev with solaris format and it works great -- I think the problem most probably is due to encoding .sym file not being in proper format. Can anybody guide me on this?

I also investigated that ms.st fonts have iso10646-1 encoding in them using fontforge utility.

Regards,
rui
10 REPLIES 10
uiqbal
Advisor

Re: truetype scalable fonts in hp

Hi,
Can anybody provide me information on the format of .sym (symbol set file) used by x server? Any hp developer or admin??

Regards,
Raja
Steven E. Protter
Exalted Contributor

Re: truetype scalable fonts in hp

Shalom,

Can you tell me this:

Where did you get these fonts?

Where did you install these fonts?

What configuration document you used?

I'm sure true type fonts can be installed into the font server, but the method would be very different than windows.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
uiqbal
Advisor

Re: truetype scalable fonts in hp

Hi,

TrueType fonts are already provided by hp in directory /usr/lib/X11/fonts/ms.st

I just started the xfs server and it has this font path in /etc/X11/fs/config.

These two link mention about the use of encoding files .sym
http://www.docs.hp.com/en/B1171-90076/ch06s08.html#charset
http://docs.hp.com/en/5187-0701/ch09.html

If you look at this patch PHSS_26975, it has a file ttiso10646-cn.sym. I changed that file a bit to support iso10646-1 and copied it to ms.st/typefaces directory.
I still don't get the truetype fonts? There is no problem with installing, configuring fonts.
I am not able to display unicode truetype fonts with iso10646-1 encoding?

Regards,
rui
Andrew C Fieldsend
Respected Contributor

Re: truetype scalable fonts in hp

Do your applications support UTF-8 directly, as this is apparently necessary for the 10646-1 fonts to be usable. See http://www.cl.cam.ac.uk/~mgk25/unicode.html for FAQs on the subject.

(Apologies if you already know this.)
uiqbal
Advisor

Re: truetype scalable fonts in hp

Hi,
I am using Xlib methods XDrawString16 which requires XChar2b which is 2 byte and i convert my string from utf8 to Xchar2b which is just like breaking ucs2 in two byte format.
This works for linux and solaris(with a new encoding file creation by the name of iso10646-1.enc in /usr/lib/X11/fonts/encodings directory)

That's why i think hp ux system doesn't understand this encoding as there is no .sym file for iso10646-1. Once i put this file, i have all my fonts listed like mentioned above using
xlsfonts -fn "*-0-0-0-0-*" | grep iso10646-1

As i generated this file myself so not sure about it format.

Regards,
Raja
uiqbal
Advisor

Re: truetype scalable fonts in hp

Hi,
I am using Xlib methods XDrawString16 which requires XChar2b which is 2 byte and i convert my string from utf8 to Xchar2b which is just like breaking ucs2 in two byte format.
This works for linux and solaris(with a new encoding file creation by the name of iso10646-1.enc in /usr/lib/X11/fonts/encodings directory)

That's why i think hp ux system doesn't understand this encoding as there is no .sym file for iso10646-1. Once i put this file, i have all my fonts listed like mentioned above using
xlsfonts -fn "*-0-0-0-0-*" | grep iso10646-1

As i generated this file myself so not sure about it format.

Regards,
rui
Steven E. Protter
Exalted Contributor

Re: truetype scalable fonts in hp

Shalom,

Your installation method and source looks sound. Thanks for clearing that up.

Now I'm still having trouble understanding the problem. Can you provide symptoms and any error messages you see?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrew C Fieldsend
Respected Contributor

Re: truetype scalable fonts in hp

Which code points are you using? UCS-2 is a 2-byte fixed-length encoding, which can only handle code points in the Unicode Basic Multilingual Plane (0x0000-0xffff).

Some character sets are defined outside this plane (especially ones which use variant character forms depending on adjacent characters), and UCS-2 will probably corrupt these.
uiqbal
Advisor

Re: truetype scalable fonts in hp

Hi,

I don't see any error messages. The truetype module with xfs seems to be now intelligent enough to generate the XLFDs with iso10646-1 at the end by just putting the .sym file. I want to know, is the attached .sym file in correct format? I put my own stuff in the file like 18N etc, i have also changed it to match ttiso10646-cn.sym w.r.t symbols field. Can you let me know about the format for this?

Is the file in correct format?
SYMBOL SET = 18N
/name = ISO10646-1
/xname = iso10646-1
/pcl char = N
/pcl num = 18
/type = 2
/class = 5
/num chars = 65501
/first code = 32
/last code = 65533
/index = Unicode
/requirements = 00000000C8000001
/platformID = 3
/specificID = 1
/symbols =

Andrew - i am only working with the 2 byte
plane. I don't require CJK at the moment.

Regards,
rui