qboolean snap = true;
qboolean least_one = false;
float dw, dh; // display w/h
- float width_of_factor;
const float *width_of;
if (!h) h = w;
// x = snap_to_pixel_x(x, 0.4); // haha, it's 0 anyway
if (fontmap)
- {
- width_of_factor = dw;
width_of = fontmap->width_of;
- }
else
- {
- width_of_factor = dw;
width_of = fnt->width_of;
- }
for (i = 0;((bytes_left = *maxlen - (text - text_start)) > 0) && *text;)
{
if (ch == ' ' && !fontmap)
{
if(!least_one || i0) // never skip the first character
- if(x + width_of[(int) ' '] * width_of_factor > maxwidth)
+ if(x + width_of[(int) ' '] * dw > maxwidth)
{
i = i0;
break; // oops, can't draw this
}
- x += width_of[(int) ' '] * width_of_factor;
+ x += width_of[(int) ' '] * dw;
continue;
}
// i points to the char after ^
map = ft2_oldstyle_map;
prevch = 0;
if(!least_one || i0) // never skip the first character
- if(x + width_of[ch] * width_of_factor > maxwidth)
+ if(x + width_of[ch] * dw > maxwidth)
{
i = i0;
break; // oops, can't draw this
}
- x += width_of[ch] * width_of_factor;
+ x += width_of[ch] * dw;
} else {
if (!map || map == ft2_oldstyle_map || map->start < ch || map->start + FONT_CHARS_PER_MAP >= ch)
{
float pix_x, pix_y;
size_t bytes_left;
float dw, dh;
- float width_of_factor;
const float *width_of;
int tw, th;
pix_y = vid.height / vid_conheight.value;
if (fontmap)
- {
- width_of_factor = dw;
width_of = fontmap->width_of;
- }
else
- {
- width_of_factor = dw;
width_of = fnt->width_of;
- }
for (shadow = r_textshadow.value != 0 && basealpha > 0;shadow >= 0;shadow--)
{
break;
if (ch == ' ' && !fontmap)
{
- x += width_of[(int) ' '] * width_of_factor;
+ x += width_of[(int) ' '] * dw;
continue;
}
if (ch == STRING_COLOR_TAG && !ignorecolorcodes && i < maxlen)
at = texcoord2f;
av = vertex3f;
}
- x += width_of[ch] * width_of_factor;
+ x += width_of[ch] * dw;
} else {
if (!map || map == ft2_oldstyle_map || map->start < ch || map->start + FONT_CHARS_PER_MAP >= ch)
{