diff --git a/programs/network/htmlv/browser/HTMLv.c b/programs/network/htmlv/browser/HTMLv.c index 49f6a1f972..1bccc839c0 100644 --- a/programs/network/htmlv/browser/HTMLv.c +++ b/programs/network/htmlv/browser/HTMLv.c @@ -14,13 +14,14 @@ #include "..\lib\libimg_lib.h" #include "..\lib\edit_box_lib.h" #include "..\lib\scroll_lib.h" -#include "..\lib\ttf_fonts.h" +#include "..\lib\truetype.h" //картинки #include "img\toolbar_icons.c" #include "img\URLgoto.txt"; #define URL param +int use_truetype = 0; char editURL[sizeof(URL)], page_links[12000], @@ -55,11 +56,11 @@ void main() int scroll_used=0; mem_Init(); - load_dll2(libio, #libio_init,1); - load_dll2(libimg, #libimg_init,1); - load_dll2(boxlib, #edit_box_draw,0); + if (load_dll2(libio, #libio_init,1)!=0) debug("Не удалось подключить библиотеку libio."w); + if (load_dll2(libimg, #libimg_init,1)!=0) debug("Не удалось подключить библиотеку libimg."w); + if (load_dll2(boxlib, #edit_box_draw,0)!=0) debug("Не удалось подключить библиотеку boxlib."w); load_dll2(#abox_lib, #boxlib_init,0); - //load_dll2(libtruetype, #truetype,0); + if (load_dll2(libtruetype, #truetype,0)!=0) debug("Не удалось подключить библиотеку TrueType."w); if (!URL) strcpy(#URL, "/sys/home.htm"); strcpy(#editURL, #URL); diff --git a/programs/network/htmlv/browser/History.txt b/programs/network/htmlv/browser/History.txt index 0093d1a05a..c81a34be97 100644 --- a/programs/network/htmlv/browser/History.txt +++ b/programs/network/htmlv/browser/History.txt @@ -1,3 +1,6 @@ +05.11.12 - 0.97.5 +Переключалка на шрифты TrueType из меню ПКМ. + 16.07.12 - 0.97 - небольшие улучшения в обработке ссылок и изображений; - включение обработки разрывов строк через меню; diff --git a/programs/network/htmlv/browser/TWB.h b/programs/network/htmlv/browser/TWB.h index 1c752a4057..0220849118 100644 --- a/programs/network/htmlv/browser/TWB.h +++ b/programs/network/htmlv/browser/TWB.h @@ -8,7 +8,7 @@ dword char download_path[]="/rd/1/.download"; char search_path[]="http://nigma.ru/index.php?s="; -char version[]=" Text-based Browser 0.97"; +char version[]=" Text-based Browser 0.97.5"; struct TWebBrowser { @@ -119,6 +119,9 @@ void TWebBrowser::Scan(int id) if (!pre_text) pre_text=2; else pre_text=0; break; + case 005: //truetype + if (use_truetype == 1) use_truetype=0; else use_truetype=1; + break; case BACK: if (!BrowserHistory.GoBack()) return; OpenPage(); @@ -130,9 +133,6 @@ void TWebBrowser::Scan(int id) case 052: //Нажата F3 if (strcmp(get_URL_part(5),"http:")<>0) RunProgram("/rd/1/tinypad", #URL); else RunProgram("/rd/1/tinypad", #download_path); return; - case 053: //Нажата F4 - if (strcmp(get_URL_part(5),"http:")<>0) RunProgram("/rd/1/develop/t_edit", #URL); else RunProgram("/rd/1/develop/t_edit", #download_path); - return; case 054: //F5 IF(edit1.flags == 66) break; case REFRESH: @@ -180,22 +180,22 @@ void TWebBrowser::Scan(int id) IF(lines.first == lines.all - lines.visible) return; lines.first += lines.visible + 2; IF(lines.visible + lines.first > lines.all) lines.first = lines.all - lines.visible; - BREAK; + break; case 184: //PgUp - IF(lines.first == 0) RETURN; + IF(lines.first == 0) return; lines.first -= lines.visible - 2; IF(lines.first < 0) lines.first = 0; - BREAK; + break; case 180: //home - IF(lines.first == 0) RETURN; + IF(lines.first == 0) return; lines.first = 0; - BREAK; + break; case 181: //end - IF (lines.first == lines.all - lines.visible) RETURN; + IF (lines.first == lines.all - lines.visible) return; lines.first = lines.all - lines.visible; - BREAK; + break; default: - RETURN; + return; } ParseHTML(buf); } @@ -539,11 +539,18 @@ void TWebBrowser::DrawPage() // start_x=stolbec * 6 + left+5; start_y=stroka * 10 + top + 5; line_length=strlen(#line)*6; - - WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line, 0); - //line_length = get_length stdcall (#line,-1,16,line_length); - //text_out stdcall (#line, -1, 17, text_colors[text_color_index], start_x, start_y-2); - IF (b_text) { $add ebx, 1<<16 $int 0x40 } + + if (use_truetype == 1) + { + //line_length = get_length stdcall (#line,-1,16,line_length); + text_out stdcall (#line, -1, 17, text_colors[text_color_index], start_x, start_y-3); + Pause(10); + } + else + { + WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line, 0); + IF (b_text) { $add ebx, 1<<16 $int 0x40 } + } IF (i_text) Skew(start_x, start_y, line_length+6, 10); IF (s_text) DrawBar(start_x, start_y + 4, line_length, 1, text_colors[text_color_index]); IF (u_text) DrawBar(start_x, start_y + 8, line_length, 1, text_colors[text_color_index]); diff --git a/programs/network/htmlv/browser/compile.bat b/programs/network/htmlv/browser/compile.bat index ceb403d8e3..b2165b1d5b 100644 --- a/programs/network/htmlv/browser/compile.bat +++ b/programs/network/htmlv/browser/compile.bat @@ -2,5 +2,5 @@ del HTMLv rename HTMLv.com HTMLv rem ..\C--\kpack HTMLv -pause del warning.txt +pause \ No newline at end of file diff --git a/programs/network/htmlv/browser/include/menu_rmb.h b/programs/network/htmlv/browser/include/menu_rmb.h index aaf295974c..b284ab1335 100644 --- a/programs/network/htmlv/browser/include/menu_rmb.h +++ b/programs/network/htmlv/browser/include/menu_rmb.h @@ -5,11 +5,12 @@ char *ITEMS_LIST[]={ "View in Tinypad F3",52, -"View in TextEdit F4",53, +"WIN F5",REFRESH, +"DOS Ctrl+D",04, "KOI-8 Ctrl+K",11, "UTF Ctrl+U",21, -"DOS Ctrl+D",04, "Line breaks ON" ,01, +"TrueType fonts" ,05, 0}; @@ -88,6 +89,7 @@ void menu_rmb() DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX); WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0); if (ITEMS_LIST[i*2+1]==1) && (pre_text==2) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444); + if (ITEMS_LIST[i*2+1]==5) && (use_truetype==1) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444); } } }