summaryrefslogtreecommitdiff
path: root/src/Graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Graphics.cpp')
-rw-r--r--src/Graphics.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Graphics.cpp b/src/Graphics.cpp
index e05f3fc..fad82df 100644
--- a/src/Graphics.cpp
+++ b/src/Graphics.cpp
@@ -439,8 +439,13 @@ int Graphics::textnwidth(char *s, int n)
break;
if(((char)*s)=='\b')
{
+ if(!s[1]) break;
s++;
continue;
+ } else if(*s == '\x0F') {
+ if(!s[1] || !s[2] || !s[3]) break;
+ s+=3;
+ continue;
}
x += font_data[font_ptrs[(int)(*(unsigned char *)s)]];
n--;
@@ -486,8 +491,14 @@ int Graphics::textwidthx(char *s, int w)
{
if((char)*s == '\b')
{
+ if(!s[1]) break;
s++;
continue;
+ } else if (*s == '\x0F')
+ {
+ if(!s[1] || !s[2] || !s[3]) break;
+ s+=3;
+ continue;
}
cw = font_data[font_ptrs[(int)(*(unsigned char *)s)]];
if (x+(cw/2) >= w)
@@ -547,8 +558,14 @@ int Graphics::textwrapheight(char *s, int width)
}
else if (*s == '\b')
{
+ if(!s[1]) break;
s++;
}
+ else if (*s == '\x0F')
+ {
+ if(!s[1] || !s[2] || !s[3]) break;
+ s+=3;
+ }
else
{
cw = font_data[font_ptrs[(int)(*(unsigned char *)s)]];
@@ -581,8 +598,14 @@ void Graphics::textsize(const char * s, int & width, int & height)
cWidth = 0;
cHeight += FONT_H+2;
}
+ else if (*s == '\x0F')
+ {
+ if(!s[1] || !s[2] || !s[1]) break;
+ s+=3;
+ }
else if (*s == '\b')
{
+ if(!s[1]) break;
s++;
}
else