32#define freeglut_return_if_fail(expr) \
34#define freeglut_return_val_if_fail(expr, val) \
35 if (!(expr)) return val;
48 std::cerr <<
"stroke font " << (int)font <<
" not found" << std::endl;
53 const unsigned char*
string =
reinterpret_cast<const unsigned char*
>(string_);
61 if (!
string || !*
string)
return;
68 while ((c = *
string++))
69 if (c < font->Quantity) {
71 glTranslatef(-length, -(
float)(font->
Height), 0.0);
79 for (i = 0; i < schar->
Number; i++, strip++) {
80 glBegin(GL_LINE_STRIP);
81 for (j = 0; j < strip->
Number; j++)
87 length += schar->
Right;
88 glTranslatef(schar->
Right, 0.0f, 0.0f);
98 const unsigned char*
string =
reinterpret_cast<const unsigned char*
>(string_);
101 float this_line_length = 0.0;
106 if (!
string || !*
string)
return 0;
108 while ((c = *
string++))
109 if (c < font->Quantity) {
112 if (length < this_line_length) length = this_line_length;
113 this_line_length = 0.0;
117 if (schar) this_line_length += schar->
Right;
120 if (length < this_line_length) length = this_line_length;
121 return (
int)(length + 0.5);
#define freeglut_return_if_fail(expr)
#define freeglut_return_val_if_fail(expr, val)
const SFG_StrokeFont fgStrokeMonoRoman
static SFG_StrokeFont * fghStrokeByID(FontID font)
void glutStrokeString(FontID fontID, const char *string_)
const SFG_StrokeFont fgStrokeRoman
int glutStrokeLength(FontID fontID, const char *string_)
GLfloat glutStrokeHeight(FontID fontID)