C:/usr/src/avr/plotter/charset0.c File Reference

#include <avr/pgmspace.h>

Go to the source code of this file.

Variables

PGM_P charset0 [256]


Variable Documentation

PGM_P charset0[256]

This file defines a standard character set by elementary "draw" & "move" commands. The format is a very compact one from the old days where every byte was still appreciated.

A font or character set is an array of strings. Each character corresponds to one of these strings, which is addressed by its ASCII code.

A character is a (NULL-terminated) string of bytes. Each byte codes for a draw or move action according to the code below:

Bit: 7 6 5 4 3 2 1 0 p x x x y y y y

p: Plot flag. If set, "draw to" new point, else "move to" it. xxx: 3-bit unsigned integer (0...7). X coordinate of new point. yyyy: 4-bit unsigned integer (0..15). Y coordinate of new point.

The baseline is y = 4 instead of y = 0, so characters with parts below it can be drawn properly without a need for sign bits. Function "code_to_ucoord()" transforms these coordinates into actual user coordinates.

Example: code for character 'L': "\032\224\324" translates to: moveto(1,10); drawto(1,4); drawto(5,4);

From the example you can conclude that the font below essentially is defined on a 5x7 grid:

0 1 2 3 4 5 6 7 15 . . . . . . . . . : unused 14 . . . . . . . . * : always used 13 . . . . . . . . o : sometimes used 12 . . . . . . . . 11 . . . . . . . . 10 o * * * * * . . 9 o * * * * * . . 8 o * * * * * . . 7 o * * * * * . . 6 o * * * * * . . 5 o * * * * * . . 4 o * * * * * . . 3 o o o o o o . . 2 o o o o o o . . 1 o o o o o o . . 0 o o o o o o . . The following array of strings contains the basic character set (set 0).

NOTE: A nice way to add a new charset would be, e. g., to introduce a ``charset1[]'' as the "alternate" charset and implement the HP-GL commands needed for switching from one to the other.

Definition at line 85 of file charset0.c.


Generated on Sat Jul 4 05:27:39 2009 for motori by  doxygen 1.5.9