diff --git a/kernel/trunk/docs/sysfuncr.txt b/kernel/trunk/docs/sysfuncr.txt index a2b520531f..505ec3a03c 100644 --- a/kernel/trunk/docs/sysfuncr.txt +++ b/kernel/trunk/docs/sysfuncr.txt @@ -206,6 +206,7 @@ * B=1 - закрашивать фон (цвет = edi) * FF задает шрифт и кодировку: 0 = 6x9 cp866 + 1 = 8x16 cp866 2 = 8x16 UTF-16LE 3 = 8x16 UTF-8 * C=0 - рисовать в окно, @@ -2191,6 +2192,23 @@ dword-значение цвета 0x00RRGGBB * ebx = 10 - номер подфункции * cl = 2 - субпиксельное, 1 - обычное, 0 - выключить +====================================================================== +======== Функция 48, подфункция 11 - получить размер шрифтов. ======== +====================================================================== +Параметры: + * eax = 48 - номер функции + * ebx = 9 - номер подфункции +Возвращаемое значение: + * eax = текущая высота шрифта в пикселях + +====================================================================== +======= Функция 48, подфункция 12 - установить размер шрифтов. ======= +====================================================================== +Параметры: + * eax = 48 - номер функции + * ebx = 10 - номер подфункции + * cl = новая высота шрифта в пикселях + ====================================================================== ============ Функция 49 - Advanced Power Management (APM). =========== ====================================================================== diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index 9e7542e186..f21d3021da 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -204,6 +204,7 @@ Parameters: * B=1 - fill background (color = edi) * FF specifies the font and encoding: 0 = 6x9 cp866 + 1 = 8x16 cp866 2 = 8x16 UTF-16LE 3 = 8x16 UTF-8 * C=0 - draw to the window, @@ -2173,6 +2174,23 @@ Parameters: * ebx = 10 - subfunction number * cl = 2 - subpixel, 1 - anti-aliasing, 0 - off +====================================================================== +============ Function 48, subfunction 11 - get font size. ============ +====================================================================== +Parameters: + * eax = 48 - function number + * ebx = 9 - subfunction number +Returned value: + * eax = current font height in pixels + +====================================================================== +============ Function 48, subfunction 12 - set font size. ============ +====================================================================== +Parameters: + * eax = 48 - function number + * ebx = 10 - subfunction number + * cl = new font height in pixels + ====================================================================== =========== Function 49 - Advanced Power Management (APM). =========== ====================================================================== diff --git a/kernel/trunk/gui/font.inc b/kernel/trunk/gui/font.inc index 03b28a85d4..36ef454e28 100644 --- a/kernel/trunk/gui/font.inc +++ b/kernel/trunk/gui/font.inc @@ -18,7 +18,8 @@ dtext: ; Z=1: edx -> zero terminated string, esi = ? ; B=1: fill background with color eax ; R=1: edi -> user area for redirect -; FF=3: UTF-8 8x16, FF=2: UTF-16LE 8x16, FF=0: 866 6x9 +; FF=3: UTF-8 8x16, FF=2: UTF-16LE 8x16 +; FF=1: cp866 8x16, FF=0: cp866 6x9 ; SSS = (font multiplier)-1 ; edi=1: force output and eax, 0xFFFFFF @@ -64,8 +65,8 @@ dtext: bt ebx, 27 jc .bufferReady mov eax, 9 - bt ebx, 29 - jnc @f + test ebx, 0x30000000 + jz @f add eax, 7 @@: imul eax, ecx @@ -91,7 +92,11 @@ dtext: mov ebp, eax xor edx, edx bt ebx, 29 - jnc .draw866 + jc @f + bt ebx, 28 + jc .draw866toUni + jmp .draw866 +@@: bt ebx, 28 jc .drawUTF8 @@ -191,6 +196,27 @@ deltaToScreen = 28 pop esi jmp .draw866 +.draw866toUni: + dec dword [esp] + js .done + xor eax, eax + mov al, [esi] + test eax, eax + jz .done + call ansi2uni_char + shl eax, 4 + lea ebx, [eax+fontUni] + inc esi + pushd esi edi 16 + mov esi, [esp+12+fontMultiplier] + call drawChar + imul esi, 8*4 + pop edi + pop edi + add edi, esi + pop esi + jmp .draw866toUni + .done: mov ecx, edi pop eax eax eax esi edx ebx ebp ebp ebp @@ -786,7 +812,8 @@ antiAliasing: mov ebp, ebx ret -fontSmoothing db 2 +fontSmoothing db 2 ; = 0, 1 or 2 +fontSize db 0 ; user mode setting font1: if lang eq sp file 'char_sp.mt' diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index f7faba0947..99eed83922 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -130,6 +130,14 @@ syscall_display_settings: ;///// system function 48 /////////////////////////// ;; Set font smoothing: ;< ebx = 10 ;< ecx = 0 — off, 1 — on, 2 — subpixel +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +;; Get font size: +;< ebx = 11 +;> eax = height in pixels +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +;; Set font size: +;< ebx = 12 +;< ecx = height in pixels ;------------------------------------------------------------------------------ cmp ebx, .sizeof.ftable / 4 ja @f @@ -264,6 +272,16 @@ syscall_display_settings.10: mov [fontSmoothing], cl ret ;------------------------------------------------------------------------------ +syscall_display_settings.11: + xor eax, eax + mov al, [fontSize] + mov [esp + 32], eax + ret +;------------------------------------------------------------------------------ +syscall_display_settings.12: + mov [fontSize], cl + ret +;------------------------------------------------------------------------------ syscall_display_settings._.calculate_whole_screen: xor eax, eax xor ebx, ebx @@ -1394,7 +1412,7 @@ sys_window_moving_handler: ;/////////////////////////////////////////////////// iglobal FuncTable syscall_display_settings, ftable, \ - 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10 + 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12 align 4 window_topleft dd \