Subversion Repositories Kolibri OS

Rev

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

Rev 5765 Rev 5776
Line 35... Line 35...
35
	dword begin;
35
	dword begin;
36
	dword size_file;
36
	dword size_file;
37
	byte load(...);
37
	byte load(...);
38
	byte symbol(word x;byte s;dword c);
38
	byte symbol(word x;byte s;dword c);
39
	byte symbol_size(byte s);
39
	byte symbol_size(byte s);
40
	dword text(word x,y;dword text1);
40
	dword prepare(word x,y;dword text1);
-
 
41
	void show(word x,y);
41
	byte textcenter(word x,y,w,h;dword txt);
42
	byte textcenter(word x,y,w,h;dword txt);
42
	dword getsize(dword text1);
43
	dword getsize(dword text1);
43
	dword textarea(word x,y;dword text,c);
44
	dword textarea(word x,y;dword text,c);
44
	byte changeSIZE();
45
	byte changeSIZE();
45
	void PixelRGB(word x,y);
46
	void PixelRGB(word x,y);
Line 190... Line 191...
190
		size.width += rw;
191
		size.width += rw;
191
		IF(weight) size.width+=size.TMP_WEIGHT;
192
		IF(weight) size.width+=size.TMP_WEIGHT;
192
		IF(s=='_') size.width--;
193
		IF(s=='_') size.width--;
193
		IF(size.offset_x<0)size.offset_x = X;
194
		IF(size.offset_x<0)size.offset_x = X;
194
}
195
}
195
:dword FONT::text(word x,y;dword text1)
196
:dword FONT::prepare(word x,y;dword text1)
196
{
197
{
197
	signed len=0;
198
	signed len=0;
198
	dword c;
199
	dword c;
199
	word _tmp_h;
200
	word _tmp_h;
200
	c = color;
201
	c = color;
Line 243... Line 244...
243
		len+=symbol(len,DSBYTE[text1]);
244
		len+=symbol(len,DSBYTE[text1]);
244
		IF(weight)len+=math.ceil(size.text/17);
245
		IF(weight)len+=math.ceil(size.text/17);
245
		text1++;
246
		text1++;
246
	}
247
	}
247
	IF (no_bg_copy) && (!color) SmoothFont(buffer, size.width, size.height);
248
	IF (no_bg_copy) && (!color) SmoothFont(buffer, size.width, size.height);
248
	_PutImage(x,y,size.width,size.height,buffer);
-
 
249
	return len;
249
	return len;
250
}
250
}
-
 
251
:void FONT::show(word x,y)
-
 
252
{
-
 
253
	_PutImage(x,y,size.width,size.height,buffer);
-
 
254
}
251
inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; }
255
inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; }
252
:void SmoothFont(dword color_image, w, h)
256
:void SmoothFont(dword image, w, h)
253
{
257
{
254
	byte rr,gg,bb;
258
	byte rr,gg,bb;
255
	dword i,line_w,to, pixel;
259
	dword i,line_w,to, pixel;
256
	line_w = w * 3;
260
	line_w = w * 3;
257
	to = w*h*3 + color_image - line_w - 3;
261
	to = w*h*3 + image - line_w - 3;
258
	for (i = color_image; i < to; i+=3)	{
262
	for (i = image; i < to; i+=3)	{
259
		if (i-color_image%line_w +3 == line_w) continue;
263
		if (i-image%line_w +3 == line_w) continue;
260
		if (b24(i)==0x000000) && (b24(i+3)!=0x000000) && (b24(i+line_w)!=0x000000) && (b24(i+3+line_w)==0x000000)
264
		if (b24(i)==0x000000) && (b24(i+3)!=0x000000) && (b24(i+line_w)!=0x000000) && (b24(i+3+line_w)==0x000000)
261
		{ 
265
		{ 
262
			ShadowImage(i+3, 1, 1, 2);
266
			ShadowImage(i+3, 1, 1, 2);
263
			ShadowImage(i+line_w, 1, 1, 2);
267
			ShadowImage(i+line_w, 1, 1, 2);
264
		}
268
		}