libnetpbm_draw (3) Linux Manual Page
Table Of Contents
Name
libnetpbm_draw \- Libnetpbm PPM Drawing Function ManualDescription
This reference manual covers functions in the libnetpbm library for drawing images, using the PPM image format and the libnetpbm in-memory image formats.We actually have very little information here; this is mainly a framework for adding documentation later if someone becomes interested in this facility.
The Functions
The functions are all declared in the ppmdraw.h header file.ppmd_point_drawproc
ppmd_setlinetype
ppmd_setlineclip
ppmd_line
ppmd_spline3
ppmd_polyspline
ppmd_circle
ppmd_filledrectangle
ppmd_fill_drawproc
ppmd_fill
ppmd_text
ppmd_text_box
Fonts
The ppmd_text and ppmd_text_box 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.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 ppmd_set_font function.
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’.
Use the ppmddumpfont program to dump the contents of a Ppmdfont file in human readable format.
Use the ppmdmkfont program to generate the ‘standard’ font as a Ppmdfont file. You don’t normally need to do this, because ‘standard’ is built into libnetpbm.
Use the ppmdcfont 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, libnetpbm‘s built-in ‘standard’ font is a good example. In Netpbm source code, you will find the C source file standardppmdfont.c, which was generated from the file standard.ppmdfont by ppmdcfont. You simply use a pointer to the structure that the C file defines as a font handle, just like one you would get from ppmd_read_font.
Font File Format
The font file starts with the characters ‘ppmdfont’ (without the quotation marks) in ASCII.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.
