60 unsigned int palletes_count = 0;
65 va_start(palettes_ptr, pFontFile);
67 while (NULL != (pFontPalette = va_arg(palettes_ptr,
const char *))) {
69 if (pallete_index == -1)
70 Error(
"Unable to open %s", pFontPalette);
94 size_t text_length = text.size();
96 for (
int i = 0; i < text_length; ++i) {
97 unsigned char c = text[i];
105 strncpy(color_code, &text[i + 1], 5);
107 text_color = atoi(color_code);
128 uX_pos += uCharWidth;
129 if (i < text_length) {
140 uint8_t *pPixels = pCharPixels;
141 for (
int y = 0;
y < uCharHeight; ++
y) {
142 for (
int x = 0;
x < uCharWidth; ++
x) {
151 *draw_buff =
Color32(draw_color);
156 draw_buff += line_width - uCharWidth;
168 size_t text_length = text.length();
170 for (
size_t i = 0; i < text_length; ++i) {
178 strncpy(color_code, &text[i + 1], 5);
180 text_color = atoi(color_code);
200 uX_pos += uCharWidth;
201 if (i < text_length) {
212 if (pInString.empty()) {
219 int text_length = text_str.length();
220 for (
int i = 0; i < text_length; ++i) {
221 unsigned char c = text_str[i];
247 int uXOffset,
bool return_on_carriage) {
248 if (pString.empty()) {
254 size_t uStringLen = pString.length();
255 for (
int i = 0; i < uStringLen; ++i) {
256 unsigned char c = test_string[i];
267 if (!return_on_carriage) {
279 size_t str_len = inString.length();
280 unsigned int string_line_width = 0;
281 for (
int i = 0; i < str_len; ++i) {
282 unsigned char c = inString[i];
288 return string_line_width;
303 return string_line_width;
308 return (position < 0) ? 0 : position;
312 size_t uInStrLen = inString.length();
314 if (uInStrLen == 0) {
318 int start_pixel_offset = uX;
319 int string_pixel_Width = uX;
320 int possible_transition_point = 0;
321 for (
int i = 0; i < uInStrLen; ++i) {
330 string_pixel_Width = atoi(digits) + uX;
336 string_pixel_Width = start_pixel_offset;
337 possible_transition_point = i;
347 if (!return_on_carriage) {
355 possible_transition_point = i;
361 if (i > possible_transition_point)
368 string_pixel_Width = start_pixel_offset;
369 if (i > possible_transition_point) {
370 for (
int j = possible_transition_point; j < i; ++j) {
373 if (j > possible_transition_point)
389 bool present_time_transparency,
int max_text_height,
int uFontShadowColor) {
398 size_t v30 = str.length();
403 String string_begin = str;
404 if (max_text_height == 0) {
407 auto string_end = string_begin;
408 auto string_base = string_begin;
410 int out_x = uX + pWindow->
uFrameX;
411 int out_y = uY + pWindow->
uFrameY;
417 char Dest[6] = { 0 };
429 strncpy(Dest, &string_base[v14 + 1], 3);
432 left_margin = atoi(Dest);
433 out_x = uX + pWindow->
uFrameX + left_margin;
438 out_x = uX + pWindow->
uFrameX + left_margin;
439 if (max_text_height != 0) {
446 strncpy(Dest, &string_base[v14 + 1], 5);
448 uFontColor = atoi(Dest);
452 strncpy(Dest, &string_base[v14 + 1], 3);
455 left_margin = atoi(Dest);
458 if (max_text_height != 0) {
467 if (
c ==
'\"' && string_base[v14 + 1] ==
'\"') {
492 }
while (++v14 < v30);
498 Assert(str.length() <
sizeof(text));
499 strcpy(text, str.c_str());
501 size_t pNumLen = strlen(text);
502 if (pNumLen == 0)
return 0;
505 if (pLineWidth < rect_width) {
506 this->
DrawText(pWindow, uX, uY, uColor, text, 0, 0, 0);
510 unsigned int text_width = 0;
517 for (i = 0; i < pNumLen; ++i) {
518 if (text_width >= rect_width) {
544 pNumLen = strlen(text);
552 for (i = 0; i < pNumLen; ++i) {
558 strncpy(Str, &text[i + 1], 3);
573 strncpy(Str, &text[i + 1], 5);
581 strncpy(Str, &text[i + 1], 3);
601 if (i < (
int)pNumLen) {
616 draw_window.
uFrameW = uFrameY +
h - 1;
618 draw_window.
uFrameZ = uFrameX +
w - 1;
624 std::istringstream
stream(work_string);
625 std::getline(
stream, work_string);
628 uint32_t *curr_pixel_pos = &pPixels[
image->GetWidth() * uFrameY];
629 if (!work_string.empty()) {
630 int half_frameX = uFrameX >> 1;
634 int start_str_pos = 0;
635 int currentColor = firstColor;
636 if (work_string[0] ==
'_') {
637 currentFont = pSecondFont;
638 currentColor = secondColor;
642 int line_w = (int)(
w - currentFont->
GetLineWidth(&work_string[start_str_pos])) / 2;
647 work_string,
image->GetWidth());
648 curr_pixel_pos +=
image->GetWidth() * (currentFont->
GetHeight() - 3);
649 std::getline(
stream, work_string);
650 if (work_string.empty()) {
658 if (pString.empty()) {
662 size_t uInStrLen = pString.length();
663 Assert(uInStrLen <
sizeof(
pTmpBuf3));
664 strcpy(
pTmpBuf3.data(), pString.c_str());
665 if (uInStrLen == 0) {
669 int string_pixel_Width = startPixlOff;
670 int start_pixel_offset = startPixlOff;
671 int possible_transition_point = 0;
672 for (
int i = 0; i < uInStrLen; ++i) {
678 strncpy(digits, &
pTmpBuf3[i + 1], 3);
680 string_pixel_Width = atoi(digits) + startPixlOff;
685 string_pixel_Width = start_pixel_offset;
686 possible_transition_point = i;
701 possible_transition_point = i;
705 currentFont = pFontSecond;
710 if (i > possible_transition_point)
716 pTmpBuf3[possible_transition_point] =
'\n';
717 if (currentFont == pFontSecond) {
718 for (
int k = uInStrLen - 1; k >= possible_transition_point + 1; --k) {
722 ++possible_transition_point;
723 pTmpBuf3[possible_transition_point] =
'_';
725 string_pixel_Width = start_pixel_offset;
727 for (
int j = possible_transition_point; j < i; ++j) {
730 if (j > possible_transition_point) {
748 if (text_str.empty()) {
754 size_t uStringLen = test_string.length();
755 for (
size_t i = 0; i < uStringLen; ++i) {
756 unsigned char c = test_string[i];