MOON
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 PHP/5.4.10
System: Linux vps.presagepowered.net 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686
User: mckernan (512)
PHP: 5.4.10
Disabled: NONE
Upload Files
File: //usr/share/doc/netpbm-10.35.58/userguide/libnetpbm_draw.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Libnetpbm PPM Drawing Function Manual</TITLE>
<META NAME="manual_section" CONTENT="3">
</HEAD>
<BODY>
<H1>Libnetpbm PPM Drawing Function Manual</H1>
Updated: September 2005
<br>
<p><A HREF="#toc">Table Of Contents</A>
<?makeman .SH NAME ?>
<?makeman libnetpbm_draw \- Libnetpbm PPM Drawing Function Manual ?>
<?makeman .SH DESCRIPTION ?>

<p>This reference manual covers functions in the <b>libnetpbm</b>
library for drawing images, using the PPM image format and the
<b>libnetpbm</b> in-memory image formats.

<p>We actually have very little information here; this is mainly a
framework for adding documentation later if someone becomes interested
in this facility.


<h2 id="functions">The Functions</h2>

<p>The functions are all declared in the <b>ppmdraw.h</b> header file.

<h3><b>ppmd_point_drawproc</b></h3>

<h3><b>ppmd_setlinetype</b></h3>

<h3><b>ppmd_setlineclip</b></h3>

<h3><b>ppmd_line</b></h3>

<h3><b>ppmd_spline3</b></h3>

<h3><b>ppmd_polyspline</b></h3>

<h3><b>ppmd_circle</b></h3>

<h3><b>ppmd_filledrectangle</b></h3>

<h3><b>ppmd_fill_drawproc</b></h3>

<h3><b>ppmd_fill</b></h3>

<h3><b>ppmd_text</b></h3>

<h3><b>ppmd_text_box</b></h3>


<h2 id="fonts">Fonts</h2>

<p>
The <b>ppmd_text</b> and <b>ppmd_text_box</b> functions use fonts.
You control the fonts using functions described in this section.
There is one font that comes with Netpbm, called &quot;standard&quot;.
It is built into the function library and is the default font.  You
can create additional fonts and use them instead.

<p>In a program that uses Netpbm drawing facilities, there is a
&quot;current font.&quot; all drawing of text uses the current font.
When the program starts, the current font is &quot;standard&quot;; you
can change it after that by calling the <b>ppmd_set_font</b> function.

<p>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 &quot;.ppmdfont&quot;.

<p>Use the <b>ppmddumpfont</b> program to dump the contents of a
Ppmdfont file in human readable format.

<p>Use the <b>ppmdmkfont</b> program to generate the &quot;standard&quot;
font as a Ppmdfont file.  You don't normally need to do this, becuase
&quot;standard&quot; is built into <b>libnetpbm</b>.

<p>Use the <b>ppmdcfont</b> 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,
<b>libnetpbm</b>'s built-in &quot;standard&quot; font is a good
example.  In Netpbm source code, you will find the C source file
<b>standardppmdfont.c</b>, which was generated from the file
<b>standard.ppmdfont</b> by <b>ppmdcfont</b>.  You simply use a
pointer to the structure that the C file defines as a font handle,
just like one you would get from <b>ppmd_read_font</b>.


<h2>Font File Format</h2>

<p>The font file starts with the characters &quot;ppmdfont&quot; (without
the quotation marks) in ASCII.

<p>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.


<h2 id="fontcontrol">Font Control Functions</h2>

<p>These functions are declared in the header file <b>ppmdfont.h</b>.

<h3><b>ppmd_read_font</b></h3>

<p>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.

<h3><b>ppmd_free_font</b></h3>

<p>This function releases the handle that you get from
<b>ppmd_read_font</b>.  It frees resources associated with it; you
can't use the handle after this.

<h3><b>ppmd_get_font</b></h3>

<p>This function returns the handle of the currently selected font.

<h3><b>ppmd_set_font</b></h3>

<p>This function sets the currently selected font.  You identify the
font to which to set it with a handle such as you get from
<b>ppmd_read_font</b> or <b>ppmd_get_font</b>.

<HR>
<A NAME="toc">&nbsp;</A>
<H2>Table Of Contents</H2>

<ul>
  <li><a href="#functions">The Functions</a>
  <li><a href="#fonts">Fonts</a>
  </ul>



</BODY>
</HTML>