2009-10-30 21:26:35 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 2009-10-30
|
|
|
|
;
|
|
|
|
|
2011-07-17 18:36:12 +00:00
|
|
|
|
2009-10-30 21:26:35 +00:00
|
|
|
.include "tgi-kernel.inc"
|
2009-11-12 18:00:17 +00:00
|
|
|
.include "tgi-vectorfont.inc"
|
|
|
|
.include "zeropage.inc"
|
2009-10-30 21:26:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2011-07-17 18:36:12 +00:00
|
|
|
; unsigned __fastcall__ tgi_gettextheight (const char* s);
|
2009-11-12 18:00:17 +00:00
|
|
|
; /* Calculate the height of the text in pixels according to the current text
|
2014-06-30 09:10:35 +00:00
|
|
|
; ** style.
|
|
|
|
; */
|
2009-10-30 21:26:35 +00:00
|
|
|
;
|
|
|
|
|
2011-07-17 18:36:12 +00:00
|
|
|
.proc _tgi_gettextheight
|
2009-10-30 21:26:35 +00:00
|
|
|
|
2009-11-12 18:00:17 +00:00
|
|
|
ldy _tgi_font
|
|
|
|
bne @L2 ; Jump if vector font
|
|
|
|
|
|
|
|
; Return the height for the bitmap font
|
|
|
|
|
2009-10-30 21:26:35 +00:00
|
|
|
lda _tgi_charheight
|
|
|
|
ldx #0
|
2009-11-12 18:00:17 +00:00
|
|
|
@L1: rts
|
|
|
|
|
|
|
|
; Return the height for the vector font
|
|
|
|
|
|
|
|
@L2: lda _tgi_vectorfont
|
|
|
|
tax
|
|
|
|
ora _tgi_vectorfont+1
|
|
|
|
beq @L1 ; Return zero if no font
|
|
|
|
|
|
|
|
stx ptr1
|
|
|
|
lda _tgi_vectorfont+1
|
|
|
|
sta ptr1+1
|
2011-07-17 17:15:54 +00:00
|
|
|
ldy #TGI_VECTORFONT::HEIGHT
|
|
|
|
lda (ptr1),y ; Get height of font
|
2009-11-12 18:00:17 +00:00
|
|
|
|
|
|
|
sta ptr1
|
|
|
|
lda #0
|
|
|
|
sta ptr1+1 ; Save base height in ptr1
|
|
|
|
|
|
|
|
lda _tgi_textscaleh
|
|
|
|
ldx _tgi_textscaleh+1 ; Get scale factor ...
|
|
|
|
jmp tgi_imulround ; ... and return scaled result
|
2009-10-30 21:26:35 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|