home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.windows.x:19105 comp.windows.x.motif:7460
- Newsgroups: comp.windows.x,comp.windows.x.motif
- 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
- From: stefans@bauv106.bauv.unibw-muenchen.de (Stefan Schwarz)
- Subject: Re: Draw text centering a point??
- Message-ID: <stefans.721646926@bauv106>
- Organization: Universitaet der Bundeswehr Muenchen (Germany)
- References: <1992Nov11.201056.9074@magnus.acs.ohio-state.edu>
- Date: Fri, 13 Nov 1992 09:28:46 GMT
- Lines: 15
-
- yhtao@magnus.acs.ohio-state.edu (Yu-Hui Tao) writes:
-
- >Hi, netters:
-
- > Is there anyway to draw a text in Motif's Drawing area centering one
- >specific point?
-
- Check width and height of your text string with code like the following:
- XFontStruct *fstruct = XQueryFont (display, gc);
- width = (unsigned int) XTextWidth (fstruct, string, strlen(string));
- height = fstruct->ascent;
-
- Now centering should be no problem.
-
- Stefan
- --
- __
- Stefan Schwarz University of the armed forces
- Laboratory for graphical data processing W-8014 Neubiberg, FRG
- --
-