Chapter 13. Examples of I18N
97
13.1.3 Font Preparation
Almost functions related to
XFontStruct
can be easily substituted by
XFontSet
related func
tions.
Fortunately, TWM used a tailored
MyFont
type for font handling. Thus the amount of labor was
decreased. The original
MyFont
definition was:
typedef struct MyFont
{
char *name;
/* name of the font */
XFontStruct *font;
/* font structure */
int height;
/* height of the font */
int y;
/* Y coordinate to draw characters */
} MyFont;
I added a few lines.
typedef struct MyFont
{
char *name;
/* name of the font */
XFontStruct *font;
/* font structure */
XFontSet fontset;
/* fontset structure */
int height;
/* height of the font */
int y;
/* Y coordinate to draw characters */
int ascent;
int descent;
} MyFont;
Then one of the main part of this patch font preparation. The font preparation is done in the
GetFont()
function in
util.c
. This function is almost entirely rewritten.
void
GetFont(font)
MyFont *font;
{
char *deffontname = "fixed";
char **missing_charset_list_return;
int missing_charset_count_return;
char *def_string_return;
XFontSetExtents *font_extents;
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