From 4e5ae9b95e7a5b6fe3b03f920ca9acc09bb542bd Mon Sep 17 00:00:00 2001 From: pavelyakov Date: Mon, 17 Aug 2015 00:16:17 +0000 Subject: [PATCH] Added library font git-svn-id: svn://kolibrios.org@5730 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../example fonts/compile original font.bat | 10 ++ .../cmm/example fonts/example original font.c | 66 ++++++++++++ .../example fonts/font/Georgia 45px original | Bin 0 -> 46086 bytes .../font/Times New Roman 30px original | Bin 0 -> 39942 bytes .../example fonts/font/Verdana 15px original | Bin 0 -> 16390 bytes programs/cmm/lib/font.h | 95 ++++++++++++++++++ programs/cmm/lib/io.h | 12 ++- programs/cmm/lib/math.h | 25 +++++ 8 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 programs/cmm/example fonts/compile original font.bat create mode 100644 programs/cmm/example fonts/example original font.c create mode 100644 programs/cmm/example fonts/font/Georgia 45px original create mode 100644 programs/cmm/example fonts/font/Times New Roman 30px original create mode 100644 programs/cmm/example fonts/font/Verdana 15px original create mode 100644 programs/cmm/lib/font.h diff --git a/programs/cmm/example fonts/compile original font.bat b/programs/cmm/example fonts/compile original font.bat new file mode 100644 index 0000000000..56b549a5d4 --- /dev/null +++ b/programs/cmm/example fonts/compile original font.bat @@ -0,0 +1,10 @@ +C-- "example original font.c" +@del "example original font" +@rename "example original font.com" "example original font" +kpack "example original" +@del warning.txt +@pause +@rem ====== Automatically add binnary to kolibri.img and then run QEMU ===== +@rem"C:\Program Files (x86)\WinImage\WINIMAGE.exe" D:\Kolibri\work\QEMU\kolibri.img /I /H/Q C:\Users\Leency\Dropbox\CMM\example\example +@rem @cd /d C:\Work\QEMU +@rem C:\Work\QEMU\kolibri_qumu.bat \ No newline at end of file diff --git a/programs/cmm/example fonts/example original font.c b/programs/cmm/example fonts/example original font.c new file mode 100644 index 0000000000..20638dd453 --- /dev/null +++ b/programs/cmm/example fonts/example original font.c @@ -0,0 +1,66 @@ +#define MEMSIZE 0x7E80 + +#include "../lib/font.h" + +byte id,key; + +FONT TimeNewRoman = 0; +FONT Verdana = 0; +void main() +{ + + SetEventMask(1100111b); + + Verdana.load("font/Verdana 15px original"); + font.load("font/Georgia 45px original"); + TimeNewRoman.load("font/Times New Roman 30px original"); + loop() + { + switch(WaitEvent()) + { + case evMouse: + mouse.get(); + + + break; + case evButton: + id=GetButtonID(); + if (id==1) ExitProcess(); + break; + + case evKey: + key = GetKey(); + if (key==013){ //Enter + draw_window(); + + } + break; + + case evReDraw: + draw_window(); + + break; + } + } +} +void draw_window() +{ + proc_info Form; + + int i =0; + DefineAndDrawWindow(215,100,450,500,0x33,0xFFFFFF,"Window header"); + GetProcessInfo(#Form, SelfInfo); + + font.text(0,0,"Georgia 45px original",0x5522DD); + font.text(3,43,"Съешь еще этих мягких французких булок, да выпей чаю. 1234567890",0xDEDEDE); + font.text(0,40,"Съешь еще этих мягких французких булок, да выпей чаю. 1234567890",0x0); + + + font.text(0,80,"Times New Roman 30px original",0x993366); + TimeNewRoman.text(3,113,"Съешь еще этих мягких французких булок, да выпей чаю. 1234567890",0xDEDEDE); + TimeNewRoman.text(0,110,"Съешь еще этих мягких французких булок, да выпей чаю. 1234567890",0x0); + + Verdana.textarea(0,150,"Этот пример демонстрирует возможности шрифта, \rкоторый создан специально для колибриОС.\rВ ближайшее время активно добавляются шрифты.\rРедактировать шрифты можно на сайте: http://font.ga.\rДля редактирования шрифта, шрифт должен быть в несжатом виде,\rтакже соответствовать стандарту!\rВ планах сделать компактный файл,\rкоторый будет содержать разные размеры одного шрифта.\rОригинальный файл (т.е.) не сжатый файл много занимает места,\rпоэтому рекомендую сжимать kpack. Шрифты на заказ https://vk.com/pavelyakov39\rПрорисовка пока что медленная - временно.Кодировка шрифта ANSII.",0x5522DD); + Verdana.text(30,350,"А теперь...",0xAA4444); + font.text(60,370,"До встречи!!!",0xDD4444); +} \ No newline at end of file diff --git a/programs/cmm/example fonts/font/Georgia 45px original b/programs/cmm/example fonts/font/Georgia 45px original new file mode 100644 index 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#HEv@gOFY~2z}|3q+TW2;eD zHe7oFM1B3+Z?3x9eh42Leee(prYg)o<&_Z}7_^1J*rhvPau5*?}qB2o3$N zhs07XnK>DN_G$84C5f@Xn1Vd8&gH|w5aOn0V#0136()r>&@nzJ?UhE6Da$F2Whu&0 zq@>Wpbu@0Lw%H*DHt|}ndY=85h8WE@tZ)X#)nctSs@tZ4ab&-}eAw0pZ$B^i z&I^L}Z9$}RjO_ZfE=nX@!lAOoA1GV=-MgyF-`T>Yu7-Yt1#Da9pX7Tl5_b-417v=s zy<8cG#hlEh%5hj&FPP@{)I`}~*q4z0l}u6JCN&Q+<@ZU_TL?Lhf_PF5*|13+=RYU! zMKr3CCBUnKg}S&zG9%(rbcyzeEhR5ZX=scLS-j^F1F?hnY+XtYqZx3Bx_XP|;+S?y z*k4@{bURT}je?^6>C3wM!Ce{fFw>#^zWbu2dQrdh=f3`P!H@o3@_pwY#Ms^xV~>%J zAtvZ?+TnJslR%2^2{dodj~A^}P1-iDinoXguTlmXv8kgBK0(UIU!^+5>bSn%SX<)K zw~?qX$_8>peNCxPJp{oSdWLb8dcK2MLCgf33QF|Sucmub(VZTL#R z4EAJIjp<<6u(JI;VS#ZhI?R6l)O%x$F-q+;?q=gia|Tq2nhZL!*Uy|8SMiKrcSfDE zw69CYT}bUxJUUHX6wMf20PXH7(Cux3xePM9+J~i%)3k)ZT8eQ;R}0JJg)QhO!Z|uV zR*5f-GwiF`V?B?`EQ&3bDb3xic#hHA;UaTkU({`VGLvC00vBu?>D>4aiOCM#_!d>n z1_qJp58JVoIuLm27zLH#j|_H=>1kM!s}<2MhB!dLf?6a}i&WO_OsPd|Qm)&TXalC% z3U+wK2&1h8!q#1IC++ZvGMDevqEC1AVeJS%tJIj`aIh=y1^<9|q3V<3riD_uuv^=442uNCsJQ NDw4~eb^nJi{2v8TS4jW> literal 0 HcmV?d00001 diff --git a/programs/cmm/example fonts/font/Times New Roman 30px original b/programs/cmm/example fonts/font/Times New Roman 30px original new file mode 100644 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=6YHr#ZP*NkDF&!3uk z7g6dE#fvDqwIM}0+z#PjlQczi-A+moF9z%AQn5p4!OH>BqH>uKXy$akwT;dY6q*T7$du6ibz_@P=+N`G9NnBCG%Y9>%AMDE8XtN!)Yp{mZN4Yc1!=Z$O|U z4vMeKFwKdtfrKYm!aY24Xk8?zh#k%1cZM*!_jnTpY(5XUbbs&H!1e=B3EI?`+h4mv zX=AS>tj;ldM)me4?Zt<+|MYPi-^KlPh_WN1oWfrB@o3o-vmrl#nupsE{*=JrYf@h1 ze+mX;LuL$b1&!Sd0c#MD>#m)9`f0wF{~VNF2CvsSM*iM^vT(kJ;N4+Pn`)$Z7KOO< zJ0i1%QF$|W9E)KyV>dl$E;&0HqzsK{p&;jD{IZ2I>liZcaGri?M8 z!@*@5K4M-k8qXGf3T{y*RFf6^{w&jBwp5BZjP`>f#(!z?jA1{*uq`-OOA^;*+l{{m zK26pTPx# literal 0 HcmV?d00001 diff --git a/programs/cmm/example fonts/font/Verdana 15px original b/programs/cmm/example fonts/font/Verdana 15px original new file mode 100644 index 0000000000000000000000000000000000000000..42a2b4415dabed48cfdeb5dd52520c04e4da5d4f GIT binary patch literal 16390 zcmeI3J&zno8GzsJZQEnB!sEq4mN@L1^#s04SV4l2v1^t+ZZnR5U`qsq4ll6m+R-2e zM6d^h1S>>9$WIuFKQcHXToG+x?ef&ebWP86^>pvRMf=LPT~qab)%#UdU46H;+`x?m zZY*$Pfg20lSm4G2Hx}5^0+~opM8hQ)>5CXzg^1z-gdzW9?e8h*;0{5D&Gq0I;YhwK za+$f-0}=Yp?~ClYmK{xip&$7d$cLVP5Sks4H>F;~OlEh=Y1DDLlgUvbYG34Qk!d03 z=^ZggOe&ZD12I#PF&xwI815+E6FC%_-*vQy&^{ES8M-CrizM-yxs#an1BPzqgltVK z;Ym9LlJXD!Mo=`v5X4n&A~)Xx*MMFDLm$rnySMsh*dK2Ey9VG!1(}!i5tqRxDs&Bo zo+OwCW}(%J(~DMEZICudje5maX>MzbXck(v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#_D1-hNcU&tkGnpZKE^7r$NZ~&ycyUT= z@n}U{BAF|i(IOb{{|nK6|MB)aD&)gJ`gfiEj-Ms%N8$kXOyM289!Z#hp}E6L{vm%R zn2Q+?YJwz5Rt{9M&fb4UZLUyY6Kt!$i30p|H61>F>`-tdtp+fRfk-Aq-7C{-pj{do zLGRa(aan)=kjWYE52I>J_`ZqM=Uj49HGe@(&1FW`{sq6H(9nmm-=SzGMO<$L0|vBR zVCs=SLF;bsFQGH~x$N%cXQzGn&4l}}LJuFyekT2UVqQHL?oSn_Yz09+xa^;T{ZVc6 zsX1`RPNy{e!?_U zd?nWmcYJ@vdm0OA#r=5wUu0o5L&#vOa1zTq+}{(w&?+yV4?i?EfIfUb!umO{tU9Yo zxchh3FEVd*o%{c-)?cg4yK>eOromJOOsG_dt4=&z#vRi%FB zV&C5c^UzoYmw(Itw+z|Fw{@T)W%z!;7MW4szHZZG(^!#HSs0pM!7T}G=;Ok=&Sq9o z)vgsIm$h1XGmzR;xHK5tQz%hbDC^0^&qS+S@;&LFiZKlB^Ziv*02x^0V8sKp?(3I5 zov_KV=7xbiYinA$>!8KZta<&z0F&1&Jh?nj9HuhOLbI>giRFeh)DE4)Fb(7?zKii= zl%ECxIYPdB6PTu69wC!E-rpOh##9l7P^r5=oRT3;;j=8CI1h!})*l=X(_+*9VTpmI zUpBvCEVy$;DZQqO#ew#qS^vo6#IIzZiu^E>Q~pm3?efQ_Rx7af^XI?I<@nuTzsTC>pH{x` zbw5A6FXfM~CBH6ziJv*~lew_cQP;Xwh<}Di6^v$RO?kA8Kf9AwkVILL4c(hz=wynLKxQD%6EmfYw$2@6(a7wOgV7-rj!!E^=@h literal 0 HcmV?d00001 diff --git a/programs/cmm/lib/font.h b/programs/cmm/lib/font.h new file mode 100644 index 0000000000..afa00f5d51 --- /dev/null +++ b/programs/cmm/lib/font.h @@ -0,0 +1,95 @@ +#ifndef INCLUDE_FONT_H +#define INCLUDE_FONT_H + +#ifndef INCLUDE_MATH_H +#include "../lib/math.h" +#endif + +#ifndef INCLUDE_IO_H +#include "../lib/io.h" +#endif + +:struct FONT +{ + byte width,height,offsetLine; + word block; + dword data; + dword size_file; + byte load(...); + byte symbol(word x,y;byte s;dword c); + dword text(word x,y;dword text,c); + dword textarea(word x,y;dword text,c); +}; +FONT font = 0; +:dword FONT::text(word x,y;dword text1,c) +{ + dword len=0; + WHILE(DSBYTE[text1]) + { + len += symbol(x+len,y,DSBYTE[text1],c); + text1++; + } + return len; +} +:dword FONT::textarea(word x,y;dword text1,c) +{ + dword len=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) +{ + dword xi,yi; + dword tmp,_; + dword iii; + byte rw=0; + IF(offsetLine)y+=offsetLine; + IF(s==32)return width/4; + yi = 0; + iii = 0; + tmp = 4*block*s; + tmp +=data; + while(yi>= 1; + IF(_&1) + { + IF(xi>rw)rw=xi; + PutPixel(x+xi,y+yi,c); + } + xi++; + iii++; + } + yi++; + } + return rw; +} +:byte FONT::load(dword path) +{ + dword tmp; + IF(data)free(data); + tmp = io.read(path); + data = tmp; + size_file = io.FILES_SIZE; + tmp +=size_file; + tmp--; + height = DSBYTE[tmp]; + tmp--; + width = DSBYTE[tmp]; + block = math.ceil(height*width/32); +} + +#endif \ No newline at end of file diff --git a/programs/cmm/lib/io.h b/programs/cmm/lib/io.h index e7147ab32e..038b78216b 100644 --- a/programs/cmm/lib/io.h +++ b/programs/cmm/lib/io.h @@ -279,13 +279,23 @@ byte copy(...); byte move(...); dword set(...); + dword readKPACK(dword path1); dword convert_size(); __DIR dir; __PATH path; __FILE file; ____BDVK BDVK; }io; - +:dword IO::readKPACK(dword path1) +{ + dword sizes; + EAX = 68; + EBX = 27; + ECX = path.path(path1); + EDX = sizes; + $int 0x40; + return EAX; +} :byte __ConvertSize_size_prefix[8]; :dword IO::convert_size() { diff --git a/programs/cmm/lib/math.h b/programs/cmm/lib/math.h index c04408f8c4..5aafee8eeb 100644 --- a/programs/cmm/lib/math.h +++ b/programs/cmm/lib/math.h @@ -15,7 +15,32 @@ float sqrt(float x); float tan(float x); float abs(float x); + float floor(float x); + signed round(float x); + signed ceil(float x); }math; +:signed MATH::round(float x) +{ + x+=0.6; + return x; +} +:signed MATH::ceil(float x) +{ + dword z; + float tmp; + z = x; + tmp = z; + IF(tmp