SUMMARY: I18N Xview font problem. Can't display on other machine?

From: Chiaki Ishikawa (ishikawa@personal-media.co.jp)
Date: Wed Dec 09 1992 - 04:13:46 CST


Here is a summary of the answers I obtained to my question posted a
few weeks ago concerning the use of I18N localized (read Japanese)
XView application on a different machine (non-Sun X server.) The
original SUBJECT was:
        I18N Xview font problem. Can't display on other machine?

I was using Japanese OpenWindows 2.0.3 on Sparcstation and wanted to
run XView application and show the result on a different machine. But
I could not run my XView-based application using other machines as X
server.

This is how I tried to use Japanes "locale".
> xv_init(
> XV_USE_LOCALE, TRUE,
> XV_LC_BASIC_LOCALE, "japanese",
> /**** XV_LC_INPUT_LANG, "japanese",
> XV_LC_DISPLAY_LANG, "japanese", ****/
> XV_INIT_ARGC_PTR_ARGV,&argc,argv,
> NULL);
>

        This is how I tried to use Japanese fonts.
>
> deffont=xv_find(NULL,FONT,
> FONT_FAMILY,FONT_FAMILY_DEFAULT_FIXEDWIDTH,
> FONT_STYLE,FONT_STYLE_BOLD,
> /* from p.12 of JLE SunView to I18N XView (in Japanese) */
> FONT_LOCALE, "japanese",
> 0);

The problem was that the application showed some messages that said it
could not open fonts "lucida"(?) and then dumped core on me.

Here is the summary of answers I obtained from:
        Eng.Sun.COM!akira.ohsone (Akira Ohsone)
        Japan.Sun.COM!Yasuyuki.Nakanishi (Yasuyuki Nakanishi - Sun JTC)

Thank you!

[] Failure of Xview Font open.

        [from my original comment about missing Lucida fonts.]
>>Surprisingly, the font name printed in the error messages from XView
>>library should match to an existing font on the X11 servers on the
>>other machines. (I checked the available fonts on different server by
>>using xlsfonts command.)

XView error messages were slightly misleading, but here is what
happened.

When XView tried to open "japanese" specific font(s), it failed due to
a few reasons (essentially, I didn't have all the fonts, but it was
not entirely clear from the I18N XView messages!). [See later
explanation which Japanese fonts XView was looking for.]

XView library then tried to open the hard-coded "lucida" font set by
default. However, even if the lucida fonts are available (and they
were), it failed since the lucida fonts alone can't satisfy the
requirement to render Japanese text correctly, ugh! (Please note, my
program requested the "japanese" locale.) Apparenlty, the original
(read English-only) XView code assumed that there is no chance of
failing to open "lucida", but in JLE environment, there is. So this is
where XView said that it can't open lucida, etc..

What can a user do in such a case?

Here is what openwindow JLE does for font search. There is a file :

$OPENWINHOME/lib/locale/japanese/OW_FONT_SETS/OpenWindows.fs.

In my original program, the code tries to use Japanese fonts, (and
assuming the size is medium by default), it tried to use the following
font set,

font set
------------------------------------------------------------
FONT_FAMILY_DEFAULT_FIXEDWIDTH-FONT_STYLE_BOLD-14: \
alias,-sun-gothic-bold-r-normal--16-140-75-75-c-140-japanese-0
------------------------------------------------------------

Now, a font set is composed of two fonts, and this is defined later in
the same file. (People who don't have I18N Japanese XView are unlikely
to see these entiries, BTW.)

------------------------------------------------------------
-sun-gothic-bold-r-normal--16-140-75-75-c-140-japanese-0:definition,\
        -sun-gothic-bold-r-normal--16-140-75-75-c-70-jisx0201.1976-0,\
        -sun-gothic-bold-r-normal--16-140-75-75-c-140-jisx0208.1983-0
------------------------------------------------------------

(It turns out, I didn't have these font files on the X server machine
where I wanted to run my application. Of course, Sparcstation on which
the program was compiled had these. But, again, I didn't have exact
idea of which fonts files were being accessed since XView error
message said only mentioned LUCIDA!)

[] Solution.

- I changed the requested FONT_FAMILY name so that the really accessed
font files are on the machine where I wanted the output. This was
possible since I was writing the source code. If you can't change the
behavior of a program since it comes from outside source, try the
following.

- Users can change the description in the file

        $OPENWINHOME/lib/locale/japanese/OW_FONT_SETS/OpenWindows.fs

to accommodate local requirement. It should be "self-evident" how to
modify it :-) if you look at the entries in the file. (I have not
tried this yet. I advise you consult your sys admin and other users.)

Or, you can rewrite the fonts.alias file to make the server use
substituted fonts which XView tries to open. (This may be easier.)

(BTW, don't try to copy the Japanese fonts from your Sparcstation to
other machines without checking the legality of the action. Many
Japanese fonts are provided with restrictive licensing terms and
copying is prohibited if I understand them correctly.)

Also, make sure the following fonts are available to run Xview .
------------------------------------------------------------
-sun-open look cursor-----12-120-75-75-p-160-sunolcursor-1
-sun-open look glyph-----*-*-*-*-*-*-sunolglyph-1
------------------------------------------------------------
(These are available in MIT/R{4,5} XView contribution.)

[] Why XView crashed.

        Now, it is very simple to explain. XView always assumes that
the default fonts are available, but in my application's case, the use
of "japanese" locale invalidated this assumption, and and XFontSet
handle became NULL. This later led to to core dump when it was used to
access font. XView apparently doesn't check for the value of XFontSet.

This is admittedly where future versions of XView, if such things will
come forth, can improve aside from the misleading messages.

[] Why was the size field 0 in xlsfonts output?

[When I tried xlsfonts (from other machine) against the X11/NeWS
server running on the Sparcstation, it showed 0 in size fields of many
font files. I was wondering why.]

Size "0" means that they are scalable fonts. (Type F-3 in Sun's
parlance, and not a bit map font files).

[] Why weren't there fonts.dir and fonts.alias on Sparcstation?

fonts.dir and fonts.alias are used only for the X Consortium's sample
server (or equivalent server made from sample server). X11/NeWS
server has it's own way of handling fonts plus some extensions (such
as F3 scalable font). Thus, fonts.dir, and fonts.alias are absent, and
database files such as

        $OPENWINHOME/lib/locale/japanese/OW_FONT_SETS/OpenWindows.fs

are used instead.

[end of message]



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:54 CDT