This commit is contained in:
Layla Marchant 2020-07-20 15:11:01 -04:00
parent 5bc3657824
commit 5fa977fb90
1 changed files with 6 additions and 2 deletions

View File

@ -296,6 +296,7 @@ int gfx_renderUnicodeBase(const char *in, int x, int y, int real_x, int fontColo
char testStr[STRMAX];
char remainingStr[STRMAX];
PangoLogAttr logAttrs[STRMAX];
PangoAnalysis *analysis;
int nLogAttrs;
int i;
SDL_Rect area;
@ -356,13 +357,16 @@ int gfx_renderUnicodeBase(const char *in, int x, int y, int real_x, int fontColo
{
nLogAttrs = strlen(remainingStr) + 1;
pango_get_log_attrs(remainingStr, strlen(remainingStr), -1, NULL, logAttrs, nLogAttrs);
pango_default_break(
remainingStr, strlen(remainingStr), NULL, logAttrs, nLogAttrs);
nBreakPoints = 0;
for (i = 0; i < nLogAttrs; i++)
{
if (logAttrs[i].is_line_break)
if (logAttrs[i].is_line_break
&& logAttrs[i].is_char_break)
{
breakPoints[nBreakPoints] = i - 1;
breakPoints[nBreakPoints] = i;
nBreakPoints++;
}
}