GL/X font loading problem under 4.2

GL/X font loading problem under 4.2

Post by Carl Wordelm » Wed, 22 Jan 1997 04:00:00



I've got two 591's running 4.2 with GL (and OpenGL) installed
for GXT1000-002 graphics boxes.  The GL demos run fine, but
the code dies when trying to load multiple X fonts via 'loadXfont'.

The test program below works on our 3.2.5 systems set up for GL, but
won't run on the 591/4.2/GXT1000-002 systems.  I'm reinstallying X stuff
on one, but haven't any real clue what to do with this.  Oh, the
591's give the following response for the code (given below and compiled
with 'cc file.c -lgl -lX11').  

# a.out
found 247 fonts
loading font number 0 -adobe-helvetica-bold-o-normal--0-0-75-75-p-0-iso8859-1
loading font number 1 -adobe-helvetica-bold-o-normal--0-0-75-75-p-0-ucs2.base-0
loading font number 2 -adobe-helvetica-bold-r-normal--0-0-75-75-p-0-iso8859-1
Segmentation fault (core dumped)
#

A huge thanks to anybody who can provide a tip on this one,

-Carl

[file.c]
/* xfonts.c Example C Language Program for GL /
/
xfonts.c
This program demonstrates how to use Enhanced X-Windows
fonts in a GL application
*/
#include <gl/gl.h>
#include <X11/Xlib.h>
#include <stdio.h>
main()
{
  Int32 i, wid;                   /* the GL window ID */
  Display *dpy;                /* structure describing X session*/
  int num_fonts;               /* number of fonts X server found */
  char **fontlist;             /* array of strings
                                  (available font names) */
  prefsize (150,150);
  wid = winopen ("xfonts");
  color (BLACK);
  clear();
  /* get the connection to X */
  /* Normally, the default display is unix:0 */
  dpy = XOpenDisplay ("unix:0");
   /* Get the names of all fonts that might be Helvetica fonts */
   /* (have "helv" appearing in their font name) */
  fontlist = XListFonts (dpy, "*helv*", 1000, &num_fonts);
   /* other useful X font subroutines are:
    * XListFonts
    * XListFontsWithInfo
    * XFreeFontNames
    * XFreeFontInfo
    * XSetFontPath
    * XGetFontPath
    * XFreeFontPath
    */
  /* We have decided, by some criteria, to use the fifth
   * available Helvetica font (assuming that at least five
   * Helvetica fonts are found). We will give it an id of 433.
   */
  if ( num_fonts < 4 ) {
    fprintf (stderr,"Not enough fonts found!!!\n");
    exit (-1);
  }
  printf("found %d fonts\n",num_fonts);
  for(i=0;i<num_fonts;i++)
  {
     printf("loading font number %d %s\n",i,fontlist[i]);
     loadXfont (i, fontlist[i]);
  }
   /* get rid of the font name list */
  XFreeFontNames (fontlist);
   /* we want to use this font to draw a string */
  font (150);   /* do it */
  cmov2 (43.0, 56.0);
  color (RED);
  charstr ("Hello, World");
  sleep (20);

Quote:}

/*
  Changes:
     -  from wid = winopen "xfonts"); to wid = winopen ("xfonts");
*/
--
 
 
 

1. AIX 4.2, kanji fonts, and font 'k14'.

I have an application that wants the fonts 'a14' and 'k14'.

The 'a14' font already exists, and is an alias for
-misc-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-1.

I am told that the 'k14' font is an alias for
-misc-fixed-medium-r-normal--14-*-*-*-*-*-jisx0208.1983-0, but cannot
find any installable X font sets that include the 'jisx0208.1983' registry.

Anybody have a suggestion for where to find this, or what font to use instead?
--
                                Valdis Kletnieks
                                Computer Systems Engineer
                                Virginia Tech

2. Needed: Kernel that works for mol on 603 machine

3. GL differs from 3.25 to 4.2??

4. Intel 82527 CAN-driver

5. WABI 2.1 Won't load MSOffice 4.2, 4.3

6. Unix - Frequently Asked Questions (Contents) [Frequent posting]

7. Vector fonts for IBM GL (AIX 3.1 on RS/6000)

8. Newbie on drivers

9. SGI Font Manager for GL on RS6000

10. Font Manager for GL

11. Linux GL Quake SLOWER than Win95/98 GL Quake?

12. GL-5429 = GL-5428 ?

13. IRIS GL/Open GL implementation