Allegro Game Engine

  • 渲染UTF8字体的时候,发现取字体是按偏移量的而不是第几个字
ALLEGRO_USTR_INFO info;
const ALLEGRO_USTR *ustr = al_ref_cstr(&info, str.c_str());
int words = al_ustr_length(ustr);
for (int i = 0; i < words; i++) {
    int offset = al_ustr_offset(ustr, i);
    int32_t codepoint = al_ustr_get(ustr, offset);
...
posted @ 2021-11-06 18:31  开学五年级了  阅读(38)  评论(0编辑  收藏  举报