| 3053 | |
| 3054 | |
| 3055 | static wchar_t* str_to_wstr(const char* str) { |
| 3056 | size_t len = strlen(str) + 1; |
| 3057 | |
| 3058 | wchar_t* wstr = (wchar_t*)malloc(len * sizeof(wchar_t)); |
| 3059 | if (wstr == NULL) { |
| 3060 | perror("Memory allocation failed"); |
| 3061 | return NULL; |
| 3062 | } |
| 3063 | if (mbstowcs(wstr, str, len) == (size_t)-1) { |
| 3064 | perror("Conversion failed"); |
| 3065 | free(wstr); |
| 3066 | return NULL; |
| 3067 | } |
| 3068 | |
| 3069 | return wstr; |
| 3070 | } |
| 3071 | |
| 3072 | LfTextProps lf_text_render(vec2s pos, const char* str, LfFont font, LfColor color, |
| 3073 | int32_t wrap_point, vec2s stop_point, bool no_render, bool render_solid, int32_t start_index, int32_t end_index) { |