Chapter 13. Examples of I18N
113
for (p=pattern; 1; p++) {
if (!*p) {
if (p2!=NULL && n>1 && n<72) {
*size = n; return p2+1;
} else {
*size = 16; return NULL;
}
} else if (*p==' ') {
if (n>1 && n<72 && p2!=NULL) {
*size = n;
return p2+1;
}
p2=p; n=0;
} else if (*p>='0' && *p<='9' && p2!=NULL) {
n *= 10;
n += *p '0';
} else {
p2=NULL; n=0;
}
}
}
static XFontSet XCreateFontSetWithGuess(Display *d, const char *pattern, char ***miss, int *n_miss, char **def)
{
XFontSet fs;
char *pattern2;
int pixel_size, bufsiz;
char weight[FONT_ELEMENT_SIZE], slant[FONT_ELEMENT_SIZE];
/* No problem?
or 'fs' for pattern analysis */
fs = XCreateFontSet(d, pattern, miss, n_miss, def);
if (fs && !*n_miss) return fs; /* no need for font guessing */
/* for non iso8859 1 language and iso8859 1 specification */
/* This 'fs' is only for pattern analysis. */
if (!fs) {
if (*n_miss) XFreeStringList(*miss);
setlocale(LC_CTYPE, "C");
fs = XCreateFontSet(d, pattern, miss, n_miss, def);
setlocale(LC_CTYPE, "");
}
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved