Subversion Repositories Kolibri OS

Rev

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

Rev 5742 Rev 5745
Line 21... Line 21...
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
	byte symbol_size(byte s);
26
	dword text(word x,y;dword text,c;byte size);
26
	dword text(word x,y;dword text1,c;byte size);
27
	dword text_width(dword text1;byte size);
27
	dword text_width(dword text1;byte size);
28
	dword textarea(word x,y;dword text,c;byte size);
28
	dword textarea(word x,y;dword text,c;byte size);
29
	byte changeSIZE(byte size);
29
	byte changeSIZE(byte size);
30
	void PixelRGB(word x,y);
30
	void PixelRGB(word x,y);
31
	dword tmp_y,tmp_height,tmp_x;
31
	dword tmp_y,tmp_height,tmp_x;
-
 
32
	byte no_bg_copy;
-
 
33
	dword bg_color;
32
};
34
};
33
FONT font = 0;
35
FONT font = 0;
Line 34... Line 36...
34
 
36
 
35
:void FONT::PixelRGB(dword x,y)
37
:void FONT::PixelRGB(dword x,y)
Line 126... Line 128...
126
	r = AL;
128
	r = AL;
127
	g = AH;
129
	g = AH;
128
	c>>=16;
130
	c>>=16;
129
	AX = c;
131
	AX = c;
130
	b = AL;
132
	b = AL;
131
	width_buffer = width;
133
	width_buffer = text_width(text1,size);
132
	width_buffer *= strlen(text1);
134
	//width_buffer *= strlen(text1);
-
 
135
	IF(!buffer_size)
-
 
136
	{
133
	IF(!buffer_size)buffer = malloc(width_buffer*height*3);
137
		buffer_size = width_buffer*height*3;
-
 
138
		buffer = malloc(buffer_size);
-
 
139
	}
134
	ELSE IF(buffer_size
140
	ELSE IF(buffer_size
-
 
141
	{
-
 
142
		buffer_size = width_buffer*height*3;
-
 
143
		buffer = realloc(buffer,buffer_size);
-
 
144
	}
-
 
145
	IF (no_bg_copy)
-
 
146
	{
-
 
147
		EBX = bg_color;
-
 
148
		EAX = buffer_size+buffer;
-
 
149
		EDI = buffer;
-
 
150
		WHILE (EDI
-
 
151
		{
-
 
152
			ESDWORD[EDI] = EBX;
-
 
153
			$add edi,3
-
 
154
		}
-
 
155
	}
135
	CopyScreen(buffer,x+Form_SELF_FONTS.left+5,y+Form_SELF_FONTS.top+GetSkinHeight(),width_buffer,height);
156
	ELSE CopyScreen(buffer,x+Form_SELF_FONTS.left+5,y+Form_SELF_FONTS.top+GetSkinHeight(),width_buffer,height);
136
	
-
 
-
 
157
	//width_buffer = text_width(text1);
137
	WHILE(DSBYTE[text1])
158
	WHILE(DSBYTE[text1])
138
	{
159
	{
139
		symbol(len,DSBYTE[text1],c);
160
		symbol(len,DSBYTE[text1],c);
140
		len+=EAX;
161
		len+=EAX;
141
		text1++;
162
		text1++;
Line 187... Line 208...
187
        return rw;
208
        return rw;
188
}
209
}
189
:byte FONT::load(dword path)
210
:byte FONT::load(dword path)
190
{
211
{
191
	dword tmp;
212
	dword tmp;
-
 
213
	buffer_size = 0;
192
	IF(data)free(data);
214
	IF(data)free(data);
193
	tmp = io.read(path);
215
	if (io.read(path)!=0)
-
 
216
	{
-
 
217
		debug("Error while loading font: ");
-
 
218
		debugln(path);
-
 
219
		return 0;
-
 
220
	}
-
 
221
	tmp = io.buffer_data;
194
	data = tmp;
222
	data = tmp;
195
	begin = data;
223
	begin = data;
196
	size_file = io.FILES_SIZE;
224
	size_file = io.FILES_SIZE;
197
	tmp +=size_file;
225
	tmp +=size_file;
198
	tmp--;
226
	tmp--;