Project

General

Profile

Feature #984 ยป 0047-sdl3-Replace-TTF_RenderUTF8.-with-TTF_RenderText.patch

Marko Lindqvist, 10/19/2024 07:25 AM

View differences:

client/gui-sdl3/gui_string.c
switch (pstr->render) {
case 0:
text = TTF_RenderUTF8_Shaded(pstr->font,
pstr->text, pstr->fgcol,
text = TTF_RenderText_Shaded(pstr->font,
pstr->text, 0, pstr->fgcol,
pstr->bgcol);
break;
case 1:
text = TTF_RenderUTF8_Solid(pstr->font, pstr->text, pstr->fgcol);
text = TTF_RenderText_LCD(pstr->font, pstr->text, 0,
pstr->fgcol, pstr->bgcol);
break;
case 2:
text = TTF_RenderUTF8_Blended(pstr->font, pstr->text, pstr->fgcol);
text = TTF_RenderText_Blended(pstr->font, pstr->text, 0, pstr->fgcol);
break;
}
client/gui-sdl3/widget_edit.c
char passwd_chr[2] = {'*', '\0'};
edt->input_chain->prev->tsurf =
TTF_RenderUTF8_Blended(edt->pwidget->string_utf8->font,
passwd_chr,
TTF_RenderText_Blended(edt->pwidget->string_utf8->font,
passwd_chr, 0,
edt->pwidget->string_utf8->fgcol);
} else {
edt->input_chain->prev->tsurf =
TTF_RenderUTF8_Blended(edt->pwidget->string_utf8->font,
edt->input_chain->prev->chr,
TTF_RenderText_Blended(edt->pwidget->string_utf8->font,
edt->input_chain->prev->chr, 0,
edt->pwidget->string_utf8->fgcol);
}
edt->true_length += edt->input_chain->prev->tsurf->w;
......
}
edt.end_text_chain->tsurf =
TTF_RenderUTF8_Blended(edit_widget->string_utf8->font,
edt.end_text_chain->chr,
TTF_RenderText_Blended(edit_widget->string_utf8->font,
edt.end_text_chain->chr, 0,
edit_widget->string_utf8->fgcol);
/* create surface for each font in chain and find chain length */
......
const char passwd_chr[2] = {'*', '\0'};
input_chain_tmp->tsurf =
TTF_RenderUTF8_Blended(edit_widget->string_utf8->font,
passwd_chr,
TTF_RenderText_Blended(edit_widget->string_utf8->font,
passwd_chr, 0,
edit_widget->string_utf8->fgcol);
} else {
input_chain_tmp->tsurf =
TTF_RenderUTF8_Blended(edit_widget->string_utf8->font,
input_chain_tmp->chr,
TTF_RenderText_Blended(edit_widget->string_utf8->font,
input_chain_tmp->chr, 0,
edit_widget->string_utf8->fgcol);
}
    (1-1/1)