Hello Paul, it seems to me that 'rotate_font@' doesn't work when using 'set_smoothing_mode@. I have attached a short program that demonstrates the problem:
WINAPP
module dwdata
integer :: xres=400
integer :: yres=250
integer :: mydc=10
integer :: smoothing=0
real*8 :: rotation = 0.d0
real*8 :: x8 = 60.d0
real*8 :: y8 = 50.d0
integer*4 :: colour = 16742400
character (len=26) :: title = 'Smoothing mode not set yet'
end module dwdata
!===============================================
program smoothing_mode_bug
!===============================================
use dwdata
external plot
integer plot, a
a=winio@('%ww[no_border]&')
a=winio@('%bg[btnface]&')
a=winio@('%ca[smoothing_mode_bug]&')
! a=winio@('%ob%`gr%cb&',xres,yres,mydc)
a=winio@('%ob[no_border]&')
a=winio@('%pv%^`gr[white, user_resize, rgb_colours]&', xres, yres, mydc, plot)
a=winio@('%cb')
end
!===============================================
integer function plot()
!===============================================
use dwdata
C_EXTERNAL SET_SMOOTHING_MODE@ '__set_smoothing_mode'(VAL):integer
integer*4 :: clearwin_info@, smooth
character(len=20) :: clearwin_string@
if (clearwin_string@('call_back_reason') == 'RESIZE') then
xres = clearwin_info@ ('graphics_width')
yres = clearwin_info@ ('graphics_depth')
elseif (clearwin_string@('call_back_reason') == 'MOUSE_LEFT_CLICK') then
rotation = 0.d0
elseif (clearwin_string@('call_back_reason') == 'MOUSE_MIDDLE_CLICK') then
if (smoothing == 0) then
smoothing = 5
title = 'Smoothing_mode = 5'
else
smoothing = 0
title = 'Smoothing_mode = 0'
endif
smooth = set_smoothing_mode@(smoothing)
if (smooth == 0) then
endif
elseif (clearwin_string@('call_back_reason') == 'MOUSE_RIGHT_CLICK') then
rotation = -45.d0
endif
call rotate_font
plot = 2
end
!===============================================
subroutine rotate_font
!===============================================
use dwdata
C_EXTERNAL DRAW_CHARACTERSD@ '__win_draw_text_d'(INSTRING,VAL,VAL,VAL)
C_EXTERNAL DRAW_FILLED_RECTANGLE@'__win_fill_rectangle_l' (VAL,VAL,VAL,VAL,VAL)
C_EXTERNAL SELECT_FONT@ '__select_font' (INSTRING)
C_EXTERNAL SIZE_IN_PIXELS@ '__size_in_pixels' (VAL,VAL)
C_EXTERNAL BOLD_FONT@ '__bold_font' (VAL)
C_EXTERNAL ROTATE_FONT@ '__rotate_font' (VAL)
integer*4 :: rgb@
call draw_filled_rectangle@ (0, 0, xres, yres, rgb@(255,255,255))
call select_font@ ('Arial')
call size_in_pixels@(20, 0)
call bold_font@(1)
call rotate_font@(rotation)
call draw_charactersd@(title, x8, y8, colour)
end subroutine rotate_font
!===============================================
RESOURCES
1 24 default.manifest
As long as i do not use the 'set_smoothing_mode@' command all works fine. A left mouse button click writes the character horizontally and a right mouse button click writes the character under an angle of 45°. When activating the smoothing mode with a middle mouse button click the original positions of the character are 'lost' after a right mouse button click which comes along with a rotation of the chosen font. The changing of the smoothing mode back to 'Zero' with a further middle mouse button click will be ignored by the program.