Syntax
[C/C++:]
void gFitCharStr(char string[], float x1, float y1, float x2, float y2, int fit);
[F90:]
subroutine gFitCharStr(string, x1, y1, x2, y2, fit)
character*(*), intent(in) :: string
real, intent(in) :: x1,y1,x2,y2
integer, intent(in) :: fit
Arguments
string
Character string
x1,y1
The absolute coordinates of the start point of fitting line
x2,y2
The absolute coordinates of the end point of fitting line
fit
Fitting type
|
= GB2P, |
Adjust string angle only (default) |
|
= GSIZE, |
Adjust character size and angle |
Description
The routine gFitCharStr() outputs a character string so that it is aligned along an arbitrary line joining the two specified points.
Strings should be terminated by *. otherwise the number of characters is limited to the total length of
string up to a maximum of 256 characters. For example, if string is declared as char [10] then the string will always be terminated after 10 characters, if no intervening *. is encountered.
The characters are drawn subject to the font representation, font weight, italics and underline settings. The string is justified according to the current setting of gSetStrJustify(). Left-justified strings start at the position
x1,y1, centre-justified strings are positioned mid-way between the specified coordinates, and right-justified strings end at the position
x2,y2.
If
fit = GB2P the string angle is adjusted so that the string lies along the arbitrary fitting line but without attempting to fit it to the length of the line. When
fit = GSIZE the character size is adjusted as well as the string angle so that the string fits between the two points. If the string contains more than one line (separated by the *N escape sequence) the character size is based on the longest line in the string.
Any adjustments in the character angle or size are reset to their current values after the string is output.
The character string may contain any of the GINO escape sequences described under gDisplayStr().
If
fit is out of range a warning message is output and
fit is set to GB2P.
See Also
gFitCharStr UsagegSetStrJustifygDisplayStrgReturnStrInfo