974 // get description's dimensions |
974 // get description's dimensions |
975 tmpdesc:= description; |
975 tmpdesc:= description; |
976 while length(tmpdesc) > 0 do |
976 while length(tmpdesc) > 0 do |
977 begin |
977 begin |
978 tmpline:= tmpdesc; |
978 tmpline:= tmpdesc; |
|
979 EscapeCharA(tmpline, '|'); |
979 SplitByCharA(tmpline, tmpdesc, '|'); |
980 SplitByCharA(tmpline, tmpdesc, '|'); |
|
981 UnEscapeCharA(tmpline, '|'); |
980 if length(tmpline) > 0 then |
982 if length(tmpline) > 0 then |
981 begin |
983 begin |
982 TTF_SizeUTF8(Fontz[font].Handle, PChar(tmpline), @i, @j); |
984 TTF_SizeUTF8(Fontz[font].Handle, PChar(tmpline), @i, @j); |
983 if w < (i + wa) then |
985 if w < (i + wa) then |
984 w:= i + wa; |
986 w:= i + wa; |
1017 // render all description lines |
1019 // render all description lines |
1018 tmpdesc:= description; |
1020 tmpdesc:= description; |
1019 while length(tmpdesc) > 0 do |
1021 while length(tmpdesc) > 0 do |
1020 begin |
1022 begin |
1021 tmpline:= tmpdesc; |
1023 tmpline:= tmpdesc; |
|
1024 EscapeCharA(tmpline, '|'); |
1022 SplitByCharA(tmpline, tmpdesc, '|'); |
1025 SplitByCharA(tmpline, tmpdesc, '|'); |
|
1026 UnEscapeCharA(tmpline, '|'); |
1023 r2:= r; |
1027 r2:= r; |
1024 if length(tmpline) > 0 then |
1028 if length(tmpline) > 0 then |
1025 begin |
1029 begin |
1026 |
1030 |
1027 // Render highlighted caption if there is a ':', |
1031 // Render highlighted caption if there is a ':', |
1028 // from the beginning of the line to (and including) the ':'. |
1032 // from the beginning of the line to (and including) the ':'. |
1029 // With '::', the colons will be suppressed in the final text. |
1033 // With '::', the colons will be suppressed in the final text. |
|
1034 EscapeCharA(tmpline, ':'); |
1030 tmpline2:= _S''; |
1035 tmpline2:= _S''; |
1031 SplitByCharA(tmpline, tmpline2, ':'); |
1036 SplitByCharA(tmpline, tmpline2, ':'); |
1032 if length(tmpline2) > 0 then |
1037 if length(tmpline2) > 0 then |
1033 begin |
1038 begin |
1034 if (tmpline2[1] <> ':') then |
1039 if (tmpline2[1] <> ':') then |
1036 tmpline:= tmpline + ':'; |
1041 tmpline:= tmpline + ':'; |
1037 tmpline3:= tmpline + tmpline2; |
1042 tmpline3:= tmpline + tmpline2; |
1038 end |
1043 end |
1039 else |
1044 else |
1040 tmpline3:= tmpline + Copy(tmpline2, 2, Length(tmpline2)-1); |
1045 tmpline3:= tmpline + Copy(tmpline2, 2, Length(tmpline2)-1); |
|
1046 UnEscapeCharA(tmpline3, ':'); |
1041 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline3)); |
1047 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline3)); |
1042 WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, PChar(tmpline)); |
1048 WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, PChar(tmpline)); |
1043 end |
1049 end |
1044 else |
1050 else |
|
1051 begin |
|
1052 UnEscapeCharA(tmpline, ':'); |
1045 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline)); |
1053 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline)); |
|
1054 end |
1046 end; |
1055 end; |
1047 end; |
1056 end; |
1048 |
1057 |
1049 if length(extra) > 0 then |
1058 if length(extra) > 0 then |
1050 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, PChar(extra)); |
1059 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, PChar(extra)); |