diff --git a/programs/cmm/example fonts/font/Verdana source/23 b/programs/cmm/example fonts/font/Verdana source/23 new file mode 100644 index 0000000000..57606ed0ae Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/23 differ diff --git a/programs/cmm/example fonts/font/Verdana source/24 b/programs/cmm/example fonts/font/Verdana source/24 new file mode 100644 index 0000000000..1e94fd8e25 Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/24 differ diff --git a/programs/cmm/example fonts/font/Verdana source/25 b/programs/cmm/example fonts/font/Verdana source/25 new file mode 100644 index 0000000000..8ed2544398 Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/25 differ diff --git a/programs/cmm/example fonts/font/Verdana source/26 b/programs/cmm/example fonts/font/Verdana source/26 new file mode 100644 index 0000000000..0ec42be51b Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/26 differ diff --git a/programs/cmm/example fonts/font/Verdana source/27 b/programs/cmm/example fonts/font/Verdana source/27 new file mode 100644 index 0000000000..0b4783619f Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/27 differ diff --git a/programs/cmm/example fonts/font/Verdana source/28 b/programs/cmm/example fonts/font/Verdana source/28 new file mode 100644 index 0000000000..11e9867b6e Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/28 differ diff --git a/programs/cmm/example fonts/font/Verdana source/29 b/programs/cmm/example fonts/font/Verdana source/29 new file mode 100644 index 0000000000..5363aedd85 Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/29 differ diff --git a/programs/cmm/example fonts/font/Verdana source/30 b/programs/cmm/example fonts/font/Verdana source/30 new file mode 100644 index 0000000000..f718bf328c Binary files /dev/null and b/programs/cmm/example fonts/font/Verdana source/30 differ diff --git a/programs/cmm/example fonts/font/Verdana.kf b/programs/cmm/example fonts/font/Verdana.kf index 1210a1ffd0..83f3f6a104 100644 Binary files a/programs/cmm/example fonts/font/Verdana.kf and b/programs/cmm/example fonts/font/Verdana.kf differ diff --git a/programs/cmm/lib/font.h b/programs/cmm/lib/font.h index 25d27ae68b..e8b346d2b7 100644 --- a/programs/cmm/lib/font.h +++ b/programs/cmm/lib/font.h @@ -11,19 +11,37 @@ :struct FONT { - byte width,height,offsetLine; + byte width,height,offsetLine,r,g,b; + word width_buffer; dword file_size; + dword buffer; word block; dword data; dword begin; dword size_file; byte load(...); - byte symbol(word x,y;byte s;dword c); + byte symbol(word x;byte s;dword c); dword text(word x,y;dword text,c;byte size); dword textarea(word x,y;dword text,c;byte size); byte changeSIZE(byte size); + void PixelRGB(word x,y); + dword tmp_y,tmp_height,tmp_x; }; FONT font = 0; + +:void FONT::PixelRGB(dword x,y) +{ + dword tmp; + tmp = y*width_buffer*3; + tmp += x*3; + tmp += buffer; + + DSBYTE[tmp] = r; + tmp++; + DSBYTE[tmp] = g; + tmp++; + DSBYTE[tmp] = b; +} :byte FONT::changeSIZE(byte size) { dword TMP_DATA; @@ -49,58 +67,74 @@ FONT font = 0; block = math.ceil(height*width/32); return true; } +:proc_info Form_SELF_FONTS; :dword FONT::text(word x,y;dword text1,c;byte size) { dword len=0; if(size)if(!changeSIZE(size))return 0; + GetProcessInfo(#Form_SELF_FONTS, SelfInfo); + //tmp_height = height; + //tmp_y = 0; + AX = c; + r = AL; + g = AH; + c>>=16; + AX = c; + b = AL; + width_buffer = width; + width_buffer *= strlen(text1); + buffer = malloc(width_buffer*height); + width_buffer /= 3; + CopyScreen(buffer,x+Form_SELF_FONTS.left+5,y+Form_SELF_FONTS.top+GetSkinHeight(),width_buffer,height); WHILE(DSBYTE[text1]) { - len += symbol(x+len,y,DSBYTE[text1],c); + len += symbol(len,DSBYTE[text1],c); text1++; } + _PutImage(x,y,width_buffer,height,buffer); + free(buffer); return len; } :dword FONT::textarea(word x,y;dword text1,c;byte size) { - dword len=0; - if(size)if(!changeSIZE(size))return 0; - WHILE(DSBYTE[text1]) - { - IF(DSBYTE[text1]=='\r'){ y+=height; len=0;} - ELSE len += symbol(x+len,y,DSBYTE[text1],c); - text1++; - } - return len; + } -:byte FONT::symbol(signed x,y;byte s;dword c) +:byte FONT::symbol(signed x;byte s;dword c) { dword xi,yi; dword tmp,_; dword iii; + dword ___; byte rw=0; - IF(offsetLine)y+=offsetLine; IF(s==32)return width/4; IF(s==9)return width; yi = 0; iii = 0; tmp = 4*block*s; tmp +=data; - while(yiForm_SELF_FONTS.cwidth) + { + tmp_y+=height; + tmp_height += height; + tmp_x = x; + }*/ + IF(iii%32) _ >>= 1; + ELSE + { tmp += 4; _ = DSDWORD[tmp]; } - ELSE _ >>= 1; IF(_&1) { IF(xi>rw)rw=xi; - PutPixel(x+xi,y+yi,c); + //PixelRGB(x+xi-tmp_x,tmp_y+yi); + PixelRGB(x+xi,yi); } xi++; iii++;