home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / x / motif / 5992 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.5 KB  |  68 lines

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!ods!chris
  3. From: chris@ods.com (Chris Atkins)
  4. Subject: Re: PLEASE save my hair... FONTS!
  5. Message-ID: <1992Sep3.212323.16496@ods.com>
  6. Organization: Optical Data Systems, Inc.
  7. X-Newsreader: Tin 1.1 PL5
  8. References: <6nxyg6a@rpi.edu>
  9. Date: Thu, 3 Sep 1992 21:23:23 GMT
  10. Lines: 56
  11.  
  12. Ron Cecchini (cecchinr@hornsby.cs.rpi.edu) wrote:
  13. : Hi all,
  14. :  First let me say that I did check all the appropriate sources (Heller, FAQ,
  15. : "knowledgeable" friends, this group, etc.) and I am still ripping my hair out!
  16. :  My questions involve fonts, which I have readily determined to be one of
  17. : the most annoying things known to man...
  18. : Question 1:
  19. : In 50 words or less: What is the precise difference betwen a font and
  20. : a charset, especially w.r.t. an XmString (NOT a widget).
  21. A fontlist is composed of 1 or more fonts.  Each font in the fontlist can be 
  22. given an identifier.  The identifier is called the charset.  For example:
  23. *fontlist: -*-courier-*-r-*--12-*=normal_font, \
  24.            -*-courier-bold-r-*--12-*=bold_font
  25. The above resource defines one fontlist with the charsets normal_font and 
  26. bold_font.  The calls to XmStringCreate, XmStringCreateLtoR and XmStringSegmentCreate take the charset name as a paramater.
  27. : Question 3:
  28. : Given that you can determine a string's font, how do you calculate the
  29. : "bold" version of it?  Do you just substitute a "b" in the charset or
  30. : font (or whatever the hell its called) string?
  31. If you set up the fontlist, you know which charsets are bold and can use the
  32. charset name in you call to XmStringCreate.
  33. : Question 4:
  34. : I want to specify the font (or is it charset?) of a string at
  35. : runtime; i.e. no resource file specifications.
  36. : XLoadQueryFont() returns a font.  What do I use to get a charset
  37. : to specify to XmStringCreate() ?
  38. You set up a resource as shown above.
  39. : Basically, what I am trying to do is create a list of XmStrings (in the
  40. : list widget of a selection box) where some of the strings are of a
  41. : normal (default) font (or is it charset?), and where some of them are
  42. : in bold face.
  43. : The FAQ says that I can do this.  But given that I am having all this
  44. : difficulty just trying to change the font of one darned string, I ain't
  45. : got nothing working yet...
  46.   XmStringCreate(text, "bold_font");
  47.   XmStringCreate(text2, "normal_font");
  48.  
  49. O'Reilly volume 6 Motif programming manual has a very good discussions on this
  50. subject in chapter 19 Compound Strings.
  51.  
  52. Chris Atkins
  53. chris@ods.com
  54. : Thank you very much,
  55. : Ron
  56.