From de54d697dba792f8226969bdeebd9ad845547916 Mon Sep 17 00:00:00 2001 From: "Alexey Teplov (" Date: Mon, 14 Sep 2009 16:17:49 +0000 Subject: [PATCH] A simple fonts_lib library. That library support one font 8x16. git-svn-id: svn://kolibrios.org@1158 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../libraries/fontslib/trunk/build.bat | 5 + .../libraries/fontslib/trunk/font_.asm | 41 ++ .../libraries/fontslib/trunk/font_8x16.fon | Bin 0 -> 4096 bytes .../libraries/fontslib/trunk/font_ex.asm | 213 +++++++ .../libraries/fontslib/trunk/fonts_lib.asm | 540 ++++++++++++++++++ .../libraries/fontslib/trunk/readme.txt | 32 ++ 6 files changed, 831 insertions(+) create mode 100644 programs/develop/libraries/fontslib/trunk/build.bat create mode 100644 programs/develop/libraries/fontslib/trunk/font_.asm create mode 100644 programs/develop/libraries/fontslib/trunk/font_8x16.fon create mode 100644 programs/develop/libraries/fontslib/trunk/font_ex.asm create mode 100644 programs/develop/libraries/fontslib/trunk/fonts_lib.asm create mode 100644 programs/develop/libraries/fontslib/trunk/readme.txt diff --git a/programs/develop/libraries/fontslib/trunk/build.bat b/programs/develop/libraries/fontslib/trunk/build.bat new file mode 100644 index 0000000000..c19b4048f0 --- /dev/null +++ b/programs/develop/libraries/fontslib/trunk/build.bat @@ -0,0 +1,5 @@ +@fasm -m 16384 font_.asm font01.ksf +@fasm -m 65536 fonts_lib.asm +@fasm -m 65536 font_ex.asm font_ex.kex +@kpack font_ex.kex +@kpack fonts_lib.obj \ No newline at end of file diff --git a/programs/develop/libraries/fontslib/trunk/font_.asm b/programs/develop/libraries/fontslib/trunk/font_.asm new file mode 100644 index 0000000000..4af1cb1d5e --- /dev/null +++ b/programs/develop/libraries/fontslib/trunk/font_.asm @@ -0,0 +1,41 @@ +; Copyright (c) 2009, +; All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; * Neither the name of the nor the +; names of its contributors may be used to endorse or promote products +; derived from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname ''AS IS'' AND ANY +; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +; DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;***************************************************************************** + +version_head db 'kf01' ; ⨯ ࠧ ᥣ 4 ᨬ +font_size dd 8 shl 16 +16 ;font_width shl +font_height +font_start dd font_8x16 +; +;font_size dd 16 shl 16 +32 ;font_width shl +font_height +;font_start dd font_16_32 + +dd -1 ; +font_name db 'Kolibri standart font',0 +align 4 +font_8x16: +file 'font_8x16.fon' +;align 4 +;font_16_32: +;file 'font_16x32.fon' \ No newline at end of file diff --git a/programs/develop/libraries/fontslib/trunk/font_8x16.fon b/programs/develop/libraries/fontslib/trunk/font_8x16.fon new file mode 100644 index 0000000000000000000000000000000000000000..f82efc99074a5cb78bb81defce503965f66efb29 GIT binary patch literal 4096 zcmZu!y=xm;5Z9tYQKg79QKcv0$Hs-(I;631j_pn{+hmFDz2D5ddHazY9EYI?FzH@J_o->4>3BTe?^8=BvS(_%s`4bsh1g?wdU*I$p7=D0K75E0 ze&o}`0k)&5&{xrlIDQ*HS<1owjh~KF z|BcxHb~zml`h(GQ`IgBKci+BVpI?9dcK0Ccc>>k>N-eHJ0qjCw`M$roBw*YGaT*3e zm==Kx7zh-yj=o+K#}#d;FGRcwudv>+OcwXzOr&L9E|*q2l20^tDghP$ilV|53_S9| zZwo;9EwhUkE_s3i064$rtUikLew$+FkEI(e0kLlZ19vPk-$W=6TOT-~5sv~8`F)o4 z*}cmf)z9uV;vv_&7f2-~;JJy0(F3USBqf6xV6X7du$ZTk|62;qmKLf`8o&U%5-ub< z+!9(<#?b1s zJ`rh8M|ijSK%^ z^y<}5{CQ!-Uq}yWV9$n()BJ1Zi{ks~;**Q-V&?n9;n4SI3+BI&Y+WGjjAL0Bjeai^ z)t4w8A)*^3|2SM-T~Wome%@VvBBhdl&|Ccv94>JMs6K;wcKw4xl)!8_vGcDo`!p6X@M){q5 z*FR;nyV@&k*Dih{54epsT}Wf>fQ*i zKlcgLc)x=KBarNJ^8oz?&=HvK-2~JT*mLE3*EA=U@24`wBm6I`hkZKD$q9dKu$P z@!Kz7G;7WM#S8oXrB^g~n?G3aN_KB$`gsJKI?&{1QtlWY?(WO)f4 +; All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; * Neither the name of the nor the +; names of its contributors may be used to endorse or promote products +; derived from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname ''AS IS'' AND ANY +; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +; DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;***************************************************************************** + +; ਫ +use32 ; ࠭, ᯮ騩 32 ࠧ來 + org 0x0 ; , ᥣ 0x0 + db 'MENUET01' ; 䨪 ᯮ塞 䠩 (8 ) + dd 0x1 ; ଠ ᯮ塞 䠩 + dd start ; , ⥬ । ࠢ + ; ᫥ 㧪 ਫ + dd mem ; ࠧ ਫ + dd mem ; ꥬ ᯮ㥬 , ⥪ ⢥ 0100 ஢ ୨ 4 + dd mem ; ᯮ ⥪ , ࠧ ⥫ ணࠬ. 設 ⥪ , 㪠 + dd 0x0 ; 㪠⥫ ப ࠬࠬ. + dd way_of_ini +include '../../../../macros.inc' +include '../../box_lib/asm/trunk/editbox_ex.mac' +include '../../box_lib/load_lib.mac' + @use_library ;use load lib macros +start: +;universal load library/librarys +sys_load_libraries l_libs_start,end_l_libs +;if return code =-1 then exit, else nornary work + cmp eax,-1 + jz exit + mcall 40,0x27 ;⠭ ᮡ⨩ + + mov eax,48 + mov ebx,3 + mov ecx,sc + mov edx,sizeof.system_colors + mcall + mov eax,dword [sc.work] + mov dword [con_colors+4],eax + +; mcall 66,1,0 + call [initialization_font] ; 樠 ᯨ᪠ ⮢ + push dword (8 shl 16 +16) ; 㦭 ⮢ ( 㯥 ⮫쪮 816) + call [get_font] + test eax,eax ;諨 ? + jnz exit +;;;;;;;;;;;;;;;;;;;; + mcall 40,0x27 ;⠭ ᮡ⨩ +red_win: + call draw_window ;ࢮ砫쭮 室 ᮢ +align 4 +still: ;᭮ ࠡ稪 + mcall 10 ; ᮡ + dec eax + jz red_win + dec eax + jz key + dec eax + jz button + + push dword edit1 + call [edit_box_mouse] + + jmp still ;᫨ 祣 ᫥ ᭮ 横 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +button: + mcall 17 ; 䨪 ⮩ + test ah,ah ;᫨ ah 0, ३ ࠡ稪 ᮡ⨩ still + jz still +exit: mcall -1 +key: + mcall 2 ;㧨 祭 2 ॣ eax 稬 ⮩ + + push dword edit1 + call [edit_box_key] + + + mcall 13,<20,650>,<40,16>, dword[con_colors+4] + + + push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- न , y - न Y + push dword con_colors ; esp+8 = dd point to color of background and font + push dword text ; esp+4 = dd point to ASCIIZ +; esp+0 = dd back + call [font_draw_on_string] ; 뢥 䠬 + + + jmp still + +;>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +align 4 +draw_window: ;ᮢ ਫ + mcall 12,1 + xor eax,eax ;㫨 eax + mov ebx,50*65536+680 ;[न x]*65536 + [ࠧ x] + mov ecx,30*65536+500 ;[न y]*65536 + [ࠧ y] + mov edx,[sc.work] ; color of work area RRGGBB,8->color gl + or edx,0x34000000 + mov edi,hed + mcall ;ᮢ ਫ + + push dword edit1 + call [edit_box_draw] +; + push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- न , y - न Y + push dword con_colors ; esp+8 = dd point to color of background and font + push dword text; esp+4 = dd point to ASCIIZ +; esp+0 = dd back + call [font_draw_on_string] ; 뢥 䠬 + mov eax,12 ;㭪 12 - / ᮢ . + mov ebx,2 ;㭪 2 - ᮢ . + mcall + ret +;;;;;;;;;;;; +;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +;DATA +l_libs_start: +library01 l_libs library_name, way_of_ini, library_path, system_path, err_message_found_lib, head_f_l, font_import, err_message_import, head_f_i + +library02 l_libs library_name1, way_of_ini, library_path, system_path1, err_message_found_lib1, head_f_l, import_box_lib, err_message_import1, head_f_i + +end_l_libs: + +; +system_path db '/sys/lib/' +library_name db 'fonts_lib.obj',0 + +system_path1 db '/sys/lib/' +library_name1 db 'box_lib.obj',0 + +err_message_found_lib db 'Sorry I cannot load library fonts_lib.obj',0 +err_message_found_lib1 db 'Sorry I cannot load library box_lib.obj',0 + +head_f_i: +head_f_l db 'System error',0 +err_message_import db 'Error on load import library fonts_lib.obj',0 +err_message_import1 db 'Error on load import library box_lib.obj',0 + +align 4 +import_box_lib: + +edit_box_draw dd aEdit_box_draw +edit_box_key dd aEdit_box_key +edit_box_mouse dd aEdit_box_mouse +version_ed dd aVersion_ed + + dd 0 + dd 0 + +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 +aEdit_box_mouse db 'edit_box_mouse',0 +aVersion_ed db 'version_ed',0 + +font_import: +initialization_font dd a_initialization_font +get_font dd a_get_font +free_fulder_info dd a_free_fulder_info +free_font dd a_free_font +font_draw_on_string dd a_font_draw_on_string +show_all_glif dd a_show_all_glif +Version_fn dd a_Version_fn + dd 0,0 + +a_initialization_font db 'initialization_font',0 +a_get_font db 'get_font',0 +a_free_fulder_info db 'free_fulder_info',0 +a_free_font db 'free_font',0 +a_font_draw_on_string db 'font_draw_on_string',0 +a_show_all_glif db 'show_all_glif',0 +a_Version_fn db 'version_fn',0 + + + +edit1 edit_box 350,175,5,0xffffff,0x6f9480,0,0xAABBCC,0,test_leght,text,ed_focus,text_end-text-1,text_end-text-1 + +text db 'ਬ ᯮ짮 ⥪ ⮢ fonts_lib.obj',0 +text_end: +rb 256 +test_leght = ($-text)-1 + +hed db "Font's demo ",0 +align 4 +con_colors dd 0x1E1EFF, 0x96FFCF + +align 4 +sc system_colors +way_of_ini rb 4096 +library_path rb 4096 + +align 4 +i_end: +rb 1024 +mem: + ; \ No newline at end of file diff --git a/programs/develop/libraries/fontslib/trunk/fonts_lib.asm b/programs/develop/libraries/fontslib/trunk/fonts_lib.asm new file mode 100644 index 0000000000..a371471d8b --- /dev/null +++ b/programs/develop/libraries/fontslib/trunk/fonts_lib.asm @@ -0,0 +1,540 @@ +; Copyright (c) 2009, +; All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; * Neither the name of the nor the +; names of its contributors may be used to endorse or promote products +; derived from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname ''AS IS'' AND ANY +; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +; DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;***************************************************************************** + +;Fonts library +; +;;;;;;;;;;;;;;;;;; + +format MS COFF + +public EXPORTS + +section '.flat' code readable align 16 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;Get info about +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +include '../../../../macros.inc' +align 4 +initialization_font: +; esp+0 = dd back +; - - + +pushad + xor eax,eax + inc eax + mov [number_function],eax +;structure is completed + mov eax,70 + mov ebx,dword struct_f_info + mcall +;IF ERROR FT then exit + test eax,eax + jnz .exit +;IF ERROR folder is not found then exit + test ebx,ebx + mov eax,ebx + jnz .exit + +;Get quantity files + mov eax,[buffer_32.quantity_files] + imul eax,304 + add eax,32 ; ?? + push eax ;save eax eax +;init memory + mov eax,68 + mov ebx,11 + mcall + test eax,eax + jz .exit + inc ebx ; ecx + + pop ecx + mov eax,68 + mcall + mov dword [fulder_array_point],eax ;save point for memory's fulder +; eax + mov [buffer_read_d],eax ;point to new array + mov eax,[buffer_32.quantity_files] + mov [read_block],eax +;get in buffer info of files and sub dir current dir + mov eax,70 + mov ebx,dword struct_f_info + mcall +; . + mov ebp, dword [buffer_read_d] ;point to structure + mov ecx, dword [ebp+4] ;- + mov dword [save_ecx],ecx + add ebp, 32 ; + mov dword [save_ebp],ebp +; mov dword [save_point_nt],ebp + cld ; +align 4 +.start_loop: + push ecx + lea edi,[ebp+0x28] ; edi . + xor eax,eax + mov ecx,263 +align 4 +.again: mov al,byte[edi] + test al,al + jz .next_a + dec ecx + inc edi + jnz .again + jmp @f +; repe scasb ; +; jnz @f +;;;; , fnt ) +; sub edi,6 ;.ksf,0 +;;;;;;;;;;;;;;;;;;;;;;; +.next_a: + sub edi,4 ;.ksf,0 + mov esi,dword name_font + mov ecx,name_font_e-name_font + repe cmpsb + jnz @f +;;;;;;;; .. )) +; +; . + call alloc_mem ; +; + mov eax,dword [alloc_memory_point] + lea edi,dword [eax+4] + lea esi,[name_fulder] + mov ecx,name_fuld_end + rep movsb ; + mov al,'/' + stosb + lea esi,[ebp+0x28] ; esi . +align 4 +.loop_b: + lodsb + stosb + test al,al + jnz .loop_b + +; mov edi,name_of_file ; [ebp+0x28] ; edi . +;get in buffer info above own file + xor eax,eax + mov dword [number_function],eax + mov dword [index_start_block],eax ; + mov dword [flags_],eax ; + mov dword [read_block],8 ; 8 + mov dword [buffer_read_d],file_buffer ; + + mov eax,dword [alloc_memory_point] + lea edi,dword [eax+4] + mov dword [offset_to_string],edi + + mov eax,70 + mov ebx,dword struct_f_info + mcall +;;;;;;;;;;;;;;;; + mov eax,ebx + mov eax,dword [file_buffer] + mov ebx,dword [type_fnt] + cmp eax,ebx + jnz @f + +;;;;;;; +; .. +; + + mov dword [save_point_nt],ebp +; mov esi, ebp +; mov ecx,304/4 + + + +;align 4 +;.transfer: +; lodsd +; stosd +; loop .transfer +; add dword [save_point_nt],304 ; +;;; + pop ecx + mov dword [esp+28],0 + popad + ret + + +align 4 +@@: pop ecx + add ebp,304 + dec ecx + jnz .start_loop +; loop .start_loop +; xor eax,eax +;;;;;;;; - . + +align 4 +.exit: mov dword [esp+28],eax +popad +ret + + +align 4 +get_font: +; c +; esp+4 = dd width font shl 16 +hight font +; esp+0 = dd back +pop eax + pop dword [font_x_y] +push eax +; pop eax +; mov dword [font_x_y],eax +pushad + + + + xor eax,eax + mov dword [number_function],eax + mov dword [index_start_block],eax ; + mov dword [flags_],eax ; + mov dword [read_block],8 ; 8 + mov dword [buffer_read_d],file_buffer ; + + mov eax,dword [alloc_memory_point] + lea edi,dword [eax+4] + mov dword [offset_to_string],edi + + +; mov ecx,dword [save_ecx] ; - .. +align 4 +;.start_check: +; push ecx + mov eax,70 + mov ebx,dword struct_f_info + mcall +;;;;;;;;;;;;;;;; + mov eax,ebx + mov eax,dword [file_buffer] + mov ebx,dword [type_fnt] + cmp eax,ebx +; jnz @f + + +; xor eax,eax +; mov dword [number_function],eax +; add eax,8 +; mov dword [read_block],eax +; mov dword [buffer_read_d],file_buffer +; mov ebx,dword struct_f_info +; mov eax,70 +;align 4 +;.start_check: +; . +; lea edi, [ebp+0x28] ; edi . +; mov dword [offset_to_string],edi +;get in buffer info above own file +; mcall +;;;;;;;;;;;;;;;; +; mov ecx,dword [file_buffer.type_fnt] +; mov edx,dword [type_fnt] +; cmp ecx,edx +; jnz @f + + mov ecx,dword [file_buffer.font_size] + mov edx,dword [font_x_y] + cmp ecx,edx +; jnz @f ; +; .. , , + +; mov ebp,dword [save_point_nt] + mov ecx, 4096;dword [ebp+32] ; 4294967296 .. 4 + + mov dword [read_block],ecx + mov eax,68 + mov ebx,12 + mcall + + mov dword [font_array_point],eax ;save point to array + mov dword [buffer_read_d],eax + +;load font + mov ebx,dword struct_f_info + mov eax,70 + mcall + test eax,eax + jnz @f + + lea eax,[buffer_read_d] + mov eax,dword [eax] + mov ebx,dword [eax+8] + add eax,ebx +; add eax,dword [eax+8] +; add eax,dword [buffer_read_d] + mov dword [font_array_data],eax + mov dword [esp+28],0 +; pop ecx +popad +ret + + + + +;here error file system +align 4 +@@: +; pop ecx +; add ebp,304 +; dec ecx + ; jnz .start_check + + or dword [esp+28],-1 ; + popad + ret + + +; +; esp+12= dd x shl 16 + y x- , y - Y +; esp+8 = dd point to color of background and font +; esp+4 = dd point to ASCIIZ +; esp+0 = dd back +align 4 +font_draw_on_string: +pushad + + mov esi,dword [esp+4+32] ;ASCIIZ + mov edx,dword [esp+12+32] ; x shl 16 +y + mov ecx,dword [font_x_y] ; x shl 16 +y + mov edi,dword [esp+8+32] ; + xor ebp,ebp ; 65 )) + + ;;;;;;;;;;;;;;;;;;;;; +; pushad +; mov ebp, dword [esp+4+32+32] +; mov ebp, dword [save_point_nt] +; lea edi, [ebp+0x28] ; edi . +; sub edi,4 ;.ksf,0 +; mov eax,4 +; mov ebx,dword [show_dir] +; add dword [show_dir],10 +; mov ecx,0x80000000;DDBBCC +; mov edx,ebp;[ebp+0x28];eax;edi +; xor esi,esi + ;mov esi,8 +; mcall +; popad +;;;;;;;;;;;;;;;;;;;;;;;; + + cld +align 4 +@@: ;pushad + xor eax,eax + lodsb + test al,al + jz .exit +; movzx eax,al + shl eax,4 ; 16 .. +; imul eax,16 + + mov ebx,dword [font_array_data] ; +; add eax,ebx +; mov ebx,dword [ebx+8] ; +; add eax,ebx + add ebx,eax + push esi + mov esi,1 + mov eax,65 + mcall + pop esi + add edx,8 shl 16 ; = 8 + jmp @b +align 4 +.exit: ;popad + +; add edx,16 +; loop .next + +align 4 +.return: +popad +ret 12 + + +align 4 +; esp+4 = dd point to color of background and font +show_all_glif: +pushad + + mov edx,10 shl 16+20 ;dword [esp+12+32] ; x shl 16 +y + mov ecx,128 shl 16 +256;dword [font_x_y] ; x shl 16 +y + mov edi,dword [esp+4+32] ; + xor ebp,ebp ; 65 )) + +align 4 +@@: + mov ebx,dword [font_array_data] ; + mov esi,1 + mov eax,65 + mcall + +popad +ret 4 + + + + + + +align 4 +free_fulder_info: +; +pushad + mov ecx, dword [fulder_array_point] + mov eax,68 + mov ebx,13 + mcall + test eax,eax + jnz @f + or dword [esp+28],-1 ; +align 4 +@@: +popad + ret +align 4 +free_font: +; +pushad + mov ecx, dword [font_array_point] + mov eax,68 + mov ebx,13 + mcall + test eax,eax + jnz @f + or dword [esp+28],-1 ; +align 4 +@@: +popad + ret + +align 4 +; alloc mem get 4 Kb for own data +alloc_mem: + pushad + mov eax, dword [alloc_memory_point] + test eax,eax + jnz .mem_allocating + mov eax,68 + mov ebx,12 + mov ecx,4096 + mcall + mov dword [alloc_memory_point],eax ; 4 + mov dword [eax],-1 + popad + ret +align 4 +.mem_allocating: + mov ebp, dword [eax] + mov eax,ebp + cmp eax, -1 + jnz .mem_allocating + + mov eax,68 + mov ebx,12 + mov ecx,4096 + mcall + mov dword [ebp],eax ; 4 + mov dword [ebp],-1 + popad + ret + +align 16 +EXPORTS: + + dd sz_initialization_font, initialization_font + dd sz_get_font, get_font + dd sz_free_fulder_info, free_fulder_info + dd sz_free_font, free_font + dd sz_font_draw_on_string, font_draw_on_string + dd sz_show_all_glif, show_all_glif +; dd szVersion_ch, 0x00000001 +; dd sz_option_box_draw, option_box_draw +; dd sz_option_box_mouse, option_box_mouse + dd szVersion_fn, 0x00000001 + dd 0,0 + +sz_initialization_font db 'initialization_font',0 +sz_get_font db 'get_font',0 +sz_free_fulder_info db 'free_fulder_info',0 +sz_free_font db 'free_font',0 +sz_font_draw_on_string db 'font_draw_on_string',0 +sz_show_all_glif db 'show_all_glif',0 +;sz_check_box_mouse db 'check_box_mouse',0 +;szVersion_ch db 'version_ch',0 +;sz_option_box_draw db 'option_box_draw',0 +;sz_option_box_mouse db 'option_box_mouse',0 +szVersion_fn db 'version_fn',0 + +;;;;;;;;;;; +;;Data +;;;;;;;;;;; +align 4 +;buffer_font file 'font_8x16.fon' ; raw 1bpp +save_ecx dd 0x0 +;buffer_font file 'font01.ksf' ; raw 1bpp +alloc_memory_point dd 0x0 ; point to mem block in RAM 4096-4 +; 4096-4, , dd -1 +font_x_y dd 0x0 +fulder_array_point dd 0x0 +font_array_point dd 0x0 +font_array_data dd 0x0 ; .. +save_ebp dd 0x0 +save_point_nt dd 0x0 +;name_of_file db 263 dup(0x0) +;name_of_file db '/sys/FONTS/font01.ksf',0 +name_fulder db '/sys/FONTS',0 +name_fuld_end= ($-name_fulder) -1 +name_font db '.ksf' +name_font_e: +type_fnt db 'kf01' +type_fnt_e: + + + +align 16 +struct_f_info: +number_function dd 0x0 +index_start_block dd 0x0 +flags_ dd 0x0 +read_block dd 0x0 +buffer_read_d dd buffer_32 +free_byte db 0x0 +offset_to_string dd name_fulder + +align 16 +file_buffer: +.type_fnt dd 0x0 +.font_size dd 0x0 + +align 16 +buffer_32: +.head dd ? +.quantity_block dd ? +.quantity_files dd ? + rb 20 diff --git a/programs/develop/libraries/fontslib/trunk/readme.txt b/programs/develop/libraries/fontslib/trunk/readme.txt new file mode 100644 index 0000000000..5b675b14e7 --- /dev/null +++ b/programs/develop/libraries/fontslib/trunk/readme.txt @@ -0,0 +1,32 @@ +; Copyright (c) 2009, +; All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; * Neither the name of the nor the +; names of its contributors may be used to endorse or promote products +; derived from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname ''AS IS'' AND ANY +; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +; DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;***************************************************************************** + + . + 0.00002 . + : +1) fonts_lib.obj font_ex.kex /sys/lib +2) font01.ksf /sys/FONTS *.ksf +3) font_ex.kex \ No newline at end of file