Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

xfont_metrics Namespace Reference


Functions

int width (XChar2b const *s, int n, LyXFont const &f)
int XTextWidth (LyXFont const &f, char const *str, int count)
int XTextWidth16 (LyXFont const &f, XChar2b const *str, int count)
void XSetFont (Display *display, GC gc, LyXFont const &f)
 hmm, not a metric ! More...


Function Documentation

int xfont_metrics::width XChar2b const *    s,
int    n,
LyXFont const &    f
 

Definition at line 197 of file xfont_metrics.C.

Referenced by getFontID.

00198 {
00199         if (!lyx_gui::use_gui)
00200                 return n;
00201 
00202         if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
00203                 return ::XTextWidth16(getXFontstruct(f), s, n);
00204         } else {
00205                 // emulate smallcaps since X doesn't support this
00206                 int result = 0;
00207                 static XChar2b c;
00208                 LyXFont smallfont(f);
00209                 smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
00210                 for (int i = 0; i < n; ++i) {
00211                         if (s[i].byte1)
00212                                 c = s[i];
00213                         else {
00214                                 c.byte1 = s[i].byte1;
00215                                 c.byte2 = uppercase(s[i].byte2);
00216                         }
00217                         if (c.byte2 != s[i].byte2) {
00218                                 result += ::XTextWidth16(getXFontstruct(smallfont), &c, 1);
00219                         } else {
00220                                 result += ::XTextWidth16(getXFontstruct(f), &s[i], 1);
00221                 }
00222                 }
00223                 return result;
00224         }
00225 }

void xfont_metrics::XSetFont Display *    display,
GC    gc,
LyXFont const &    f
 

hmm, not a metric !

Definition at line 241 of file xfont_metrics.C.

Referenced by XPainter::text.

00242 {
00243         ::XSetFont(display, gc, getFontID(f));
00244 }

int xfont_metrics::XTextWidth LyXFont const &    f,
char const *    str,
int    count
 

Definition at line 228 of file xfont_metrics.C.

Referenced by XPainter::text.

00229 {
00230         return ::XTextWidth(getXFontstruct(f), str, count);
00231 }

int xfont_metrics::XTextWidth16 LyXFont const &    f,
XChar2b const *    str,
int    count
 

Definition at line 234 of file xfont_metrics.C.

Referenced by XPainter::text.

00235 {
00236         return ::XTextWidth16(getXFontstruct(f), str, count);
00237 }


Generated on Fri Jul 18 01:19:12 2003 for lyx by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002