I have some very old bugs in my code which i did not have time to research. Today will be beginning of the end of one of them.
Hunting the bug and isolating the strange behavior in large subroutine for last two days I got really mind killing bug/feature of scale_font@ utility...
Isn't it supposed to return your font size back if you do
scale_font@(0.7d0) call draw_text@('text',100, 100, icolor) scale_font@(1./0.7d0)
???? Then look at this sample code below. Use slider which just dynamically changes the FontSizeFactor (was 0.7 in above snippet) to arbitrary value (for example between 0.1 and 3.2). Each line contains 25 instances of number 10^5 which on both lines has to be the same size.
Code print radix (number 10) with some initial font size equal 2, then scales the font to smaller size and prints exponent 5. Then font size changes back to initial size 2 again and repeats all : it prints initial size radix, scales font down and prints exponent, scales font back to normal etc
Look though what we get. What all that may mean? I'd understand some small variations in font size (or scale factor) due to rounding of real*8 numbers for font dimensions to actually integer font pixel count but not that kind of magnitude ! Just found the workarounds by selecting the same font again and again before plotting each character, but they look illogical and potentially time consuming.
use clrwin
integer Start
external Start
real*8 FontSizeFactor
common FontSizeFactor, k_ShowWrongWay
k_ShowWrongWay = 1
FontSizeFactor= 0.7
i=winio@('%ww&')
i=winio@('%ac[esc]&', 'exit')
i=winio@('%^rb[Show how things should NOT work]%ff&', k_ShowWrongWay, Start)
i=winio@('%^?200sl[horizontal][exponent font size] %rf%ff%ff&', &
& FontSizeFactor, 0.1D0, 3.2D0, Start, FontSizeFactor)
i=winio@('%gr[black,rgb_colours]&', 1700, 480)
i=winio@('%lw', ilw) !
j=start()
end
!.................................................................
integer function Start()
use clrwin
real*8 SizeFontRTGxaxisR, FontSizeFactor
common FontSizeFactor, k_ShowWrongWay
SizeFontRTGxaxisR = 2
kol = rgb@(170,170,250)
call clear_screen@()
!! call SELECT_FONT@('Arial')
!! call SELECT_FONT@('Courier New')
call SELECT_FONT@('Times New Roman')
call scale_font@(SizeFontRTGxaxisR )
call BOLD_FONT@( 1 )
iy = 220
do i=1,25
if(k_ShowWrongWay.eq.0) call SELECT_FONT@('Times New Roman')
if(k_ShowWrongWay.eq.0) call scale_font@(SizeFontRTGxaxisR )
CALL DRAW_TEXT@('10', 66*(i-1), iy, kol)
call scale_font@(FontSizeFactor)
CALL DRAW_TEXT@('5', 66*(i-1)+31, iy-17, kol)
call scale_font@(1./FontSizeFactor) !!0.59d0)
enddo
! same code for another line
iy = 270
do i=1,25
if(k_ShowWrongWay.eq.0) call SELECT_FONT@('Times New Roman')
if(k_ShowWrongWay.eq.0) call scale_font@(SizeFontRTGxaxisR )
CALL DRAW_TEXT@('10', 66*(i-1), iy, kol)
call scale_font@(FontSizeFactor)
CALL DRAW_TEXT@('5', 66*(i-1)+31, iy-17, kol)
call scale_font@(1./FontSizeFactor)
enddo
Start=1
end function