home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / windows / x / 19105 < prev    next >
Encoding:
Internet Message Format  |  1992-11-13  |  1.1 KB

  1. Xref: sparky comp.windows.x:19105 comp.windows.x.motif:7460
  2. Newsgroups: comp.windows.x,comp.windows.x.motif
  3. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!LRZnews!bauv106!bauv106!stefans
  4. From: stefans@bauv106.bauv.unibw-muenchen.de (Stefan Schwarz)
  5. Subject: Re: Draw text centering a point??
  6. Message-ID: <stefans.721646926@bauv106>
  7. Organization: Universitaet der Bundeswehr Muenchen (Germany)
  8. References: <1992Nov11.201056.9074@magnus.acs.ohio-state.edu>
  9. Date: Fri, 13 Nov 1992 09:28:46 GMT
  10. Lines: 15
  11.  
  12. yhtao@magnus.acs.ohio-state.edu (Yu-Hui Tao) writes:
  13.  
  14. >Hi, netters:
  15.  
  16. >  Is there anyway to draw a text in Motif's Drawing area centering one
  17. >specific point?
  18.  
  19. Check width and height of your text string with code like the following:
  20.     XFontStruct *fstruct = XQueryFont (display, gc);
  21.     width = (unsigned int) XTextWidth (fstruct, string, strlen(string));
  22.     height = fstruct->ascent;
  23.  
  24. Now centering should be no problem.
  25.  
  26. Stefan
  27. -- 
  28. __
  29. Stefan Schwarz                            University of the armed forces
  30. Laboratory for graphical data processing  W-8014 Neubiberg, FRG
  31. --
  32.