4 recognize \- character recognition
8 .ta 4n +4n +4n +4n +4n +4n +4n +4n +4n +4n
14 Scribble *scribblealloc(void);
15 Rune recognize(Scribble *);
19 The scribble library implements simple character recognition.
20 All characters are drawn using a single stroke of the pen (mouse button 1)
21 as on a palmtop computer.
22 A reference card is in
23 .BR /sys/src/libscribble/quickref.gif .
25 The library is not really intended for standalone use. Its primary
26 use is by the scribble graphical control (see
30 allocates and returns an appropriately initialized
35 .ta 4n +4n +4n +4n +4n +4n +4n +4n +4n +4n
38 #define CS_PUNCTUATION 2
54 This structure encodes the points making up the stroke
55 to be recognized, as well as the \f2character group\fP in which
56 the stroke should be searched.
58 There are three such groups:
63 The current group is encoded in the
68 Special strokes are recognized to switch between groups.
69 In addition, the charater recognized is influenced by
71 parameters and modifies them.
72 These are identified by the
83 is non-zero, the character is recognized in the punctuation
86 when the character recognized is printable and
88 is set, the associated control character is returned as if the
89 control key were depressed,
90 and when the character is a letter and
94 is set, the upper-case version is returned.
100 once a character has been recognized; the others are left set.
102 The character to be recognized is encoded as an array of pen_points in the
105 To allow easy drawing of the stroke as it is drawn,
110 fields are available to the application code for storing an array
111 of points for a call to
117 recognizes the character provided in the
122 returns the rune or zero if nothing was recognized.
124 .B /sys/src/libscribble/quickref.gif
125 serves as a quick reference card.
127 .B /sys/lib/scribble/classifiers
128 contains the stroke definitions.
130 .B /sys/src/libscribble
132 This library is adapted from software reproduced by permission:
140 Copyright © 1999 Keith Packard
142 Permission to use, copy, modify, distribute, and sell this software and its
143 documentation for any purpose is hereby granted without fee, provided that
144 the above copyright notice appear in all copies and that both that
145 copyright notice and this permission notice appear in supporting
146 documentation, and that the name of Keith Packard not be used in
147 advertising or publicity pertaining to distribution of the software without
148 specific, written prior permission. Keith Packard makes no
149 representations about the suitability of this software for any purpose. It
150 is provided "as is" without express or implied warranty.
152 Portions of the software Copyright © 1994 by Sun Microsystems Computer Company.
154 Portions of the software Copyright © 2000 by Compaq Computer Corporation.