[UP]


Manual Reference Pages  - centertext (3)

NAME

centertext(3f) - [M_draw:TEXT] Turns centertext mode on or off for SOFTWARE fonts. (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example

SYNOPSIS

subroutine centertext(onoff) logical,intent(in) :: onoff

DESCRIPTION

Turns centertext text on or off. .TRUE. is on. This centers strings and chars. This routine only affects software text.

OPTIONS

ONOFF set centering mode on or off

EXAMPLE

Sample program:

   program demo_centertext
   use :: M_draw
   use :: M_units, only : cosd, sind
   !! set up drawing environment
   call prefsize(600,600)
   call vinit(’ ’) ! start graphics using device $M_DRAW_DEVICE
   call ortho2(-300.0,300.0,-300.0,300.0)
   call textsize(8.0,8.0)
   call linewidth(30)
   call color(D_BLACK)
   call clear()

x1=-150 y1=-150 do j=1,4 select case(j) case(1); call xcentertext(); x1=-150; y1=-150; r=100 case(2); call ycentertext(); x1=+150; y1=-150; r= 30 case(3); call centertext(.true.); x1=-150; y1=+150; r=100 case(4); call centertext(.false.); x1=+150; y1=+150; r= 30 end select !! draw radial lines call color(D_RED) do i=1,80 call move2(x1,y1) call draw2(x1+150.0*cosd(i*12), y1+150.0*sind(i*12)) enddo

!! draw rotated text call color(D_GREEN) do i=1,30 ang=i*12.0 xx=x1+r*cosd(ang) yy=y1+r*sind(ang) call move2(xx,yy) call textang(ang) call color(D_WHITE) call drawstr(’This is angled text’) call color(D_RED) enddo enddo

ipaws=getkey()

call vexit()

end program demo_centertext


centertext (3) March 11, 2021
Generated by manServer 1.08 from 6d7ae413-bbec-4101-84f3-cb4dc776a6c2 using man macros.