WebView 1.2: bigger fonts by default

git-svn-id: svn://kolibrios.org@5712 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-08-10 15:38:08 +00:00
parent 5c8f8dc889
commit 9516fbc07d
4 changed files with 41 additions and 20 deletions

View File

@ -76,7 +76,7 @@ void TWebBrowser::DrawPage()
{ {
start_x = stolbec * list.font_w + magrin_left * DrawBuf.zoom + list.x; start_x = stolbec * list.font_w + magrin_left * DrawBuf.zoom + list.x;
start_y = stroka * list.line_h + magrin_left + list.y; start_y = stroka * list.line_h + magrin_left + list.y;
stolbec_len = strlen(#line); stolbec_len = utf8_strlen(#line);
line_length = stolbec_len * list.font_w * DrawBuf.zoom; line_length = stolbec_len * list.font_w * DrawBuf.zoom;
WriteBufText(start_x, 0, list.font_type, text_colors[text_color_index], #line, buf_data); WriteBufText(start_x, 0, list.font_type, text_colors[text_color_index], #line, buf_data);
@ -214,7 +214,7 @@ void TWebBrowser::Parse(){
if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/ if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/
if (tagparam) GetNextParam(); if (tagparam) GetNextParam();
if (stolbec + strlen(#line) > list.column_max) Perenos(); if (stolbec + utf8_strlen(#line) > list.column_max) Perenos();
DrawPage(); DrawPage();
line = NULL; line = NULL;
if (tag) SetTextStyle(WB1.DrawBuf.zoom * 5 + list.x, stroka * list.line_h + list.y + 5); //îáðàáîòêà òåãîâ if (tag) SetTextStyle(WB1.DrawBuf.zoom * 5 + list.x, stroka * list.line_h + list.y + 5); //îáðàáîòêà òåãîâ
@ -223,7 +223,7 @@ void TWebBrowser::Parse(){
default: default:
DEFAULT_MARK: DEFAULT_MARK:
if (bukva<=15) bukva=' '; if (bukva<=15) bukva=' ';
line_len = strlen(#line); line_len = utf8_strlen(#line);
if (!pre_text) && (bukva == ' ') if (!pre_text) && (bukva == ' ')
{ {
if (line[line_len-1]==' ') break; //no double spaces if (line[line_len-1]==' ') break; //no double spaces
@ -252,7 +252,7 @@ void TWebBrowser::Perenos()
int perenos_num; int perenos_num;
char new_line_text[4096]; char new_line_text[4096];
perenos_num = strrchr(#line, ' '); perenos_num = strrchr(#line, ' ');
if (!perenos_num) && (strlen(#line)>list.column_max) perenos_num=list.column_max; if (!perenos_num) && (utf8_strlen(#line)>list.column_max) perenos_num=list.column_max;
strcpy(#new_line_text, #line + perenos_num); strcpy(#new_line_text, #line + perenos_num);
line[perenos_num] = 0x00; line[perenos_num] = 0x00;
if (stroka-1 > list.visible) && (list.first <>0) end_parsing=true; if (stroka-1 > list.visible) && (list.first <>0) end_parsing=true;
@ -585,7 +585,7 @@ void BufEncode(int set_new_encoding)
{ {
strcpy(bufpointer, o_bufpointer); strcpy(bufpointer, o_bufpointer);
} }
bufpointer = ChangeCharset(charsets[set_new_encoding], "CP866", bufpointer); //bufpointer = ChangeCharset(charsets[set_new_encoding], "CP866", bufpointer);
} }

View File

@ -30,14 +30,14 @@
char homepage[] = FROM "html\\homepage.htm"; char homepage[] = FROM "html\\homepage.htm";
#ifdef LANG_RUS #ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.16"; char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.2";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­" ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤" ?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>"; char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
char page_not_found[] = FROM "html\page_not_found_ru.htm"; char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n"; char accept_language[]= "Accept-Language: ru\n";
#else #else
char version[]=" Text-based Browser 1.16"; char version[]=" Text-based Browser 1.2";
?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last" ?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>"; char loading[] = "Loading...<br>";
@ -133,7 +133,7 @@ void main()
SetSkinColors(); SetSkinColors();
WB1.DrawBuf.zoom = 1; WB1.DrawBuf.zoom = 1;
WB1.list.SetFont(6, 9, 10001000b); WB1.list.SetFont(8, 14, 10111000b);
Form.width=WIN_W; Form.width=WIN_W;
Form.height=WIN_H; Form.height=WIN_H;
SetElementSizes(); SetElementSizes();
@ -383,12 +383,12 @@ void Scan(dword id__)
if (WB1.DrawBuf.zoom==2) if (WB1.DrawBuf.zoom==2)
{ {
WB1.DrawBuf.zoom=1; WB1.DrawBuf.zoom=1;
WB1.list.SetFont(6, 9, 10001000b); WB1.list.SetFont(8, 14, 10111000b);
} }
else else
{ {
WB1.DrawBuf.zoom=2; WB1.DrawBuf.zoom=2;
WB1.list.SetFont(6, 9, 10001001b); WB1.list.SetFont(8, 14, 10111001b);
} }
Draw_Window(); Draw_Window();
return; return;

View File

@ -2,26 +2,26 @@
<head> <head>
<meta> <meta>
<meta http-equiv="content-type" content="text/html; charset=cp-866" /> <meta http-equiv="content-type" content="text/html; charset=cp-866" />
<title>‘âà ­¨æ  ­¥ ­ ©¤¥­ </title> <title>Страница не найдена</title>
</head> </head>
<body> <body>
<h1>&nbsp;‚¥¡-áâà ­¨æ  ­¥¤®áâ㯭 </h1> <h1>&nbsp;Веб-страница недоступна</h1>
<h2>&nbsp;—â® ¬®¦­® ᤥ« âì:</h2> <h2>&nbsp;Что можно сделать:</h2>
<ul> <ul>
<li> <li>
“¡¥¤¨â¥áì, çâ® ¥áâì ¯®¤ª«î祭¨¥ ª á¥â¨ ˆ­â¥à­¥â.<br> Убедитесь, что есть подключение к сети Интернет.<br>
Žâªà®©â¥ <a href="/sys/network/netcfg">Netcfg</a> ¤«ï ¤¨ £­®á⨪¨ á¥â¨.<br> Откройте <a href="/sys/network/netcfg">Netcfg</a> для диагностики сети.<br>
</li> </li>
<li> <li>
<EFBFBD>஢¥àì⥠ ¤à¥áá áâà ­¨æë, ¢®§¬®¦­®, ¡ë«  ᤥ« ­  ®¯¥ç âª .<br> Проверьте адресс страницы, возможно, была сделана опечатка.<br>
</li> </li>
<li> <li>
‘¥à¢¥à ¢à¥¬¥­­® ­¥¤®áâ㯥­. <br> Сервер временно недоступен. <br>
Ž¡­®¢¨â¥ áâà ­¨æã.<br> Обновите страницу.<br>
</li> </li>
<li> <li>
’¥ªáâ®¢ë© ¡à ã§¥à ­¥ ¯à ¢¨«ì­® ®¡à ¡®â « ®â¢¥â á¥à¢¥à .<br> Текстовый браузер не правильно обработал ответ сервера.<br>
‘®®¡é¨â¥ ®¡ ®è¨¡ª¥.<br> Сообщите об ошибке.<br>
</li> </li>
</ul> </ul>
</body> </body>

View File

@ -916,6 +916,27 @@ inline void debugi(dword d_int)
} }
inline fastcall unsigned int utf8_strlen( ESI)
{
$xor ecx, ecx
_loop:
$lodsb
$test al, al
$jz _done
$test al, 0x80
$jz _1
$and al, 0xc0
$cmp al, 0x80
$jz _loop
_1:
$inc ecx
$jmp _loop
_done:
return ECX;
}
#define strnmov strmovn #define strnmov strmovn
#define stricmp strcmpi #define stricmp strcmpi
#define strcmpn strncmp #define strcmpn strncmp