! !@(#) demonstrate still more features of text ! program fjtext #include "interface.h" integer BLACK, RED, GREEN, BLUE, YELLOW, MAGENTA, WHITE integer CYAN parameter(BLACK = 0) parameter(RED = 1) parameter(GREEN = 2) parameter(YELLOW = 3) parameter(BLUE = 4) parameter(MAGENTA = 5) parameter(CYAN = 6) parameter(WHITE = 7) character *20 dev write(*,*)'Enter device: ' read(*, '(a)') dev call vinit(dev) call textsize(0.03, 0.04) call ortho2(0.0, 1.0, 0.0, 1.0) call color(RED) call clear() call drawstuff() ! ! Now do it all with the text rotated .... ! call textang(45.0) call drawstuff() call textang(160.0) call drawstuff() call textang(270.0) call drawstuff() ! ! Now with a single character ! call textjustify(.false.) call drawstuff2(0.0) call drawstuff2(90.0) call drawstuff2(160.0) call drawstuff2(270.0) call vexit() end subroutine drawstuff #include "interface.h" integer BLACK, RED, GREEN, BLUE, YELLOW, MAGENTA, WHITE parameter(BLACK = 0) parameter(RED = 1) parameter(GREEN = 2) parameter(YELLOW = 3) parameter(BLUE = 4) parameter(MAGENTA = 5) parameter(WHITE = 7) call color(BLACK) !call polyfill(1) call polyfill(.true.) ! So rect clears a bit for us call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call color(GREEN) call move2(0.5, 0.5) call leftjustify() call drawstr('This is Left Justified text') idum=getkey() call color(BLACK) call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call color(YELLOW) call move2(0.5, 0.5) call centertext(.true.) call drawstr('This is Centered text') call centertext(.false.) idum=getkey() call color(BLACK) call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call color(MAGENTA) call move2(0.5, 0.5) call rightjustify call drawstr('This is Right Justified text') call textjustify(.false.) idum=getkey() end subroutine drawstuff2(ang) #include "interface.h" integer BLACK, RED, GREEN, BLUE, YELLOW, MAGENTA, WHITE parameter(BLACK = 0) parameter(RED = 1) parameter(GREEN = 2) parameter(YELLOW = 3) parameter(BLUE = 4) parameter(MAGENTA = 5) parameter(WHITE = 7) call color(BLACK) call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call textang(ang) call color(GREEN) call move2(0.5, 0.5) call leftjustify() call drawchar('B') call textang(0.0) call textjustify(.false.) call boxtext(0.1, 0.1, 0.4, 0.02, 'The ''B'' should be leftjustified') call pushattributes idum=getkey() call color(BLACK) call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call textang(ang) call color(YELLOW) call move2(0.5, 0.5) call centertext(.true.) call drawchar('B') call centertext(.false.) call textang(0.0) call textjustify(.false.) call boxtext(0.1, 0.1, 0.4, 0.02, 'The ''B'' should be centered') call pushattributes idum=getkey() call color(BLACK) call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call textang(ang) call color(MAGENTA) call move2(0.5, 0.5) call rightjustify call drawchar('B') call textang(0.0) call textjustify(.false.) call boxtext(0.1, 0.1, 0.4, 0.02, 'The ''B'' should be rightjustified') call pushattributes idum=getkey() call color(BLACK) call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call textang(ang) call color(MAGENTA) call move2(0.5, 0.5) call topjustify call drawchar('B') call textang(0.0) call textjustify(.false.) call boxtext(0.1, 0.1, 0.4, 0.02, 'The ''B'' should be topjustified') call pushattributes idum=getkey() call color(BLACK) call rect(0.1, 0.1, 0.9, 0.9) call color(WHITE) call move2(0.1, 0.5) call draw2(0.9, 0.5) call move2(0.5, 0.1) call draw2(0.5, 0.9) call textang(ang) call color(MAGENTA) call move2(0.5, 0.5) call topjustify() call rightjustify() call drawchar('B') call textang(0.0) call textjustify(.false.) call boxtext(0.1, 0.1, 0.4, 0.02, 'The ''B'' should be right/topjustified') ! call textjustify(.false.) idum=getkey() end