aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/XmbFontImp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/XmbFontImp.cc')
-rw-r--r--src/FbTk/XmbFontImp.cc50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc
index e73670c..557708a 100644
--- a/src/FbTk/XmbFontImp.cc
+++ b/src/FbTk/XmbFontImp.cc
@@ -51,56 +51,6 @@ using std::string;
51 51
52namespace { 52namespace {
53 53
54const char *getFontSize(const char *pattern, int *size) {
55 const char *p;
56 const char *p2=0;
57 int n=0;
58
59 for (p=pattern; 1; p++) {
60 if (!*p) {
61 if (p2!=0 && n>1 && n<72) {
62 *size = n; return p2+1;
63 } else {
64 *size = 16; return 0;
65 }
66 } else if (*p=='-') {
67 if (n>1 && n<72 && p2!=0) {
68 *size = n;
69 return p2+1;
70 }
71 p2=p; n=0;
72 } else if (*p>='0' && *p<='9' && p2!=0) {
73 n *= 10;
74 n += *p-'0';
75 } else {
76 p2=0; n=0;
77 }
78 }
79}
80
81const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) {
82 const char *p, *v;
83 char *p2;
84 va_list va;
85
86 va_start(va, bufsiz);
87 buf[bufsiz-1] = 0;
88 buf[bufsiz-2] = '*';
89 while((v = va_arg(va, char *)) != 0) {
90 p = FbTk::StringUtil::strcasestr(pattern, v);
91 if (p) {
92 strncpy(buf, p+1, bufsiz-2);
93 p2 = strchr(buf, '-');
94 if (p2) *p2=0;
95 va_end(va);
96 return p;
97 }
98 }
99 va_end(va);
100 strncpy(buf, "*", bufsiz);
101 return 0;
102}
103
104XFontSet createFontSet(const char *fontname, bool& utf8mode) { 54XFontSet createFontSet(const char *fontname, bool& utf8mode) {
105 Display *display = FbTk::App::instance()->display(); 55 Display *display = FbTk::App::instance()->display();
106 XFontSet fs; 56 XFontSet fs;