parts: use ceilf(ch->advance) for text layout

Fixes an issue in English version of Rance 9 where item description text
was overly compressed. Now ChipmunkSpriteEngine.SP_GetFontWidth returns
the same values as the official engine.

There are still text layout bugs with item descriptions in Rance 9
(affecting both JP and EN versions), but this at least makes the text
readable.
This commit is contained in:
Nunuhara Cabbage
2026-08-13 20:14:54 -07:00
parent 0d4eb2a2a7
commit 4e20a499d4
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -250,7 +250,7 @@ static bool ChipmunkSpriteEngine_SP_GetFontWidth(struct string *text, int *width
return true;
}
*width = gfx_size_text(&text_sprite_ts, text->text);
*width = ceilf(gfx_size_text(&text_sprite_ts, text->text));
return true;
}
+3 -2
View File
@@ -133,8 +133,9 @@ static void parts_render_text(struct parts *parts, struct parts_text *t)
struct parts_text_char *ch = &line->chars[j];
mat4 mw_transform = WORLD_TRANSFORM(ch->t.w, ch->t.h, x, y);
Rectangle r = { 0, 0, ch->t.w, ch->t.h };
parts_render_texture(&ch->t, mw_transform, &r, blend_rate, add_color, multiply_color, 0, parts->alpha_clipper_parts_no);
x += ch->advance;
parts_render_texture(&ch->t, mw_transform, &r, blend_rate, add_color,
multiply_color, 0, parts->alpha_clipper_parts_no);
x += ceilf(ch->advance);
}
x = parts->global.pos.x + t->common.origin_offset.x;
y += line->height + t->line_space;