-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo_drawstr.f90
executable file
·40 lines (33 loc) · 1.44 KB
/
demo_drawstr.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
program demo_drawstr
use M_pixel
use :: M_pixel__writegif, only : writegif
implicit none
call prefsize(400,400)
call vinit()
call ortho2(-1.0,1.0,-1.0,1.0)
! by default the drawing surface is
! a square ranging from -1 to 1 in both
! the X and Y axis
write(*,*)D_BLACK, D_GREEN, D_RED
call color(D_BLACK) ! set current color to black
call clear() ! clear to current color
! SET COMMON TEXT ATTRIBUTES
call color(D_GREEN) ! we want to draw in green
call circle(0.0,0.0,1.0)
call font('futura.m') ! set font
call textsize(0.1,0.1) ! font size
! DRAW A STRING
call move2(-1.0, 0.0)
call drawstr('Hello') ! draw string at current position
! note that current position is now at end of this string
! CHANGE SOME TEXT ATTRIBUTES AGAIN
call linewidth(20) ! set line width
call color(D_RED) ! change color
call textang(45.0) ! change text angle
call drawstr(' World!')! draw string at current position
!! render pixel array to a file
call writegif('drawstr.3M_pixel.gif',P_pixel,P_colormap)
!! display graphic assuming display(1) is available
call execute_command_line('display drawstr.3M_pixel.gif')
call vexit() ! wrap up and exit graphics mode
end program demo_drawstr