home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!stanford.edu!agate!boulder!gandalf.colorado.edu!devin
- From: devin@gandalf.colorado.edu (Sonja Orlavski)
- Subject: XmStringDraw causes BadFont error
- Message-ID: <1992Aug17.220708.28620@colorado.edu>
- Followup-To: comp.windows.x.motif
- Keywords: XmStrings, AAAAAGH!
- Sender: news@colorado.edu (The Daily Planet)
- Nntp-Posting-Host: gandalf.colorado.edu
- Organization: Colorado Center for Astrodynamics Research
- Date: Mon, 17 Aug 1992 22:07:08 GMT
- Lines: 83
-
- Basic info: OSF Motif 1.1.2, DECstation/Ultrix 4.2a.
-
- I'm attempting to use XmStringDraw. I've defined a fontList
- which looks like this:
-
- TSho*Image.fontList: \
- -*-courier-*-r-*-*-10-*-*-*-*-*-*-*=ImageCS-0, \
- -*-courier-*-r-*-*-12-*-*-*-*-*-*-*=ImageCS-1, \
- -*-courier-*-r-*-*-14-*-*-*-*-*-*-*=ImageCS-2, \
- -*-courier-*-r-*-*-18-*-*-*-*-*-*-*=ImageCS-3, \
- -*-courier-*-r-*-*-24-*-*-*-*-*-*-*=ImageCS-4, \
- -*-symbol-*-r-*-*-10-*-*-*-*-*-*-*=ImageCS-5, \
- -*-symbol-*-r-*-*-12-*-*-*-*-*-*-*=ImageCS-6, \
- -*-symbol-*-r-*-*-14-*-*-*-*-*-*-*=ImageCS-7, \
- -*-symbol-*-r-*-*-18-*-*-*-*-*-*-*=ImageCS-8, \
- -*-symbol-*-r-*-*-24-*-*-*-*-*-*-*=ImageCS-9
-
- and I've got an XmString that's using a charset of "ImageCS-0".
-
- Right before I call XmStringDraw I call dump_fontlist, which
- prints something like this:
-
- fontlist[ 0]
- font = 269447040
- charset = <ImageCS-0>
- fontlist[ 1]
- font = 269770752
- charset = <ImageCS-1>
- fontlist[ 2]
- font = 269770880
- charset = <ImageCS-2>
- fontlist[ 3]
- font = 269771008
- charset = <ImageCS-3>
- fontlist[ 4]
- font = 269771136
- charset = <ImageCS-4>
- fontlist[ 5]
- font = 269771264
- charset = <ImageCS-5>
- fontlist[ 6]
- font = 269771392
- charset = <ImageCS-6>
- fontlist[ 7]
- font = 269771648
- charset = <ImageCS-7>
- fontlist[ 8]
- font = 269771520
- charset = <ImageCS-8>
- fontlist[ 9]
- font = 269771776
- charset = <ImageCS-9>
-
- So it looks like I'm getting a proper fontlist. However,
- when I get into XmStringDraw, I get an XError like this:
-
- X Error of failed request: BadFont (invalid Font parameter)
- Major opcode of failed request: 56 (X_ChangeGC)
- Resource id in failed request: 0xffffffff
- Serial number of failed request: 2731
- Current serial number in output stream: 2731
-
-
- My call to XmStringDraw looks like this:
-
- XmStringDraw(XtDisplay((Widget)iw), XtWindow((Widget)iw), fontList,
- tb->text, iw->image.textGC, tb->x, tb->y,
- XmStringWidth(fontList, tb->text),
- XmALIGNMENT_BEGINNING, XmSTRING_DIRECTION_L_TO_R, NULL);
-
- Where iw is a custom Widget, fontList is an XmFontList, and tb->text
- is an XmString.
-
- If anyone has any suggestions, I'd be grateful.
-
- -Devin
-
- --
- Devin Hooker (RP90) (SotM 7/91) DoD #0034 devin@boulder.colorado.edu ------
- "It's being both that's a bitch." --\--- /
- "I wanted to take my brain to hell and back and see what I had left." \ \ //
- "This howling in the distance, it's a captivating sound. \ \/
- Can't tell if it's ecstasy or pain..." -DW \/
-