Manual Page Result
0
Command: font | Section: 9 | Source: UNIX v10 | File: font.9
FONT(9.5) FONT(9.5)
NAME
font - jerq font layouts
SYNOPSIS
#include <jerq.h>
#include <font.h>
typedef struct Fontchar Fontchar;
typedef struct Font Font;
extern Font defont;
DESCRIPTION
A Font is a character set, stored as a single Bitmap with the charac-
ters placed side-by-side. It is described by the following data struc-
tures.
typedef struct Fontchar {
short x; /* left edge of bits */
unsigned char top; /* first non-zero scan-line */
unsigned char bottom; /* last non-zero scan-line */
char left; /* offset of baseline */
unsigned char width; /* width of baseline */
} Fontchar;
typedef struct Font {
short n; /* number of chars in font */
char height; /* height of bitmap */
char ascent; /* top of bitmap to baseline */
long unused;
Bitmap *bits; /* where the characters are */
Fontchar info[n+1]; /* n+1 character descriptors */
} Font;
Characters in abut exactly, so the displayed width of the character c
is Font.info[c+1].x - Font.info[c].x. The first columns of pixels in a
character overlap the previous character. The upper left corner of the
nonempty columns appears at (x,0) in the bitmap. is the distance to
move horizontally after drawing a character. The font bitmap has a
fixed parameters and may speed up the copying of a character.
Characters are positioned by their upper left corners.
Fonts are stored on disk in binary with byte order that of the termi-
nal. First in the file is the Font structure with bits elided. The
data for the bitmap follows. The header for the bitmap must be in-
ferred from Font.height and Font.info[Font.n].x.
EXAMPLES
Fontchar *i = f->info + c;
bitblt(f->bits, Rect(i->x, i->top, (i+1)->x, i->bottom),
&display, Pt(p.x+i->left, p.y+i->top), fc);
p.x += i->width;
Copy character c from font f to point p with Code F_XOR or F_OR.
For Code use
SEE ALSO
jf(9.1), string(9.3), getfont(9.1)
BUGS
The field is used, by getfont(9.1).
FONT(9.5)