home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / x / motif / 5665 < prev    next >
Encoding:
Text File  |  1992-08-17  |  3.1 KB  |  97 lines

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!stanford.edu!agate!boulder!gandalf.colorado.edu!devin
  3. From: devin@gandalf.colorado.edu (Sonja Orlavski)
  4. Subject: XmStringDraw causes BadFont error
  5. Message-ID: <1992Aug17.220708.28620@colorado.edu>
  6. Followup-To: comp.windows.x.motif
  7. Keywords: XmStrings, AAAAAGH!
  8. Sender: news@colorado.edu (The Daily Planet)
  9. Nntp-Posting-Host: gandalf.colorado.edu
  10. Organization: Colorado Center for Astrodynamics Research
  11. Date: Mon, 17 Aug 1992 22:07:08 GMT
  12. Lines: 83
  13.  
  14. Basic info:  OSF Motif 1.1.2, DECstation/Ultrix 4.2a.
  15.  
  16. I'm attempting to use XmStringDraw.  I've defined a fontList
  17. which looks like this:
  18.  
  19. TSho*Image.fontList: \
  20. -*-courier-*-r-*-*-10-*-*-*-*-*-*-*=ImageCS-0, \
  21. -*-courier-*-r-*-*-12-*-*-*-*-*-*-*=ImageCS-1, \
  22. -*-courier-*-r-*-*-14-*-*-*-*-*-*-*=ImageCS-2, \
  23. -*-courier-*-r-*-*-18-*-*-*-*-*-*-*=ImageCS-3, \
  24. -*-courier-*-r-*-*-24-*-*-*-*-*-*-*=ImageCS-4, \
  25. -*-symbol-*-r-*-*-10-*-*-*-*-*-*-*=ImageCS-5, \
  26. -*-symbol-*-r-*-*-12-*-*-*-*-*-*-*=ImageCS-6, \
  27. -*-symbol-*-r-*-*-14-*-*-*-*-*-*-*=ImageCS-7, \
  28. -*-symbol-*-r-*-*-18-*-*-*-*-*-*-*=ImageCS-8, \
  29. -*-symbol-*-r-*-*-24-*-*-*-*-*-*-*=ImageCS-9
  30.  
  31. and I've got an XmString that's using a charset of "ImageCS-0".
  32.  
  33. Right before I call XmStringDraw I call dump_fontlist, which
  34. prints something like this:
  35.  
  36. fontlist[  0]
  37.         font = 269447040
  38.         charset = <ImageCS-0>
  39. fontlist[  1]
  40.         font = 269770752
  41.         charset = <ImageCS-1>
  42. fontlist[  2]
  43.         font = 269770880
  44.         charset = <ImageCS-2>
  45. fontlist[  3]
  46.         font = 269771008
  47.         charset = <ImageCS-3>
  48. fontlist[  4]
  49.         font = 269771136
  50.         charset = <ImageCS-4>
  51. fontlist[  5]
  52.         font = 269771264
  53.         charset = <ImageCS-5>
  54. fontlist[  6]
  55.         font = 269771392
  56.         charset = <ImageCS-6>
  57. fontlist[  7]
  58.         font = 269771648
  59.         charset = <ImageCS-7>
  60. fontlist[  8]
  61.         font = 269771520
  62.         charset = <ImageCS-8>
  63. fontlist[  9]
  64.         font = 269771776
  65.         charset = <ImageCS-9>
  66.  
  67. So it looks like I'm getting a proper fontlist.  However,
  68. when I get into XmStringDraw, I get an XError like this:
  69.  
  70. X Error of failed request:  BadFont (invalid Font parameter)
  71.   Major opcode of failed request:  56 (X_ChangeGC)
  72.   Resource id in failed request:  0xffffffff
  73.   Serial number of failed request:  2731
  74.   Current serial number in output stream:  2731
  75.  
  76.  
  77. My call to XmStringDraw looks like this:
  78.  
  79.   XmStringDraw(XtDisplay((Widget)iw), XtWindow((Widget)iw), fontList,
  80.            tb->text, iw->image.textGC, tb->x, tb->y,
  81.            XmStringWidth(fontList, tb->text),
  82.            XmALIGNMENT_BEGINNING, XmSTRING_DIRECTION_L_TO_R, NULL);
  83.  
  84. Where iw is a custom Widget, fontList is an XmFontList, and tb->text
  85. is an XmString.
  86.  
  87. If anyone has any suggestions, I'd be grateful.
  88.  
  89.             -Devin
  90.  
  91. -- 
  92. Devin Hooker (RP90)  (SotM 7/91)  DoD #0034  devin@boulder.colorado.edu  ------
  93. "It's being both that's a bitch."                                      --\--- /
  94. "I wanted to take my brain to hell and back and see what I had left."  \  \ //
  95. "This howling in the distance, it's a captivating sound.                \  \/
  96.         Can't tell if it's ecstasy or pain..."  -DW                      \/
  97.