|
|
|
@ -380,7 +380,7 @@ static int TruncateString(char *str, int maxw, bool ignore_setxy, FontSize start
|
|
|
|
|
ddd_w = ddd = GetCharacterWidth(size, '.') * 3;
|
|
|
|
|
|
|
|
|
|
for (ddd_pos = str; (c = Utf8Consume(const_cast<const char **>(&str))) != '\0'; ) {
|
|
|
|
|
if (IsPrintable(c)) {
|
|
|
|
|
if (IsPrintable(c) && !IsTextDirectionChar(c)) {
|
|
|
|
|
w += GetCharacterWidth(size, c);
|
|
|
|
|
|
|
|
|
|
if (w > maxw) {
|
|
|
|
@ -437,7 +437,7 @@ static int GetStringWidth(const UChar *str, FontSize start_fontsize)
|
|
|
|
|
for (;;) {
|
|
|
|
|
c = *str++;
|
|
|
|
|
if (c == 0) break;
|
|
|
|
|
if (IsPrintable(c)) {
|
|
|
|
|
if (IsPrintable(c) && !IsTextDirectionChar(c)) {
|
|
|
|
|
width += GetCharacterWidth(size, c);
|
|
|
|
|
} else {
|
|
|
|
|
switch (c) {
|
|
|
|
@ -687,7 +687,7 @@ uint32 FormatStringLinebreaks(char *str, const char *last, int maxw, FontSize si
|
|
|
|
|
/* whitespace is where we will insert the line-break */
|
|
|
|
|
if (IsWhitespace(c)) last_space = str;
|
|
|
|
|
|
|
|
|
|
if (IsPrintable(c)) {
|
|
|
|
|
if (IsPrintable(c) && !IsTextDirectionChar(c)) {
|
|
|
|
|
int char_w = GetCharacterWidth(size, c);
|
|
|
|
|
w += char_w;
|
|
|
|
|
if (w > maxw) {
|
|
|
|
@ -982,7 +982,7 @@ Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
|
|
|
|
|
for (;;) {
|
|
|
|
|
c = Utf8Consume(&str);
|
|
|
|
|
if (c == 0) break;
|
|
|
|
|
if (IsPrintable(c)) {
|
|
|
|
|
if (IsPrintable(c) && !IsTextDirectionChar(c)) {
|
|
|
|
|
br.width += GetCharacterWidth(size, c);
|
|
|
|
|
} else {
|
|
|
|
|
switch (c) {
|
|
|
|
@ -1081,7 +1081,7 @@ skip_cont:;
|
|
|
|
|
if (c == 0) {
|
|
|
|
|
return x; // Nothing more to draw, get out. And here is the new x position
|
|
|
|
|
}
|
|
|
|
|
if (IsPrintable(c)) {
|
|
|
|
|
if (IsPrintable(c) && !IsTextDirectionChar(c)) {
|
|
|
|
|
if (x >= dpi->left + dpi->width) goto skip_char;
|
|
|
|
|
if (x + _max_char_width >= dpi->left) {
|
|
|
|
|
GfxMainBlitter(GetGlyph(params.fontsize, c), x, y, BM_COLOUR_REMAP);
|
|
|
|
@ -1104,7 +1104,7 @@ skip_cont:;
|
|
|
|
|
params.SetFontSize(FS_SMALL);
|
|
|
|
|
} else if (c == SCC_BIGFONT) { // {BIGFONT}
|
|
|
|
|
params.SetFontSize(FS_LARGE);
|
|
|
|
|
} else {
|
|
|
|
|
} else if (!IsTextDirectionChar(c)) {
|
|
|
|
|
DEBUG(misc, 0, "[utf8] unknown string command character %d", c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|