forked from KolibriOS/kolibrios
Update lib font.
git-svn-id: svn://kolibrios.org@5741 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
8a71cf03e6
commit
386e384f8f
@ -15,6 +15,7 @@
|
|||||||
word width_buffer;
|
word width_buffer;
|
||||||
dword file_size;
|
dword file_size;
|
||||||
dword buffer;
|
dword buffer;
|
||||||
|
dword buffer_size;
|
||||||
word block;
|
word block;
|
||||||
dword data;
|
dword data;
|
||||||
dword begin;
|
dword begin;
|
||||||
@ -68,13 +69,15 @@ FONT font = 0;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
:proc_info Form_SELF_FONTS;
|
:proc_info Form_SELF_FONTS;
|
||||||
|
|
||||||
:dword FONT::text(word x,y;dword text1,c;byte size)
|
:dword FONT::text(word x,y;dword text1,c;byte size)
|
||||||
{
|
{
|
||||||
dword len=0;
|
dword len=0;
|
||||||
if(size)if(!changeSIZE(size))return 0;
|
IF(size)IF(!changeSIZE(size))return 0;
|
||||||
GetProcessInfo(#Form_SELF_FONTS, SelfInfo);
|
GetProcessInfo(#Form_SELF_FONTS, SelfInfo);
|
||||||
//tmp_height = height;
|
IF(y>Form_SELF_FONTS.cheight) return 0;
|
||||||
//tmp_y = 0;
|
IF(x>Form_SELF_FONTS.cwidth) return 0;
|
||||||
|
tmp_y = y;
|
||||||
AX = c;
|
AX = c;
|
||||||
r = AL;
|
r = AL;
|
||||||
g = AH;
|
g = AH;
|
||||||
@ -83,7 +86,8 @@ FONT font = 0;
|
|||||||
b = AL;
|
b = AL;
|
||||||
width_buffer = width;
|
width_buffer = width;
|
||||||
width_buffer *= strlen(text1);
|
width_buffer *= strlen(text1);
|
||||||
buffer = malloc(width_buffer*height);
|
IF(!buffer_size)buffer = malloc(width_buffer*height);
|
||||||
|
ELSE IF(buffer_size<width_buffer*height)buffer = realloc(width_buffer*height);
|
||||||
width_buffer /= 3;
|
width_buffer /= 3;
|
||||||
CopyScreen(buffer,x+Form_SELF_FONTS.left+5,y+Form_SELF_FONTS.top+GetSkinHeight(),width_buffer,height);
|
CopyScreen(buffer,x+Form_SELF_FONTS.left+5,y+Form_SELF_FONTS.top+GetSkinHeight(),width_buffer,height);
|
||||||
|
|
||||||
@ -93,7 +97,6 @@ FONT font = 0;
|
|||||||
text1++;
|
text1++;
|
||||||
}
|
}
|
||||||
_PutImage(x,y,width_buffer,height,buffer);
|
_PutImage(x,y,width_buffer,height,buffer);
|
||||||
free(buffer);
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
:dword FONT::textarea(word x,y;dword text1,c;byte size)
|
:dword FONT::textarea(word x,y;dword text1,c;byte size)
|
||||||
@ -105,7 +108,7 @@ FONT font = 0;
|
|||||||
dword xi,yi;
|
dword xi,yi;
|
||||||
dword tmp,_;
|
dword tmp,_;
|
||||||
dword iii;
|
dword iii;
|
||||||
dword ___;
|
dword ___x;
|
||||||
byte rw=0;
|
byte rw=0;
|
||||||
IF(s==32)return width/4;
|
IF(s==32)return width/4;
|
||||||
IF(s==9)return width;
|
IF(s==9)return width;
|
||||||
@ -113,17 +116,11 @@ FONT font = 0;
|
|||||||
iii = 0;
|
iii = 0;
|
||||||
tmp = 4*block*s;
|
tmp = 4*block*s;
|
||||||
tmp +=data;
|
tmp +=data;
|
||||||
WHILE(yi<height)
|
while(yi<height)
|
||||||
{
|
{
|
||||||
xi = 0;
|
xi = 0;
|
||||||
WHILE(xi<width)
|
WHILE(xi<width)
|
||||||
{
|
{
|
||||||
/*IF(x+width>Form_SELF_FONTS.cwidth)
|
|
||||||
{
|
|
||||||
tmp_y+=height;
|
|
||||||
tmp_height += height;
|
|
||||||
tmp_x = x;
|
|
||||||
}*/
|
|
||||||
IF(iii%32) _ >>= 1;
|
IF(iii%32) _ >>= 1;
|
||||||
ELSE
|
ELSE
|
||||||
{
|
{
|
||||||
@ -133,8 +130,8 @@ FONT font = 0;
|
|||||||
IF(_&1)
|
IF(_&1)
|
||||||
{
|
{
|
||||||
IF(xi>rw)rw=xi;
|
IF(xi>rw)rw=xi;
|
||||||
//PixelRGB(x+xi-tmp_x,tmp_y+yi);
|
___x = x+xi;
|
||||||
PixelRGB(x+xi,yi);
|
IF(___x<Form_SELF_FONTS.cwidth)&&(tmp_y+yi<Form_SELF_FONTS.cheight)PixelRGB(x+xi,yi);
|
||||||
}
|
}
|
||||||
xi++;
|
xi++;
|
||||||
iii++;
|
iii++;
|
||||||
|
Loading…
Reference in New Issue
Block a user