adding GNU dc ("desk calculator")
[unix-history] / usr.sbin / keymap / lib / setfont.3
CommitLineData
15637ed4
RG
1.\" Contributed to 386bsd 0.1 and later versions
2.\"
3.\" Copyright 1992 by Holger Veit
4.\" May be freely used with Bill Jolitz's port of
5.\" 386bsd and may be included in a 386bsd collection
6.\" as long as binary and source are available and reproduce the above
7.\" copyright.
8.\"
9.\" You may freely modify this code and contribute improvements based
10.\" on this code as long as you don't claim to be the original author.
11.\" Commercial use of this source requires permittance of the copyright
12.\" holder. A general license for 386bsd will override this restriction.
13.\"
14.\" Use at your own risk. The copyright holder or any person who makes
15.\" this code available for the public (administrators of public archives
16.\" for instance) are not responsible for any harm to hardware or software
17.\" that might happen due to wrong application or program faults.
18.\"
19.\" You must have the codriver driver in the same package generated
20.\" into the 386bsd kernel, otherwise this program does not work.
21.\"
22.\" @(#)setfont.3 1.0 (contributed to 386bsd) 10/25/92
23.\"
24.Dd October 25, 1992
25.Dt CONSUTIL 3
26.Os 386bsd 0.2
27.Sh NAME
28.Nm setfont
29.Nd font loading support routine
30.Sh SYNOPSIS
31.Fd #include <sys/ioctl.h>
32.Fd #include <sys/ioctl_pc.h>
33.Fn setfont "const char *path" "int verbose" "int fpage"
34.Sh DESCRIPTION
35.Fn Setfont
36is the recommended high level interface to load fonts into the new style
37console driver
38.Xr co 4 .
39The
40.Fn setfont
41routine loads a bdf font (bitmap distribution format,
42as used by X11 Release 5), checks its validity, and then loads it
43into the console driver into the font page
44.Fa fpage .
45Currently, only pages 0 and 1 are valid. The argument
46.Fa verbose
47writes error messages, if any, to the
48.Dv stderr (see
49.Xr stdio 3 )
50output. If
51.Fa verbose
52is 0, output is suppressed.
53.Sh RETURN VALUES
54On successful execution,
55.Fn setfont
56returns 0, otherwise -1 is returned, and the global variable
57.Va errno
58is set to hold the error code.
59.Sh ERRORS
60The following error codes are used:
61.Bl -tag -width Er
62.It Bq Er ENOENT
63The font file
64.Fa path could not be opened.
65.It Bq Er EFTYPE
66The file contains an improper or unsupported entry, or is not a bdf file.
67.It Bq Er EINVAL
68One of the parameters of a proper entry is not in an acceptable range, e.g.
69the bitmap is larger than 8x16 pixels.
70.El
71There are more error codes which are related to the failure of the
72.Dv VGASFNTMAP
73ioctl (see
74.Xr co 4 ).
75These errors occur with an improper configured or outdated kernel.
76.Pp
77.Sh FILES
78.Bl -tag -width *.bdf -compact
79.It Pa /usr/lib/libconsutil.a
80.Fl l Ar consutil
81library containing setfont
82.El
83.Sh SEE ALSO
84.Xr co 4 ,
85.Xr vgafont 5
86.Sh HISTORY
87The
88.Nm
89font loading function
90.Fn setfont
91is a new feature of the console driver
92.Xr co 4
93of 386bsd 0.2 and later.