| kshow |
(Function funct, String str [, double alpha]) |
typedict.Graphics |
| |
Draws the characters in
str
on
drawable
starting at the current point, which is adjusted as the characters in
str
are printed.
Character outlines come from
font
and are painted using
foreground
and the optional
alpha
argument, which should be a number between
0.0
and
1.0,
as the alpha value.
Omitting
alpha
or supplying a value of
1.0
are equivalent.
kshow
aborts with a
nocurrentpoint
error if
path
is empty.
kshow
always processes the characters in
str
individually, even when
funct
is
NULL,
and is often used to make small positioning adjustments when certain characters,
like
W
and
A
appear next to each other.
The first character in
str
is placed at the current point, which is adjusted horizontally by the
width of that character, but before printing the next character
kshow
calls the function
funct,
if it is not
NULL,
with the character that just printed and the next character as
arguments.
The process stops after the last character in
str
is printed.
| |
| Example: |
The following program,
import yoix.*.*;
Proc(int c0, int c1) {
printf("c0=%c, c1=%c\n", c0, c1);
rmoveto(0, 18); // small vertical move
}
JFrame f = {
paint(Rectangle r) {
graphics.moveto(100, 100);
graphics.kshow(Proc, "abcd");
}
};
f.visible = TRUE;
uses
kshow
to draw the string
abcd
in the frame and also prints
c0=a, c1=b
c0=b, c1=c
c0=c, c1=d
on standard output.
Notice how the
rmoveto
call in
Proc
affects the position of the characters that
kshow
draws in the frame.
| | |
| Return: |
none
| | |
| See Also: |
ashow,
awidthshow,
charpath,
imagepath,
show,
showimage,
stringadvance,
stringbounds,
stringwidth,
widthshow
|
|
Yoix is a registered trademark of AT&T Inc.
|