4
* $Id: gtext.h 685 2003-03-08 15:26:51Z travo $
6
* Declare GIST text utilities
9
/* Copyright (c) 1994. The Regents of the University of California.
10
All rights reserved. */
17
/* Return t->alignH, t->alignV, guaranteed not TH_NORMAL or TV_NORMAL */
18
extern void GtGetAlignment(const GpTextAttribs *t,
19
int *alignH, int *alignV);
21
/* Get shape of text input to GdText, given a function Width which can
22
compute the width of a simple text string (no imbedded \n). Returns
23
largest value of Width for any line, and a line count.
24
If gtDoEscapes==1 (default), and Width!=0, the Width function must
25
handle the !, ^, and _ escape sequences.
26
If Width==0, the default Width function is the number of
27
non-escaped characters. */
28
typedef GpReal (*WidthFunction)(const char *text, int nChars,
29
const GpTextAttribs *t);
30
extern int GtTextShape(const char *text, const GpTextAttribs *t,
31
WidthFunction Width, GpReal *widest);
33
/* Return the next line of text-- if text[0] is not '\n' and path not
34
T_UP or T_DOWN, returns text and a count of the characters in the
35
line, nChars (always 1 if T_UP or T_DOWN). If text is '\0', or '\n'
36
with path T_UP or T_DOWN, returns 0. Otherwise, returns text+1 and
37
a count of the number of characters to the next '\n' or '\0'. */
38
extern const char *GtNextLine(const char *text, int *nChars, int path);
40
/* Use ^ (superscript), _ (subscript), and ! (symbol) escape sequences
41
in GpText. These are on (gtDoEscapes==1) by default. */
42
extern int gtDoEscapes;