Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/sys/doc/netpbm/ms/libnetpbm_draw.ms

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TL
Libnetpbm PPM Drawing Function Manual
.SH 1
Libnetpbm PPM Drawing Function Manual
.LP
Updated: September 2005
.br
.LP
Table Of Contents
<?makeman .SH NAME ?>
<?makeman libnetpbm_draw \- Libnetpbm PPM Drawing Function Manual ?>
<?makeman .SH DESCRIPTION ?>
.LP
This reference manual covers functions in the \fBlibnetpbm\fR
library for drawing images, using the PPM image format and the
\fBlibnetpbm\fR in-memory image formats.
.LP
We actually have very little information here; this is mainly a
framework for adding documentation later if someone becomes interested
in this facility.
.SH 2
The Functions
.LP
.LP
The functions are all declared in the \fBppmdraw.h\fR header file.
.SH 3
\fBppmd_point_drawproc\fR
.LP
.SH 3
\fBppmd_setlinetype\fR
.LP
.SH 3
\fBppmd_setlineclip\fR
.LP
.SH 3
\fBppmd_line\fR
.LP
.SH 3
\fBppmd_spline3\fR
.LP
.SH 3
\fBppmd_polyspline\fR
.LP
.SH 3
\fBppmd_circle\fR
.LP
.SH 3
\fBppmd_filledrectangle\fR
.LP
.SH 3
\fBppmd_fill_init\fR
.LP
.SH 3
\fBppmd_fill_drawproc\fR
.LP
.SH 3
\fBppmd_fill\fR
.LP
.SH 3
\fBppmd_text\fR
.LP
.SH 3
\fBppmd_text_box\fR
.LP
.SH 2
Fonts
.LP
.LP
The \fBppmd_text\fR and \fBppmd_text_box\fR functions use fonts.
You control the fonts using functions described in this section.
There is one font that comes with Netpbm, called "standard".
It is built into the function library and is the default font.  You
can create additional fonts and use them instead.
.LP
In a program that uses Netpbm drawing facilities, there is a
"current font." all drawing of text uses the current font.
When the program starts, the current font is "standard"; you
can change it after that by calling the \fBppmd_setfont\fR function.
.LP
Other than a built-in font, a font lives in file in a format
special to Netpbm called Ppmdfont.  The file typically has a name that
ends in ".ppmdfont".
.LP
Use the \fBppmddumpfont\fR program to dump the contents of a
Ppmdfont file in human readable format.
.LP
Use the \fBppmdmkfont\fR program to generate the "standard"
font as a Ppmdfont file.  You don't normally need to do this, becuase
"standard" is built into \fBlibnetpbm\fR.
.LP
Use the \fBppmdcfont\fR program to turn a Ppmdfont file into a C
source file that you can compile into a program as a built-in font.
Though we don't give full instructions here on how to do that,
\fBlibnetpbm\fR's built-in "standard" font is a good
example.  In Netpbm source code, you will find the C source file
\fBstandardppmdfont.c\fR, which was generated from the file
\fBstandard.ppmdfont\fR by \fBppmdcfont\fR.  You simply use a
pointer to the structure that the C file defines as a font handle,
just like one you would get from \fBppmd_readfont\fR.
.SH 2
Font File Format
.LP
.LP
The font file starts with the characters "ppmdfont" (without
the quotation marks) in ASCII.
.LP
The rest of the format is not yet documented, but it generally
describes, for each code point, a sequence of straight line plotting
commands to form the glyph for the indicated character.  I.e. it is a
vector, not raster, font.
.SH 2
Font Control Functions
.LP
.LP
These functions are declared in the header file \fBppmdfont.h\fR.
.SH 3
\fBppmd_readfont\fR
.LP
.LP
This function associates a Ppmdfont file, which you identify by
naming the Ppmdfont file, with a handle that you can use to identify
the font to other functions.  Technically, this function reads the
font into memory.
.SH 3
\fBppmd_freefont\fR
.LP
.LP
This function releases the handle that you get from
\fBppmd_readfont\fR.  It frees resources associated with it; you
can't use the handle after this.
.SH 3
\fBppmd_getfont\fR
.LP
.LP
This function returns the handle of the currently selected font.
.SH 3
\fBppmd_setfont\fR
.LP
.LP
This function sets the currently selected font.  You identify the
font to which to set it with a handle such as you get from
\fBppmd_readfont\fR or \fBppmd_getfont\fR.
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
The Functions
.IP \(bu
Fonts
.LP

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.