This commit is contained in:
p.kosyh 2010-10-08 08:32:41 +00:00
parent d2b1023367
commit 3569803b5e
4 changed files with 271 additions and 1609 deletions

File diff suppressed because it is too large Load diff

View file

@ -1759,18 +1759,19 @@ void txt_layout_free(layout_t lay)
}
}
#define TOKEN_NONE 0
#define TOKEN_A 1
#define TOKEN_B 2
#define TOKEN_I 4
#define TOKEN_U 8
#define TOKEN_C 0x10
#define TOKEN_R 0x20
#define TOKEN_J 0x40
#define TOKEN_L 0x80
#define TOKEN_T 0x100
#define TOKEN_D 0x200
#define TOKEN_M 0x400
#define TOKEN_NONE 0x000
#define TOKEN_A 0x001
#define TOKEN_B 0x002
#define TOKEN_I 0x004
#define TOKEN_U 0x008
#define TOKEN_S 0x010
#define TOKEN_C 0x020
#define TOKEN_R 0x040
#define TOKEN_J 0x080
#define TOKEN_L 0x100
#define TOKEN_T 0x200
#define TOKEN_D 0x400
#define TOKEN_M 0x800
#define TOKEN_CLOSE 0x2000
#define TOKEN(x) (x & 0xfff)
@ -1848,6 +1849,16 @@ int get_token(const char *ptr, char **eptr, char **val, int *sp)
return TOKEN_I;
}
break;
case 's':
if (closing) {
*eptr = (char*)ptr + 2;
return TOKEN_S | TOKEN_CLOSE;
}
if (ptr[1] == '>') {
*eptr = (char*)ptr + 2;
return TOKEN_S;
}
break;
case 't':
if (closing) {
*eptr = (char*)ptr + 2;
@ -2725,6 +2736,9 @@ char *process_token(char *ptr, struct layout *layout, struct line *line, struct
} else if (TOKEN(token) == TOKEN_U) {
cnt = &layout->scnt[2];
bit = TTF_STYLE_UNDERLINE;
} else if (TOKEN(token) == TOKEN_S) {
cnt = &layout->scnt[3];
bit = TTF_STYLE_STRIKETHROUGH;
}
if (bit) {

View file

@ -66,6 +66,11 @@ iface.em = function(self, str)
return stead.cat('<i>',str,'</i>');
end;
iface.st = function(self, str)
if str == nil then return nil; end;
return stead.cat('<s>',str,'</s>');
end;
iface.right = function(self, str)
if str == nil then return nil; end;
return stead.cat('<r>',str,'</r>');

View file

@ -210,6 +210,11 @@ function txtem(v)
return iface:em(v)
end
function txtst(v)
if type(v) ~= 'string' then return nil; end;
return iface:st(v)
end
function txtr(v)
if type(v) ~= 'string' then return nil; end;
return iface:right(v)
@ -1907,6 +1912,9 @@ iface = {
under = function(self, str)
return str;
end,
st = function(self, str)
return str;
end,
enum = function(self, n, str)
return n..' - '..str;
end,