mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-12 00:39:18 +00:00
77e706c441
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@638 a592a061-630c-0410-9148-cb99ea01b6c8
78 lines
1.3 KiB
C++
78 lines
1.3 KiB
C++
// -*- C++ -*-
|
|
#ifndef FONT_H
|
|
#define FONT_H
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include "LString.h"
|
|
|
|
class LyXFont;
|
|
|
|
//namespace lyx {
|
|
//namespace font {
|
|
|
|
struct lyxfont {
|
|
|
|
static
|
|
int maxAscent(LyXFont const & f);
|
|
|
|
static
|
|
int maxDescent(LyXFont const & f);
|
|
|
|
static
|
|
int ascent(char c, LyXFont const & f);
|
|
|
|
static
|
|
int descent(char c, LyXFont const & f);
|
|
|
|
static
|
|
int lbearing(char c, LyXFont const & f);
|
|
|
|
static
|
|
int rbearing(char c, LyXFont const & f);
|
|
|
|
static
|
|
int width(char c, LyXFont const & f);
|
|
|
|
static
|
|
int width(char const * s, int n, LyXFont const & f);
|
|
|
|
static
|
|
int width(string const & s, LyXFont const & f) {
|
|
if (s.empty()) return 0;
|
|
return width(s.c_str(), s.length(), f);
|
|
}
|
|
|
|
static
|
|
int width(char const * s, LyXFont const & f) {
|
|
return width(s, strlen(s), f);
|
|
}
|
|
|
|
static
|
|
int signedWidth(string const & s, LyXFont const & f);
|
|
|
|
static
|
|
int XTextWidth(LyXFont const & f, char * str, int count);
|
|
|
|
static
|
|
void XSetFont(Display * display, GC gc, LyXFont const & f);
|
|
};
|
|
|
|
//} // end of namespace font
|
|
|
|
// import into namespace lyx
|
|
//using font::maxAscent;
|
|
//using font::maxDescent;
|
|
//using font::ascent;
|
|
//using font::descent;
|
|
//using font::lbearing;
|
|
//using font::rbearing;
|
|
//using font::width;
|
|
//using font::signedWidth;
|
|
//using font::XTextWidth;
|
|
//using font::XSetFont;
|
|
|
|
//} // end of namespace lyx
|
|
|
|
#endif
|