Font size setting f48.11, f48.12

New option in f4

git-svn-id: svn://kolibrios.org@5867 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2015-10-29 14:43:15 +00:00
parent ef9ddaeb38
commit f6e1ec2684
4 changed files with 87 additions and 6 deletions

View File

@ -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). ===========
======================================================================

View File

@ -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). ===========
======================================================================

View File

@ -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'

View File

@ -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 \