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