Subversion Repositories Kolibri OS

Rev

Rev 5741 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5741 Rev 5742
Line 20... Line 20...
20
	dword data;
20
	dword data;
21
	dword begin;
21
	dword begin;
22
	dword size_file;
22
	dword size_file;
23
	byte load(...);
23
	byte load(...);
24
	byte symbol(word x;byte s;dword c);
24
	byte symbol(word x;byte s;dword c);
-
 
25
	byte symbol_size(byte s);
25
	dword text(word x,y;dword text,c;byte size);
26
	dword text(word x,y;dword text,c;byte size);
-
 
27
	dword text_width(dword text1;byte size);
26
	dword textarea(word x,y;dword text,c;byte size);
28
	dword textarea(word x,y;dword text,c;byte size);
27
	byte changeSIZE(byte size);
29
	byte changeSIZE(byte size);
28
	void PixelRGB(word x,y);
30
	void PixelRGB(word x,y);
29
	dword tmp_y,tmp_height,tmp_x;
31
	dword tmp_y,tmp_height,tmp_x;
30
};
32
};
Line 68... Line 70...
68
		block = math.ceil(height*width/32);
70
		block = math.ceil(height*width/32);
69
		return true;
71
		return true;
70
}
72
}
71
:proc_info Form_SELF_FONTS;
73
:proc_info Form_SELF_FONTS;
Line 72... Line 74...
72
 
74
 
73
:dword FONT::text(word x,y;dword text1,c;byte size)
75
:dword FONT::text_width(dword text1;byte size)
74
{
76
{
75
	dword len=0;
77
	dword len=0;
-
 
78
	IF(size)IF(!changeSIZE(size))return 0;
-
 
79
	WHILE(DSBYTE[text1])
-
 
80
	{
-
 
81
		len += symbol_size(DSBYTE[text1]);
-
 
82
		text1++;
-
 
83
	}
-
 
84
	return len;
-
 
85
}
-
 
86
:byte FONT::symbol_size(byte s)
-
 
87
{
-
 
88
        dword xi,yi;
-
 
89
        dword tmp,_;
-
 
90
        dword iii;
-
 
91
        byte rw=0;
-
 
92
        IF(s==32)return width/4;
-
 
93
		IF(s==9)return width;
-
 
94
        yi = 0;
-
 
95
        iii = 0;
-
 
96
        tmp = 4*block*s;
-
 
97
        tmp +=data;
-
 
98
        WHILE(yi
-
 
99
        {
-
 
100
                xi = 0;
-
 
101
                WHILE(xi
-
 
102
                {
-
 
103
                        IF(iii%32) _ >>= 1;
-
 
104
						ELSE
-
 
105
						{
-
 
106
                                tmp += 4;
-
 
107
                                _ = DSDWORD[tmp];
-
 
108
                        }
-
 
109
                        IF(_&1) IF(xi>rw)rw=xi;
-
 
110
                        xi++;
-
 
111
                        iii++;
-
 
112
                }
-
 
113
                yi++;
-
 
114
        }
-
 
115
        return rw;
-
 
116
}
-
 
117
:dword FONT::text(word x,y;dword text1,c;byte size)
-
 
118
{
-
 
119
	signed len=0;
76
	IF(size)IF(!changeSIZE(size))return 0;
120
	IF(size)IF(!changeSIZE(size))return 0;
77
	GetProcessInfo(#Form_SELF_FONTS, SelfInfo); 
121
	GetProcessInfo(#Form_SELF_FONTS, SelfInfo); 
78
	IF(y>Form_SELF_FONTS.cheight) return 0;
122
	IF(y>Form_SELF_FONTS.cheight) return 0;
79
	IF(x>Form_SELF_FONTS.cwidth) return 0;
123
	IF(x>Form_SELF_FONTS.cwidth) return 0;
80
	tmp_y = y;
124
	tmp_y = y;
Line 84... Line 128...
84
	c>>=16;
128
	c>>=16;
85
	AX = c;
129
	AX = c;
86
	b = AL;
130
	b = AL;
87
	width_buffer = width;
131
	width_buffer = width;
88
	width_buffer *= strlen(text1);
132
	width_buffer *= strlen(text1);
89
	IF(!buffer_size)buffer = malloc(width_buffer*height);
133
	IF(!buffer_size)buffer = malloc(width_buffer*height*3);
90
	ELSE IF(buffer_size
134
	ELSE IF(buffer_size
91
	width_buffer /= 3;
-
 
92
	CopyScreen(buffer,x+Form_SELF_FONTS.left+5,y+Form_SELF_FONTS.top+GetSkinHeight(),width_buffer,height);
135
	CopyScreen(buffer,x+Form_SELF_FONTS.left+5,y+Form_SELF_FONTS.top+GetSkinHeight(),width_buffer,height);
Line 93... Line 136...
93
	
136
	
94
	WHILE(DSBYTE[text1])
137
	WHILE(DSBYTE[text1])
95
	{
138
	{
-
 
139
		symbol(len,DSBYTE[text1],c);
96
		len += symbol(len,DSBYTE[text1],c);
140
		len+=EAX;
97
		text1++;
141
		text1++;
98
	}
142
	}
99
	_PutImage(x,y,width_buffer,height,buffer);
143
	_PutImage(x,y,width_buffer,height,buffer);
100
	return len;
144
	return len;
101
}
145
}
102
:dword FONT::textarea(word x,y;dword text1,c;byte size)
146
:dword FONT::textarea(word x,y;dword text1,c;byte size)
Line 103... Line 147...
103
{
147
{
-
 
148
	
104
	
149
}
105
}
150
 
106
:byte FONT::symbol(signed x;byte s;dword c)
151
:byte FONT::symbol(signed x;byte s;dword c)
107
{
152
{
108
        dword xi,yi;
153
        dword xi,yi;
109
        dword tmp,_;
154
        dword tmp,_;
110
        dword iii;
155
        dword iii;
-
 
156
		dword ___x;
111
		dword ___x;
157
        byte rw=0;
112
        byte rw=0;
158
		x -= 2;
113
        IF(s==32)return width/4;
159
        IF(s==32)return width/4;
114
		IF(s==9)return width;
160
		IF(s==9)return width;
115
        yi = 0;
161
        yi = 0;
Line 129... Line 175...
129
                        }
175
                        }
130
                        IF(_&1)
176
                        IF(_&1)
131
                        {
177
                        {
132
                                IF(xi>rw)rw=xi;
178
                                IF(xi>rw)rw=xi;
133
								___x = x+xi;
179
								___x = x+xi;
134
								IF(___x
180
								IF(___x
135
                        }
181
                        }
136
                        xi++;
182
                        xi++;
137
                        iii++;
183
                        iii++;
138
                }
184
                }
139
                yi++;
185
                yi++;