soccer jersey forums.silverfrost.com :: View topic - set_smoothing_mode@
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

set_smoothing_mode@
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Mon Jan 13, 2014 1:58 pm    Post subject: set_smoothing_mode@ Reply with quote

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:

Code:

      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�
Back to top
View user's profile Send private message
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Mon Jan 13, 2014 2:05 pm    Post subject: set_smoothing_mode@ Reply with quote

Hello Paul,
some lines have not been transmitted. Here comes the rest:

When activating the smoothing behaviour with a middle mouse button click the original positions of the characters 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.

Many thanks in advance for your assistance.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8036
Location: Salford, UK

PostPosted: Mon Jan 13, 2014 6:38 pm    Post subject: Reply with quote

You will need to download the latest dlls. Font rotation was not provided in the initial release. Download from www.silverfrost/beta/clearwin64.exe.
Back to top
View user's profile Send private message AIM Address
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Tue Jan 14, 2014 10:55 am    Post subject: Reply with quote

I have downloaded the clearwin64.exe and replaced the files salflibc.dll and salflibc.lib in the folder where i compile and link my short test program. But the problem still exists. What does i make wrong, Paul?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8036
Location: Salford, UK

PostPosted: Tue Jan 14, 2014 6:59 pm    Post subject: Reply with quote

I don't have the documentation with me but from memory rotate_font@ takes real*4 and it could be a REF. Have a look at clearwin.ins.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8036
Location: Salford, UK

PostPosted: Wed Jan 15, 2014 8:46 am    Post subject: Reply with quote

I have had a closer look at your code and it seems OK. Try using draw_characters@, without the D. Also, if you are not using meta files, you should be able to avoid GDI+ for the character drawing only.

I will run your code when I get the opportunity.
Back to top
View user's profile Send private message AIM Address
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Wed Jan 15, 2014 10:48 am    Post subject: Reply with quote

Using "DRAW_CHARACTERS@" makes no difference.
Back to top
View user's profile Send private message
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Wed Jan 15, 2014 12:01 pm    Post subject: Reply with quote

In the meantime i have run another example, listed below

Code:

      WINAPP
      INCLUDE <clearwin.ins>
      C_EXTERNAL SET_SMOOTHING_MODE@ '__set_smoothing_mode'(VAL):integer
      INTEGER i,ictrl,s_width,s_depth,g_width,g_depth,colour,smooth
!--- Get width and height of screen     
      s_width = clearwin_info@('SCREEN_WIDTH')
      s_depth = clearwin_info@('SCREEN_DEPTH')
!--- Size of graphics area
      g_width = 2.0*s_width/3.0
      g_depth = 2.0*s_depth/3.0
!--- Graphics window
      i=winio@('%ww%ca[WINDOWS FONTS]&')
      i=winio@('%mn[&Exit]&','EXIT')
      i=winio@('%gr[black,rgb_colours]&',g_width,g_depth)
      i=winio@('%lw',ictrl)
!--- Select Windows font 'Modern' (default attributes)
!--- Draw in intense white
      smooth = set_smoothing_mode@(5)
      CALL select_font@('Modern')
      CALL draw_characters@('1: select_font:modern', 350,380,RGB@(255,255,255))
!--- Multiply size of font by 2                         
!--- Draw in yellow
      CALL scale_font@(2.0D0)
      CALL draw_characters@('2: This is scale_font', 300,300,RGB@(255,255,0))
!--- Underline font
!--- Draw in intense cyan
      CALL underline_font@(1)
      CALL draw_characters@('3: This is underline_font', 280,200,RGB@(0,255,255))
!--- Italic font         
!--- Draw in intense green
      CALL italic_font@(1)
      CALL draw_characters@('4: This is italic_font', 300,100,RGB@(0,255,0))
!--- Specify the size of the font in pixels
!--- Draw in cyan
      CALL size_in_pixels@(20,10)
      CALL draw_characters@('5: This is size_in_pixels', 350,50,RGB@(127,0,127))
!--- Specify the size of the font in points
!--- Draw in intense blue
      CALL size_in_points@(20,10)
      CALL draw_characters@('6: This is size_in_points', 10,50,RGB@(0,0,255))
!--- Rotate the font by 70.0 degrees
!--- Draw in intense magenta
!!      CALL rotate_font@(70.0D0)
!!      CALL draw_characters@('7: This is rotate_font:70', 80,450,RGB@(255,0,255))
!--- Undo underline font
!--- Draw in intense cyan
      CALL underline_font@(0)
      CALL draw_characters@('8: This is undo underline_font', 150,450,RGB@(0,255,255))
!--- Embolden the font
!--- Draw in intense white
      CALL bold_font@(1)
      CALL draw_characters@('9: This is bold_font', 220,350,RGB@(255,255,255))
!--- User selected font, default colour black (0)
!--- Draw in intense white
      colour=0
      CALL choose_font@(colour)
      CALL draw_characters@('10: This is choose_font', 300,450,colour)
      END


which i have taken from the manual "ftn95.chm".
After adding the line "smooth=set_smoothing_mode@(5)" no text will be drawn on the drawing surface after having selected a suitable font. The same strange behaviour occurs when adding the line "smooth=set_smoothing_mode@(0)".[/code]
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2876
Location: South Pole, Antarctica

PostPosted: Wed Jan 15, 2014 1:26 pm    Post subject: Reply with quote

I also confirm that rotation does not work with smoothing
Back to top
View user's profile Send private message
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Tue Jan 21, 2014 9:11 am    Post subject: Reply with quote

Hello Paul,
i'm in need of a solution for the above mentioned problems. Can you tell me what priority the problems do have for you?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8036
Location: Salford, UK

PostPosted: Tue Jan 21, 2014 10:28 am    Post subject: Reply with quote

I plan to look at it today.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8036
Location: Salford, UK

PostPosted: Tue Jan 21, 2014 11:01 am    Post subject: Reply with quote

The first program works OK for me. I think that I am using the same salflibc.dll as the one that is available as a beta download but I will do a new build and upload, hopefully later today.

In the second program, the problem appears to be the name of the font "Modern". Other fonts work OK. In this program the drawing point for CHOOSE_FONT@ needs to be adjusted. Rotated text also appears when the commented-out lines are restored.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8036
Location: Salford, UK

PostPosted: Tue Jan 21, 2014 5:29 pm    Post subject: Reply with quote

I have uploaded new DLLs to http://www.silverfrost.com/beta/clearwin64.exe and http://www.silverfrost.com/beta/salflibc.exe.
Back to top
View user's profile Send private message AIM Address
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Wed Jan 22, 2014 9:48 am    Post subject: Reply with quote

I have used the new salflibc.dll and salflibc.lib but the problem is still the same.
Please run the first example. After having started the program you will see the character string "Smoothing mode not set yet". A right mouse button click will rotate the character string at the same position. Then a middle mouse button click will activate the smoothing mode and displays the character string "Smoothing_mode=5" at the top left corner of the drawing surface. This is the problem.
Back to top
View user's profile Send private message
Borrmann Manfred



Joined: 29 Mar 2007
Posts: 28

PostPosted: Wed Jan 22, 2014 9:57 am    Post subject: Reply with quote

The problem of the second example still exists. When using the statement "smooth = set_smoothing_mode@(5)" just behind "i=winio@('%lw', ictrl) and activating the statements "CALL rotate_font@(70.0D0)" and "CALL draw_characters@('7: This is rotate_font:70', 80,450,RGB@(255,0,255))" the font rotation will not be displayed on the current drawing surface.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group