!------------------------------------------------------------------
!CFont.f95 version 1.3 2021.09.05.1155cdt JMS
!------------------------------------------------------------------
!2021.09.05.1155cdt JMS -CFont.f95 - current build environment:
!                       -Traveler2/Athlon64/WinXPPro/APF9.0/Ogl1.2.1
!2004.10.02.0920cst JMS -Modified to Fortran 95... Version 1.3
!CFont12.F90
!2004.02.24.0920cst JMS -CFont.F90:"Contrast Font" Demonstration/Generation.
!                                   Version 1.2
!                                   New name. Supercedes "Nixie vsn 1.111"
!                                   Uses RMB / Menu for control.
!2004.02.18.1200cst JMS -Nixie111.F90: Standardized time calls.  (Mitchell)
!2004.02.17.1310cst JMS -Nixie11.F90 : First post on www.setterholm.com 
!                       -A700/Nt4.0:sp6/CVF6.6b/Ogl1.2.1/Glut3.7.6

!---------------------------------------------------------------------------7 9
!  "  !  "   remarks. The rest of the line is ignored by the compiler.
!  "  ;  "   separates statements on the same line.
!  "  &  "   line continuation to the next line.
!  " z'' "   is a prefix for hexadecimal numbers.
!---------------------------------------------------------------------------7 9
Module CFontSup
! The elements of this module are tied to an OpenGL screen interface.
 use opengl_gl
 use opengl_glu
 use opengl_glut
              !opengl_
!use CFontSup !^CFontSup-CFontUse,KeybdUse

 implicit none
  public :: CFontUse  &  !          Font writing interface.
           ,MenuInit   & !
           ,KeybdUse     !(key,x,y) Keyboard interface
  integer*4,public::KeyChar
  integer*4,public::iZoom
contains
!---------------------------------------------------------------------------7 9
Subroutine ScrnUse      !"Callback" called by OpenGL to update the screen.
 implicit none
  character::cLabel*80
  integer*4::i,j,n
!Next screen iteration - double buffer mode (drawing to the back screen).
   call glClearColor(.0,.3,.2,0.)
   call glClear(ior(GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT))
   call glEnable(GL_DEPTH_TEST)     
   call glMatrixMode(GL_PROJECTION) ;call glLoadIdentity
! The 640 x 480 pixel window becomes an isometric volume with dimensions...
   call glortho( -1.333_gldouble,  1.333_gldouble &  !  Left-to-right
               , -1.000_gldouble,  1.000_gldouble &  !bottom-to-top
               ,  1.000_gldouble, -1.000_gldouble )  !  near-to-far (ref.)
                                                     !seems:   far-to-near
   call glMatrixMode(GL_MODELVIEW)  ;call glLoadIdentity

   call glPushMatrix    !-----This exercises an existing GLUT bitmap font.
   call Colors(12); cLabel=  "Close other applications before use."&
                           //" Use this program at your own risk."
   do 10 i=1,80
     n=iChar(cLabel(i:i)); if (n.eq.0) goto 11
     call glRasterPos3D(-1.32d0+(i-1)*(9*2.666)/640. , .93d0 ,.0d0) 
10   call glutbitmapcharacter(GLUT_BITMAP_9_BY_15,n)
11 call glFlush
   call glPopMatrix     !-----End of use of an existing GLUT bitmap font.

   call CFontUse        !This demonstrates the Contrast Font on the screen.

   do 30 j=1,2
     call glPushMatrix    !-----This exercises an existing GLUT bitmap font.
     call Colors(15) 
     cLabel="  ^  These are line numbers in subroutine CFontUse."
     if(j.eq.2) cLabel= &
     "Documentation: http://ftp.setterholm.com/Fortran/CFont  *.pdf"
     do 20 i=1,80
       n=iChar(cLabel(i:i)); if (n.eq.0) goto 21
       call glRasterPos3D(-1.33d0+(i-1)*(9*2.666d0)/640.d0,     &
                           -.75d0- j   *.10d0             ,.0d0)
20       call glutbitmapcharacter(GLUT_BITMAP_9_BY_15,n)
21   call glFlush
     call glPopMatrix     !-----End of use of an existing GLUT bitmap font.
30 continue
 
   call glutSwapBuffers !Scene drawing done. Swap back and front buffers.
   call glutPostRedisplay
  return                !Return to OpenGL
End Subroutine ScrnUse
!---------------------------------------------------------------------------7 9
Subroutine CFontUse   !Exercises the Contrast Font (nee: "Nixie" inaccurately).
 implicit none        !  in multiple calls to subroutine AlphaCF.
  character::Chn*40,C0*1                                        !,C8*8,C9*9
  real*8   ::x(3)
  integer*4::iColorC                                            !i,,n
  real*4   ::OneZero = 1.0
  real*4   ::OneZIncr= -.001
   integer*4::iClock(8)
   character::cClock(3)*12

   c0=char(0)
   if(OneZero.lt..001) OneZIncr= .001
   if(OneZero.gt..999) OneZIncr=-.001
      OneZero=OneZero+OneZIncr
!Line#1
   write(Chn,"(' 1 CFONT.EXE  VSN 1.3 2021.09.05  JMS',a1)") c0
   x(1)=-1.3d0 ;x(2)= .8d0 ;x(3)=.0d0 ;call AlphaCF(Chn,x,15, 0,-1)
!Line#2 (Character color changes over time)
   iColorC=int(OneZero*15.9)
   write(Chn,"(' 2 CONTRAST FONT GENERATION/DEMO. ',i2,a1)") iColorc,c0
   x(1)=-1.3d0 ;x(2)= .6d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x,iColorC,0,6)
!Line#3
   Chn=" 3 ABCDEFGHIJKLMNOPQRSTUVWXYZ"//c0
   x(1)=-1.3d0 ;x(2)= .4d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x, 0,-1,-1)
!Line#4
   Chn=' 4 0123456789abcdef "' // "&'()*+,-./:<=>~" // char(176)//c0
   x(1)=-1.3d0 ;x(2)= .3d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x, 0,-1,-1)
!Line#5
   Chn=" 5 ABCDEFGHIJKLMNOPQRSTUVWXYZ"//c0
   x(1)=-1.3d0 ;x(2)= .2d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x,-1,11,-1)
!Line#6
   Chn=' 6 0123456789abcdef "' // "&'()*+,-./:<=>~" // char(176) //c0
   x(1)=-1.3d0 ;x(2)= .1d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x,-1,11,-1)
!Line#7
   Chn=" 7 ABCDEFGHIJKLMNOPQRSTUVWXYZ"//c0
   x(1)=-1.3d0 ;x(2)= .0d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x, 0,11,-1)
!Line#8
   Chn=' 8 0123456789abcdef "' // "&'()*+,-./:<=>~" // char(176)//c0
   x(1)=-1.3d0 ;x(2)=-.1d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x, 0,11,-1)

!Date/Time:
   call Date_And_Time(cClock(1),cClock(2),cClock(3),iClock) !Date and time
!Line#9
   write(chn,"(' 9 ',i4.4,'.',i2.2 ,'.',i2.2     ,a1   )") &
                  iClock(1),iClock(2),iClock(3),c0
   x(1)=-1.3d0 ;x(2)=-.3d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x,12, 0, 0)
!Line#10
   write(chn,"('10 ',5x,i2.2,  ':',i2.2 ,':',i2.2, '.',i2.2      ,a1    )") &
                       iClock(5),iClock(6),iClock(7),iClock(8)/10,c0
   x(1)=-1.3d0 ;x(2)=-.4d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x,12, 0,-1)

!Line#11
   Chn='11 '//char(KeyChar)//c0
   x(1)=-1.3d0 ;x(2)=-.5d0 ;x(3)= .0d0 ;call AlphaCF(Chn,x,15, 0, 9)
   Chn='     TYPE Z TO ZOOM ->'//char(0) ;call AlphaCF(Chn,x,10,-1,-1)
!Line#12 (Glides up and down.)
                      Chn="12 RIGHT MOUSE BUTTON - MENU     (FAR)"//c0
   if(OneZIncr.lt.0.) Chn="12 RIGHT MOUSE BUTTON - MENU     (NEAR)"//c0
   x(1)=-1.3d0;x(2)=(OneZero-.5263d0)*1.9d0;x(3)=.0d0+OneZIncr*20.d0
                                              call AlphaCF(Chn,x,-1, 0,-1)
!Line#13 (Glides up and down. Stops before the bottom of the screen.)
                      Chn="13 RIGHT MOUSE BUTTON - MENU     (FAR)"//c0
   if(OneZIncr.lt.0.) Chn="13 RIGHT MOUSE BUTTON - MENU     (NEAR)"//c0
   if(x(2).lt.-.7d0) x(2)=-.7d0;x(3)=x(3)-.01;call AlphaCF(Chn,x,15,-1,-1)
!Zoomed View (This registers as intended only in a 640 x 480 pixel window.)
                    call glRasterPos3D(.19d0,-.6d0,-.1d0)
                    call glPixelZoom(4.,4.)
     if(iZoom.gt.0) call glCopyPixels( 6,119,66,23,GL_COLOR)
                    call colors(0)
                    call glRectD(.18d0,-.61d0,1.305d0,-.205d0)
  return
End Subroutine CFontUse
!---------------------------------------------------------------------------7 9
Subroutine MenuInit
integer (kind=glcint) :: menuid
  menuid = glutCreateMenu(MenuUse)
    call glutAddMenuEntry("Zoom (toggle on:off)"     ,1_glcint)
    call glutAddMenuEntry("CFontIn.Txt -> CFontOut.Txt",2_glcint)
    call glutAddMenuEntry("     ***Quit***     "     ,3_glcint)
  call glutAttachMenu(glut_right_button)   !This identifies the menu activator.
End Subroutine MenuInit
!---------------------------------------------------------------------------7 9
Subroutine MenuUse(Value)
 implicit none
  integer(kind=glcint), intent(inout) :: Value
    
   select case(Value)                  !These are menu-based controls.
    case( 1_glcint); iZoom=1-iZoom         !Displays zoom view of character.
    case( 2_glcint); call CFontGen         !   Reads: "CFontIn.Txt" ,
                                           !produces: "CFontOut.Txt", and stops.
    case( 3_glcint); stop 'End of run (CFont:MenuUse)'
   end select !Value
  return
end subroutine MenuUse
!---------------------------------------------------------------------------7 9
Subroutine KeybdUse(key,x,y)  !"Callback" called by OpenGL after a key pressed.
  Implicit none
   character(kind=glubyte) ,intent(inout):: key
   integer(kind=glcint)    ,intent(inout):: x
   integer(kind=glcint)    ,intent(inout):: y
    KeyChar=iChar(key)            !Processes a single character.
    select case(Key)              !These are keyboard-based controls.
     case(    'q'); stop 'End of run (CFont:KeybdUse: key="q" )'
     case('Z','z'); iZoom=1-iZoom     !Toggles zoom view
    end select !Key
   return               !Return to OpenGL
 End Subroutine KeyBdUse
!---------------------------------------------------------------------------7 9
Subroutine Colors(nCol)   !These are approximately the 16 DOS colors.
 implicit none
  integer*4 :: IndCol(3,0:15),i,n,nCol
  real*4    :: Red,Green,Blue

!   0 gxBLACK       1 gxBLUE          2 gxGREEN       3 gxCYAN
!   4 gxRED         5 gxMAGENTA       6 gxBROWN       7 gxGRAY
!   8 gxDARKGRAY    9 gxLIGHTBLUE    10 gxLIGHTGREEN 11 gxLIGHTCYAN
!  12 gxLIGHTRED   13 gxLIGHTMAGENTA 14 gxYELLOW     15 gxWHITE
  data ((IndCol(i,n),i=1,3),n=0,15)/                              &
     0,  0,  0,      0,  0,170,        0,170,  0,      0,170,170  &
  ,170,  0,  0,    170,  0,170,      170, 85,  0,    170,170,170  &
  , 85, 85, 85,     85, 85,255,       85,255, 85,     85,255,255  &
  ,255, 85, 85,    255, 85,255,      255,255, 85,    255,255,255 /

   if((nCol.lt.0).or.(nCol.gt.15))stop 'Colors:color# outside the range [0,15]'
   Red  =IndCol(1,nCol)/255.
   Green=IndCol(2,nCol)/255.
   Blue =IndCol(3,nCol)/255.
   call glColor3f(Red,Green,Blue)
   return
End Subroutine Colors
!---------------------------------------------------------------------------7 9
Subroutine AlphaCF(LabelL,x,iColorC,iColorV,iColorB)
!2004.02.17.1310cst JMS -A700/Nt4.0:sp6/CVF6.6b/Ogl1.2.1/Glut3.7.6
!                   Jeff Setterholm
!CFont-tube font.   Inspired by Genus Graphics font: "LED30"

!Subroutine "AlphaCF": Copyright 2004 by Jeffrey M. Setterholm.
!This subroutine may be incorporated or adapted into your software
! without permission and without license fees.

!  In this implementation: 
!    The "&" (38d) symbol produces full-on.        (perhaps: 255d)

! Example calls:
!  character::Chn*40
!  real*8   ::x(3)
!  Chn="ABCDEFGHIJKLMNOPQRSTUVWXYZ"C
!  x(1)=-1.d0 ;x(2)=.1d0 ;x(3)=.9d0 ;call AlphaCF(Chn,x,15, 8, 0)
!  Chn='0123456789abcdef "' // "&'()*+,-./:=~" // char(176) // char(0)
!  x(1)=-1.d0 ;x(2)=.0d0 ;x(3)=.9d0 ;call AlphaCF(Chn,x,15,-1,-1)

 implicit none
  character::LabelL*40                                               !Arguments
  real*8   ::x(3)
  integer*4::iColorC,iColorV,iColorB

  integer*4::i,Init,iPass,j,n                                        !Internals
  integer*4:: iAscii(0:255)
  character::cAsciiC(0:255)*1
! character::cAsciiV(0:255)*1

  integer*4::nCharTot=60 !These arrays are dimensioned for 60 characters total.
  integer*2                    ::iFLineC(21,60)               !Characters
  integer(kind=glubyte)        ::              FontC( 42 ,60) 
                    equivalence( iFLineC      ,FontC         )
  integer(kind=glubyte) ,target::              FontCT( 42 ,60)
  integer*2                    ::iFLineV(21,60)               !Voids
  integer(kind=glubyte)        ::              FontV( 42 ,60) 
                    equivalence( iFLineV,      FontV          )
  integer(kind=glubyte) ,target::              FontVT( 42 ,60)
  integer(kind=glubyte),pointer::              FontP(:)       !image pointer
 
  character::  LabL40*40,LabL1(40)*1    !The input label is 40 characters max.,
   equivalence(LabL40   ,LabL1       )  !including the null (zero) termination.
  real(kind=GLfloat)::Xgl       ,Ygl       ,Zgl

! " ",'"',"&","'","(",")","*","+",",","-"  (&=full on)
!,".","/","0","1","2","3","4","5","6","7"     These are the characters below.
!,"8","9",":","=","A","B","C","D","E","F"
!,"G","H","I","J","K","L","M","N","O","P"
!,"Q","R","S","T","U","V","W","X","Y","Z"
!,"a","b","c","d","e","f","~","°"

!This is the CFontOut.Txt output:
Data(cAsciiC(j),(iFLineC(i,j),i=1,21),j= 1,30) / & !Characters.
 " ",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,'"',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'2002',z'7007',z'7007' &
    ,z'7007',z'7007',z'7007',z'7007',z'7007',z'2002',z'0000' &
,"&",z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF' & !(full-on)
    ,z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF' &
    ,z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF',z'FFFF' &
,"'",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'8000',z'C001',z'C001' &
    ,z'C001',z'C001',z'C001',z'C001',z'C001',z'8000',z'0000' &
,"(",z'0000',z'3800',z'7000',z'A000',z'C001',z'C001',z'C001' &
    ,z'C001',z'C001',z'8001',z'0000',z'8001',z'C001',z'C001' &
    ,z'C001',z'C001',z'C001',z'A000',z'7000',z'3800',z'0000' &
,")",z'0000',z'000E',z'0007',z'8002',z'C001',z'C001',z'C001' &
    ,z'C001',z'C001',z'C000',z'0000',z'C000',z'C001',z'C001' &
    ,z'C001',z'C001',z'C001',z'8002',z'0007',z'000E',z'0000' &
,"*",z'0000',z'0000',z'0000',z'0000',z'0000',z'3006',z'7007' &
    ,z'6003',z'4001',z'380E',z'7C1F',z'380E',z'4001',z'6003' &
    ,z'7007',z'3006',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"+",z'0000',z'0000',z'0000',z'0000',z'8000',z'C001',z'C001' &
    ,z'C001',z'C001',z'BC1E',z'7E3F',z'BC1E',z'C001',z'C001' &
    ,z'C001',z'C001',z'8000',z'0000',z'0000',z'0000',z'0000' &
,",",z'0000',z'8003',z'C001',z'E000',z'7000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"-",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'F007',z'F80F',z'F007',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,".",z'0000',z'C001',z'E003',z'C001',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"/",z'0000',z'0000',z'0000',z'0020',z'0030',z'0038',z'001C' &
    ,z'000E',z'0007',z'0003',z'4001',z'6000',z'7000',z'3800' &
    ,z'1C00',z'0E00',z'0600',z'0200',z'0000',z'0000',z'0000' &
,"0",z'0000',z'F007',z'F80F',z'F417',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0630',z'0000',z'0630',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F417',z'F80F',z'F007',z'0000' &
,"1",z'0000',z'780F',z'7007',z'A002',z'C001',z'C001',z'C001' &
    ,z'C001',z'C001',z'8000',z'0000',z'8000',z'C001',z'C001' &
    ,z'C001',z'C001',z'C001',z'C002',z'4007',z'800F',z'0000' &
,"2",z'0000',z'FE1F',z'FC2F',z'F837',z'0038',z'0038',z'0038' &
    ,z'0038',z'0038',z'F017',z'F80F',z'F407',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'0E00',z'F407',z'F80F',z'F007',z'0000' &
,"3",z'0000',z'F03F',z'F81F',z'F40F',z'0E00',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'F407',z'F80F',z'F407',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'0E00',z'F40F',z'F81F',z'F03F',z'0000' &
,"4",z'0000',z'0200',z'0600',z'0E00',z'0E00',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'F61F',z'FA2F',z'F637',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'0E38',z'0630',z'0220',z'0000' &
,"5",z'0000',z'F007',z'F80F',z'F407',z'0E00',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'F407',z'F80F',z'F037',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'F037',z'F82F',z'FC1F',z'0000' &
,"6",z'0000',z'F007',z'F80F',z'F417',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F437',z'F80F',z'F037',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'F017',z'F80F',z'F807',z'0000' &
,"7",z'0000',z'0200',z'0600',z'0E00',z'0E00',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'0600',z'0000',z'0600',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'0E00',z'F60F',z'FA1F',z'FC3F',z'0000' &
,"8",z'0000',z'F007',z'F80F',z'F417',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F417',z'F80F',z'F417',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F417',z'F80F',z'F007',z'0000' &
,"9",z'0000',z'F03F',z'F81F',z'F40F',z'0E00',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'F607',z'F80F',z'F617',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F417',z'F80F',z'F007',z'0000' &
,":",z'0000',z'0000',z'0000',z'0000',z'8000',z'C001',z'C001' &
    ,z'C001',z'8000',z'0000',z'0000',z'0000',z'8000',z'C001' &
    ,z'C001',z'C001',z'8000',z'0000',z'0000',z'0000',z'0000' &
,"<",z'0000',z'0000',z'0000',z'0000',z'0000',z'E001',z'C003' &
    ,z'8007',z'000F',z'001E',z'0000',z'001E',z'000F',z'8007' &
    ,z'C003',z'E001',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"=",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'F007' &
    ,z'F80F',z'F007',z'0000',z'0000',z'0000',z'F007',z'F80F' &
    ,z'F007',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,">",z'0000',z'0000',z'0000',z'0000',z'0000',z'C003',z'E001' &
    ,z'F000',z'7800',z'3C00',z'0000',z'3C00',z'7800',z'F000' &
    ,z'E001',z'C003',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"A",z'0000',z'0220',z'0630',z'0E38',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F637',z'F80F',z'F637',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F417',z'F80F',z'F007',z'0000' &
,"B",z'0000',z'F01F',z'F82F',z'F437',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F437',z'F80F',z'F437',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F437',z'F82F',z'F01F',z'0000' &
,"C",z'0000',z'F807',z'FC0F',z'FE17',z'0038',z'0038',z'0038' &
    ,z'0038',z'0038',z'0030',z'0000',z'0030',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'FE17',z'FC0F',z'F807',z'0000' &
,"D",z'0000',z'F01F',z'F82F',z'F437',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0630',z'0000',z'0630',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F437',z'F82F',z'F01F',z'0000' /
Data(cAsciiC(j),(iFLineC(i,j),i=1,21),j=31,60) / & !Characters.
 "E",z'0000',z'FE1F',z'FC2F',z'F837',z'0038',z'0038',z'0038' &
    ,z'0038',z'0038',z'F037',z'F80F',z'F037',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'F837',z'FC2F',z'FE1F',z'0000' &
,"F",z'0000',z'0020',z'0030',z'0038',z'0038',z'0038',z'0038' &
    ,z'0038',z'0038',z'F037',z'F80F',z'F037',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'F837',z'FC2F',z'FE1F',z'0000' &
,"G",z'0000',z'F007',z'F80F',z'F417',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'3630',z'7A00',z'3C30',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'FC17',z'F80F',z'F007',z'0000' &
,"H",z'0000',z'0220',z'0630',z'0E38',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F637',z'F80F',z'F637',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'0E38',z'0630',z'0220',z'0000' &
,"I",z'0000',z'780F',z'7007',z'A002',z'C001',z'C001',z'C001' &
    ,z'C001',z'C001',z'8000',z'0000',z'8000',z'C001',z'C001' &
    ,z'C001',z'C001',z'C001',z'A002',z'7007',z'780F',z'0000' &
,"J",z'0000',z'F007',z'F80F',z'F417',z'0E38',z'0E38',z'0E30' &
    ,z'0E20',z'0E00',z'0600',z'0000',z'0600',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'0E00',z'0E00',z'0600',z'0200',z'0000' &
,"K",z'0000',z'0220',z'0630',z'0E38',z'1E38',z'3C38',z'7838' &
    ,z'F038',z'E031',z'C023',z'001C',z'001E',z'002F',z'8037' &
    ,z'C03B',z'E039',z'F038',z'7838',z'3C30',z'1E20',z'0000' &
,"L",z'0000',z'FE1F',z'FC2F',z'F837',z'0038',z'0038',z'0038' &
    ,z'0038',z'0038',z'0030',z'0000',z'0030',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'0030',z'0030',z'0020',z'0000' &
,"M",z'0000',z'0220',z'0630',z'8E38',z'CE39',z'CE39',z'CE39' &
    ,z'CE39',z'CE39',z'8630',z'0000',z'8630',z'CE39',z'CE39' &
    ,z'CE39',z'CE39',z'CE39',z'D635',z'BA2E',z'7C1F',z'0000' &
,"N",z'0000',z'1E20',z'3C30',z'7A38',z'F638',z'6E38',z'8E38' &
    ,z'CE39',z'CE39',z'8630',z'0000',z'8630',z'CE39',z'CE39' &
    ,z'8E38',z'0E3B',z'8E37',z'0E2F',z'061E',z'023C',z'0000' &
,"O",z'0000',z'FC1F',z'FA2F',z'F637',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0630',z'0000',z'0630',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F637',z'FA2F',z'FC1F',z'0000' &
,"P",z'0000',z'0020',z'0030',z'0038',z'0038',z'0038',z'0038' &
    ,z'0038',z'0038',z'F037',z'F80F',z'F437',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F437',z'F82F',z'F01F',z'0000' &
,"Q",z'0000',z'E61F',z'EE2F',z'DC37',z'3838',z'7638',z'6E38' &
    ,z'0E38',z'0E38',z'0630',z'0000',z'0630',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F637',z'FA2F',z'FC1F',z'0000' &
,"R",z'0000',z'0620',z'0E30',z'1E38',z'3C38',z'7838',z'F038' &
    ,z'E039',z'0038',z'F037',z'F80F',z'F437',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'F437',z'F82F',z'F01F',z'0000' &
,"S",z'0000',z'F007',z'F80F',z'F407',z'0E00',z'0E00',z'0E00' &
    ,z'0E00',z'0600',z'F407',z'F80F',z'F037',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'F017',z'F80F',z'F007',z'0000' &
,"T",z'0000',z'0001',z'8001',z'C001',z'C001',z'C001',z'C001' &
    ,z'C001',z'C001',z'8000',z'0000',z'8000',z'C001',z'C001' &
    ,z'C001',z'C001',z'C001',z'B80E',z'7C1F',z'7E3F',z'0000' &
,"U",z'0000',z'FC1F',z'FA2F',z'F637',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0630',z'0000',z'0630',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'0E38',z'0630',z'0220',z'0000' &
,"V",z'0000',z'6003',z'7007',z'7007',z'380E',z'380E',z'1C1C' &
    ,z'1C1C',z'0E38',z'0630',z'0000',z'0630',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'0E38',z'0630',z'0220',z'0000' &
,"W",z'0000',z'3C1F',z'BA2E',z'D635',z'CE39',z'CE39',z'CE39' &
    ,z'CE39',z'CE39',z'8630',z'0000',z'0630',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'0E38',z'0E38',z'0630',z'0220',z'0000' &
,"X",z'0000',z'0E38',z'0E38',z'1C1C',z'1C1C',z'380E',z'380E' &
    ,z'7007',z'7007',z'6003',z'0000',z'6003',z'7007',z'7007' &
    ,z'380E',z'380E',z'1C1C',z'1C1C',z'0E38',z'0E38',z'0000' &
,"Y",z'0000',z'0001',z'8001',z'C001',z'C001',z'C001',z'C001' &
    ,z'C001',z'C001',z'C001',z'8000',z'6003',z'7007',z'7007' &
    ,z'380E',z'380E',z'1C1C',z'1C1C',z'0E38',z'0E38',z'0000' &
,"Z",z'0000',z'FE1F',z'FC2F',z'F837',z'0038',z'003C',z'001E' &
    ,z'000F',z'0007',z'4003',z'6001',z'7000',z'7800',z'3C00' &
    ,z'1E00',z'0E00',z'0E00',z'F60F',z'FA1F',z'FC3F',z'0000' &
,"a",z'0000',z'C20F',z'E617',z'EE3B',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F637',z'F80F',z'F007',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"b",z'0000',z'F01F',z'F82F',z'F437',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F437',z'F80F',z'F037',z'0038',z'0038' &
    ,z'0038',z'0038',z'0038',z'0030',z'0020',z'0000',z'0000' &
,"c",z'0000',z'F807',z'FC0F',z'FE17',z'0038',z'0038',z'0038' &
    ,z'0038',z'0038',z'FE37',z'FC0F',z'F807',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"d",z'0000',z'F01F',z'F82F',z'F437',z'0E38',z'0E38',z'0E38' &
    ,z'0E38',z'0E38',z'F637',z'F80F',z'F607',z'0E00',z'0E00' &
    ,z'0E00',z'0E00',z'0E00',z'0400',z'0000',z'0000',z'0000' &
,"e",z'0000',z'F807',z'FC0F',z'F817',z'0038',z'0038',z'F037' &
    ,z'F80F',z'F437',z'0E38',z'0E38',z'F417',z'F80F',z'F007' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"f",z'0000',z'0020',z'0030',z'0038',z'0038',z'0038',z'0038' &
    ,z'0038',z'C037',z'E00F',z'C037',z'0038',z'0038',z'0038' &
    ,z'0038',z'F017',z'F80F',z'F007',z'0000',z'0000',z'0000' &
,"~",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'1000',z'5820',z'DC30',z'CE39',z'861D',z'020D',z'0004' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"°",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' & !(=char(176)
    ,z'0000',z'0000',z'0000',z'0000',z'6003',z'7007',z'380E' &
    ,z'180C',z'0000',z'180C',z'380E',z'7007',z'6003',z'0000' &
/
Data(cAsciiC(j),(iFLineV(i,j),i=1,21),j= 1,30) / & !Voids.
 " ",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,'"',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'7007',z'D80D',z'8808',z'8808' &
    ,z'8808',z'8808',z'8808',z'8808',z'8808',z'D80D',z'7007' &
,"&",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' & !(full-on)
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"'",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'C001',z'6003',z'2002',z'2002' &
    ,z'2002',z'2002',z'2002',z'2000',z'2002',z'6003',z'C001' &
,"(",z'7C00',z'C400',z'8C01',z'5803',z'2002',z'2002',z'2002' &
    ,z'2002',z'2002',z'6002',z'C003',z'6002',z'2002',z'2002' &
    ,z'2002',z'2002',z'2002',z'5803',z'8C01',z'C400',z'7C00' &
,")",z'001F',z'8011',z'C018',z'600D',z'2006',z'2002',z'2002' &
    ,z'2002',z'2002',z'2003',z'E001',z'2003',z'2002',z'2002' &
    ,z'2002',z'2002',z'2006',z'600D',z'C018',z'8011',z'001F' &
,"*",z'0000',z'0000',z'0000',z'0000',z'780F',z'C809',z'8808' &
    ,z'980C',z'BC1E',z'C631',z'8220',z'C631',z'BC1E',z'980C' &
    ,z'8808',z'C809',z'780F',z'0000',z'0000',z'0000',z'0000' &
,"+",z'0000',z'0000',z'0000',z'C001',z'6003',z'2002',z'2002' &
    ,z'2002',z'3E3E',z'4361',z'8140',z'4361',z'3E3E',z'2002' &
    ,z'2002',z'2002',z'6003',z'C001',z'0000',z'0000',z'0000' &
,",",z'C007',z'6004',z'3006',z'1803',z'8801',z'F800',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"-",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'F80F',z'0C18',z'0410',z'0C18',z'F80F',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,".",z'E003',z'3006',z'1004',z'3006',z'E003',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"/",z'0000',z'0000',z'0070',z'0058',z'004C',z'0046',z'0063' &
    ,z'8031',z'8018',z'E00C',z'B006',z'9803',z'8C00',z'C600' &
    ,z'6300',z'3100',z'1900',z'0D00',z'0700',z'0000',z'0000' &
,"0",z'F80F',z'0C18',z'0630',z'0B68',z'F147',z'1144',z'1144' &
    ,z'1144',z'1144',z'194C',z'0F78',z'194C',z'1144',z'1144' &
    ,z'1144',z'1144',z'F147',z'0B68',z'0630',z'0C18',z'F80F' &
,"1",z'FC1F',z'8410',z'8C18',z'580D',z'3006',z'2002',z'2002' &
    ,z'2002',z'2002',z'6003',z'C001',z'6003',z'2002',z'2002' &
    ,z'2002',z'2002',z'2006',z'200D',z'A018',z'6010',z'C01F' &
,"2",z'FF3F',z'0160',z'0350',z'0648',z'FC47',z'0044',z'0044' &
    ,z'0044',z'F847',z'0C68',z'0630',z'0B18',z'F10F',z'1100' &
    ,z'1100',z'1100',z'F10F',z'0B18',z'0610',z'0C18',z'F80F' &
,"3",z'F87F',z'0C40',z'0660',z'0B30',z'F11F',z'1100',z'1100' &
    ,z'1100',z'F10F',z'0B18',z'0610',z'0B18',z'F10F',z'1100' &
    ,z'1100',z'1100',z'F11F',z'0B30',z'0660',z'0C40',z'F87F' &
,"4",z'0700',z'0D00',z'1900',z'1100',z'1100',z'1100',z'1100' &
    ,z'1100',z'F13F',z'0960',z'0550',z'0948',z'F147',z'1144' &
    ,z'1144',z'1144',z'1144',z'1144',z'194C',z'0D58',z'0770' &
,"5",z'F80F',z'0C18',z'0610',z'0B18',z'F10F',z'1100',z'1100' &
    ,z'1100',z'F10F',z'0B18',z'0670',z'0C48',z'F847',z'0044' &
    ,z'0044',z'0044',z'F847',z'0C48',z'0650',z'0260',z'FE3F' &
,"6",z'F80F',z'0C18',z'0630',z'0B68',z'F147',z'1144',z'1144' &
    ,z'1144',z'F147',z'0B48',z'0670',z'0C48',z'F847',z'0044' &
    ,z'0044',z'0044',z'F847',z'0C68',z'0430',z'0418',z'FC0F' &
,"7",z'0700',z'0D00',z'1900',z'1100',z'1100',z'1100',z'1100' &
    ,z'1100',z'1100',z'1900',z'0F00',z'1900',z'1100',z'1100' &
    ,z'1100',z'1100',z'F11F',z'0930',z'0560',z'0340',z'FE7F' &
,"8",z'F80F',z'0C18',z'0630',z'0B68',z'F147',z'1140',z'1140' &
    ,z'1140',z'F147',z'0B68',z'0630',z'0B68',z'F147',z'1144' &
    ,z'1144',z'1144',z'F147',z'0B68',z'0630',z'0C18',z'F80F' &
,"9",z'F87F',z'0C40',z'0660',z'0B30',z'F11F',z'1100',z'1100' &
    ,z'1100',z'F10F',z'0918',z'0730',z'0968',z'F147',z'1144' &
    ,z'1144',z'1144',z'F147',z'0B68',z'0630',z'0C18',z'F80F' &
,":",z'0000',z'0000',z'0000',z'C001',z'6003',z'2002',z'2002' &
    ,z'2002',z'6003',z'C001',z'0000',z'C001',z'6003',z'2002' &
    ,z'2002',z'2002',z'6003',z'C001',z'0000',z'0000',z'0000' &
,"<",z'0000',z'0000',z'0000',z'0000',z'F803',z'1806',z'300C' &
    ,z'6018',z'C030',z'8021',z'003F',z'8021',z'C030',z'6018' &
    ,z'300C',z'1806',z'FC03',z'0000',z'0000',z'0000',z'0000' &
,"=",z'0000',z'0000',z'0000',z'0000',z'0000',z'F80F',z'0C18' &
    ,z'0410',z'0C18',z'F80F',z'0000',z'F80F',z'0C18',z'0410' &
    ,z'0C18',z'F80F',z'0000',z'0000',z'0000',z'0000',z'0000' &
,">",z'0000',z'0000',z'0000',z'0000',z'E01F',z'300C',z'1806' &
    ,z'0C03',z'8601',z'C200',z'7E00',z'C200',z'8601',z'0C03' &
    ,z'1806',z'300C',z'E01F',z'0000',z'0000',z'0000',z'0000' &
,"A",z'0770',z'0D58',z'194C',z'1144',z'1144',z'1144',z'1144' &
    ,z'F147',z'F147',z'0948',z'0770',z'0948',z'F147',z'1144' &
    ,z'1144',z'1144',z'F147',z'0B68',z'0630',z'0C18',z'F80F' &
,"B",z'F83F',z'0C60',z'0650',z'0B48',z'F147',z'1144',z'1144' &
    ,z'1144',z'F147',z'0B48',z'0670',z'0B48',z'F147',z'1144' &
    ,z'1144',z'1144',z'F147',z'0B48',z'0650',z'0C60',z'F83F' &
,"C",z'FC0F',z'0618',z'0330',z'0168',z'FF47',z'0044',z'0044' &
    ,z'0044',z'0044',z'004C',z'0078',z'004C',z'0044',z'0044' &
    ,z'0044',z'0044',z'FF47',z'0168',z'0330',z'0618',z'FC0F' &
,"D",z'F83F',z'0C60',z'0650',z'0B48',z'F147',z'1144',z'1144' &
    ,z'1144',z'1144',z'194C',z'0F78',z'194C',z'1144',z'1144' &
    ,z'1144',z'1144',z'F147',z'0B48',z'0650',z'0C60',z'F83F' /
Data(cAsciiC(j),(iFLineV(i,j),i=1,21),j=31,60) / & !Voids.
 "E",z'FF3F',z'0160',z'0350',z'0648',z'FC47',z'0044',z'0044' &
    ,z'0044',z'F847',z'0C48',z'0470',z'0C48',z'F847',z'0044' &
    ,z'0044',z'0044',z'FC47',z'0648',z'0350',z'0160',z'FF3F' &
,"F",z'0070',z'0058',z'004C',z'0044',z'0044',z'0044',z'0044' &
    ,z'0044',z'F847',z'0C48',z'0470',z'0C48',z'F847',z'0044' &
    ,z'0044',z'0044',z'FC47',z'0648',z'0350',z'0160',z'FF3F' &
,"G",z'F80F',z'0C18',z'0630',z'0B68',z'F147',z'1144',z'1144' &
    ,z'1144',z'7144',z'C94C',z'8578',z'C34C',z'7E44',z'0044' &
    ,z'0044',z'0044',z'FE47',z'0268',z'0630',z'0C18',z'F80F' &
,"H",z'0770',z'0D58',z'194C',z'1144',z'1144',z'1144',z'1144' &
    ,z'1144',z'F147',z'0948',z'0770',z'0948',z'F147',z'1144' &
    ,z'1144',z'1144',z'1144',z'1144',z'194C',z'0D58',z'0770' &
,"I",z'FC1F',z'8410',z'8C18',z'580D',z'3006',z'2002',z'2002' &
    ,z'2002',z'2002',z'6003',z'C001',z'6003',z'2002',z'2002' &
    ,z'2002',z'2002',z'3006',z'580D',z'8C18',z'8410',z'FC1F' &
,"J",z'F80F',z'0C18',z'0630',z'0B68',z'F147',z'1144',z'114C' &
    ,z'1158',z'1170',z'1900',z'0F00',z'1900',z'1100',z'1100' &
    ,z'1100',z'1100',z'1100',z'1100',z'1900',z'0D00',z'0700' &
,"K",z'0770',z'0D58',z'194C',z'3144',z'6144',z'C344',z'8645' &
    ,z'0C47',z'184E',z'305C',z'E063',z'8061',z'C050',z'6048' &
    ,z'3044',z'1846',z'0C47',z'8645',z'C34C',z'6158',z'3F70' &
,"L",z'FF3F',z'0160',z'0350',z'0648',z'FC47',z'0044',z'0044' &
    ,z'0044',z'0044',z'004C',z'0078',z'004C',z'0044',z'0044' &
    ,z'0044',z'0044',z'0044',z'004C',z'0048',z'0058',z'0070' &
,"M",z'0770',z'0D58',z'D949',z'7147',z'3146',z'3146',z'3146' &
    ,z'3146',z'3146',z'794F',z'CF79',z'794F',z'3146',z'3146' &
    ,z'3146',z'3146',z'3146',z'294A',z'4551',z'8360',z'FE3F' &
,"N",z'3F70',z'6158',z'C34C',z'8545',z'0945',z'9145',z'7147' &
    ,z'3146',z'3146',z'794F',z'CF79',z'794F',z'3146',z'3146' &
    ,z'7147',z'D144',z'5148',z'D150',z'9961',z'0D43',z'077E' &
,"O",z'FE3F',z'0360',z'0550',z'0948',z'F147',z'1144',z'1144' &
    ,z'1144',z'1144',z'194C',z'0F78',z'194C',z'1144',z'1144' &
    ,z'1144',z'1144',z'F147',z'0948',z'0550',z'0360',z'FE3F' &
,"P",z'0070',z'0058',z'004C',z'0044',z'0044',z'0044',z'0044' &
    ,z'0044',z'F847',z'0C48',z'0670',z'0B48',z'F147',z'0144' &
    ,z'0144',z'0144',z'F147',z'0B48',z'0650',z'0C60',z'F83F' &
,"Q",z'FF3F',z'1960',z'1150',z'2348',z'C747',z'8944',z'9144' &
    ,z'F144',z'1144',z'194C',z'0F78',z'194C',z'1144',z'1144' &
    ,z'1144',z'1144',z'F147',z'0948',z'0550',z'0360',z'FE3F' &
,"R",z'0F70',z'1958',z'314C',z'6144',z'C344',z'8645',z'0C47' &
    ,z'1846',z'F847',z'0C48',z'0670',z'0B48',z'F147',z'1144' &
    ,z'1144',z'1144',z'F147',z'0B48',z'0650',z'0C60',z'F83F' &
,"S",z'F80F',z'0C18',z'0610',z'0B18',z'F10F',z'1100',z'1100' &
    ,z'1100',z'F90F',z'0A18',z'0670',z'0C48',z'F847',z'0044' &
    ,z'0044',z'0044',z'F847',z'0C68',z'0430',z'0C18',z'F80F' &
,"T",z'8003',z'C002',z'6002',z'2002',z'2002',z'2002',z'2002' &
    ,z'2002',z'2002',z'6003',z'C001',z'6003',z'2002',z'2002' &
    ,z'2002',z'2002',z'3C1E',z'4631',z'8360',z'8140',z'FF7F' &
,"U",z'FE3F',z'0360',z'0550',z'0948',z'F147',z'1144',z'1144' &
    ,z'1144',z'1144',z'194C',z'0F78',z'194C',z'1144',z'1144' &
    ,z'1144',z'1144',z'1144',z'1144',z'194C',z'0D58',z'0770' &
,"V",z'F007',z'980C',z'8808',z'8C18',z'C411',z'4631',z'6223' &
    ,z'2362',z'3146',z'194C',z'0F78',z'194C',z'1144',z'1144' &
    ,z'1144',z'1144',z'1144',z'1144',z'194C',z'0D58',z'0770' &
,"W",z'FE3F',z'C360',z'4551',z'294A',z'3146',z'3146',z'3146' &
    ,z'3146',z'3146',z'794F',z'CF79',z'194C',z'1144',z'1144' &
    ,z'1144',z'1144',z'1144',z'1144',z'194C',z'0D58',z'0770' &
,"X",z'1F7C',z'1144',z'3146',z'2362',z'6222',z'4631',z'C411' &
    ,z'8C18',z'8808',z'980C',z'F007',z'980C',z'8808',z'8C18' &
    ,z'C411',z'4631',z'6223',z'2362',z'3146',z'1144',z'1F7C' &
,"Y",z'8003',z'C002',z'6002',z'2002',z'2002',z'2002',z'2002' &
    ,z'2002',z'2002',z'2002',z'7007',z'980C',z'8808',z'8C18' &
    ,z'C411',z'4631',z'6223',z'2362',z'3146',z'1144',z'1F7C' &
,"Z",z'FF3F',z'0160',z'0350',z'0648',z'FC47',z'0043',z'8061' &
    ,z'C030',z'E018',z'B00C',z'9806',z'8C03',z'8600',z'C300' &
    ,z'6100',z'3100',z'F11F',z'0930',z'0560',z'0340',z'FE7F' &
,"a",z'E71F',z'3D30',z'1968',z'1144',z'F147',z'1144',z'1144' &
    ,z'1144',z'F147',z'0948',z'0770',z'0C18',z'F80F',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"b",z'F83F',z'0C60',z'0650',z'0B48',z'F147',z'1144',z'1144' &
    ,z'1144',z'F147',z'0B48',z'0670',z'0C48',z'F847',z'0044' &
    ,z'0044',z'0044',z'0044',z'004C',z'0058',z'0070',z'0000' &
,"c",z'FC0F',z'0618',z'0330',z'0168',z'FF47',z'0044',z'0044' &
    ,z'0044',z'FF47',z'0148',z'0370',z'0618',z'FC0F',z'0000' &
    ,z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"d",z'F83F',z'0C60',z'0650',z'0B48',z'F147',z'1144',z'1144' &
    ,z'1144',z'F147',z'0948',z'0770',z'0918',z'F10F',z'1100' &
    ,z'1100',z'1100',z'1100',z'0B00',z'0E00',z'0400',z'0000' &
,"e",z'FF0F',z'0718',z'0330',z'0668',z'FC47',z'F847',z'0C48' &
    ,z'0670',z'0B48',z'F147',z'F147',z'0B68',z'0630',z'0C18' &
    ,z'F80F',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"f",z'0070',z'0058',z'004C',z'0044',z'0044',z'0044',z'0044' &
    ,z'E047',z'3048',z'1070',z'3048',z'E047',z'0044',z'0044' &
    ,z'F847',z'0C68',z'0430',z'0C18',z'F80F',z'0000',z'0000' &
,"~",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'3800' &
    ,z'EC70',z'A659',z'234F',z'3146',z'7962',z'CD32',z'871B' &
    ,z'000E',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' &
,"°",z'0000',z'0000',z'0000',z'0000',z'0000',z'0000',z'0000' & !(=char(176)
    ,z'0000',z'0000',z'0000',z'F007',z'980C',z'8C18',z'C411' &
    ,z'6413',z'3C1E',z'6413',z'C411',z'8C18',z'980C',z'F007' &
/

   if(Init.gt.0) goto 10                               !Initialization
     iAscii=0                !Zeros the iAscii array.
     do 5 n=1,nCharTot
       i=iChar(cAsciiC(n))
 5     iAscii(i)=n
     FontCT=FontC            !Put the data in "targetable" (pointable) form
     FontVT=FontV ;init=1    !    for eventual use in glBitmap().

10 continue                                            !Display the characters
   call glMatrixMode(GL_MODELVIEW ) ;call glPushMatrix; call glLoadIdentity
   call glPixelStorei(GL_UNPACK_ALIGNMENT,1)

   LabL40=char(0)
   LabL40=LabelL 
   LabL1(40)=char(0)
   do 30 iPass=1,3     !Draw the background,then the character,then the voids.
     select case(iPass)                 !Color selection
      case(1); if(iColorB.lt.0) goto 30 ;call Colors(iColorB) !Background
      case(2); if(iColorC.lt.0) goto 30 ;call Colors(iColorC) !Characters
      case(3); if(iColorV.lt.0) goto 30 ;call Colors(iColorV) !Void
     end select !iPass
     do 20 i=1,40                       !Process the input character string.
       n=iChar(LabL1(i))      ;if(n.eq.0) goto 21  !Null terminates the string.
       Xgl=x(1)+(i-1)*(16*2.666)/640.;Ygl=x(2) ;Zgl=x(3)   !Compute draw point.
        select case(iPass)                   !Select the pixel pattern to draw.
         case(1); n=3; Zgl=Zgl+.001               !Background. n=3 is "&".
                  FontP=>FontCT(1:42,n)           !           Drawn behind.
         case(2); n=iAscii(n) ;if(n.eq.0) goto 20 !Character
                  FontP=>FontCT(1:42,n) 
         case(3); n=iAscii(n) ;if(n.eq.0) goto 20 !Void
                  FontP=>FontVT(1:42,n)
        end select !iPass
        call glRasterPos3f(Xgl,Ygl,Zgl)        !Move to the 3-D draw point.
        call glBitmap(16,21,0.,0.,0.,0.,FontP) !Draw the pixel pattern
20   continue
21 continue
30 continue
   call glFlush       !Command to OpenGL to "complete the process". 
   call glMatrixMode(GL_MODELVIEW ) ;call glPopMatrix
  return
end Subroutine AlphaCF
!---------------------------------------------------------------------------7 9
End Module CFontSup
!---------------------------------------------------------------------------7 9

Program CFont
              !opengl_
 use CFontSup !^CFontSup-CFontUse,KeybdUse

 implicit none
  integer*4::winid

   write(6,"(1x,'Contrast Font Demonstration / Generation'"                // &
           "/1x,'CFont.Exe version 1.2  -  Jeff Setterholm'"               // &
        "/1x/1x,'Minimize this screen unless you`re converting CFontIn.Txt.')")

   call glutInit                       !Initialize OpenGL
   call glutInitDisplayMode(ior(GLUT_DOUBLE,ior(GLUT_RGBA,GLUT_DEPTH)))
   call glutInitWindowSize(640,480) 
   call glutInitWindowPosition(0_glint,0_glint)
   call glClear(GL_COLOR_BUFFER_BIT)
   call glColor3f(1.,1.,0.)
   winid = glutCreateWindow("CFont.Exe Version 1.3")
   call glEnable(GL_DEPTH_TEST)

   call  glutDisplayFunc(ScrnUse)      !Identify the callback routines
   call     glutIdleFunc(ScrnUse)
   call glutKeyboardFunc(KeybdUse)
   call MenuInit

   call glutSwapBuffers
   call glutPostRedisplay
   call glutmainloop                   !Transfer control to OpenGL
End Program CFont
!---------------------------------------------------------------------------7 9

!---------------------------------------------------------------------------7 9
!Pressing the "^" key: activates the following subroutine,
!                        after which the program halts.
Subroutine CFontGen
!2004.02.24.0935cst JMS -A700/Nt4.0:sp6/CVF6.6b/Ogl1.2.1/Glut3.7.6

!Subroutine "CFontGen": Copyright 2004 by Jeffrey M. Setterholm.
!This subroutine may be incorporated or adapted into your software 
! without permission and without license fees.  
  
!Reads: "CFontIn.Txt" which has "C"'s as characters & "-"'s as voids/outlines.
!        A 15 x 21 pixel font. (Other sizes not tested.) e.g. the letter "A":
!           (symbolic)               ->   (hexadecimal (z'') ) 
!65 "A" !---------------------- 15x21       C's       -'s
! . . . - - - - - - - - - . . .           z'0000'   z'0770'
! . . - - C C C C C C C - - . .           z'0220'   z'0D58'
! . - - C C C C C C C C C - - .           z'0630'   z'194C'
! - - C - C C C C C C C - C - -           z'0E38'   z'1144'
! - C C C - - - - - - - C C C -           z'0E38'   z'1144'
! - C C C - . . . . . - C C C -           z'0E38'   z'1144'
! - C C C - . . . . . - C C C -           z'0E38'   z'1144'
! - C C C - . . . . . - C C C -           z'0E38'   z'F147'
! - C C C - - - - - - - C C C -           z'0E38'   z'F147'
! - C C - C C C C C C C - C C -           z'F637'   z'0948'
! - - - C C C C C C C C C - - -           z'F80F'   z'0770'
! - C C - C C C C C C C - C C -           z'F637'   z'0948'
! - C C C - - - - - - - C C C -           z'0E38'   z'F147'
! - C C C - - - - - - - C C C -           z'0E38'   z'1144'
! - C C C - . . . . . - C C C -           z'0E38'   z'1144'
! - C C C - . . . . . - C C C -           z'0E38'   z'1144'
! - C C C - . . . . . - C C C -           z'0E38'   z'F147'
! - C C C - . . . . . - C C C -           z'F417'   z'0B68'
! - C C - - . . . . . - - C C -           z'F80F'   z'0630'
! - C - - . . . . . . . - - C -           z'F007'   z'0C18'
! - - - . . . . . . . . . - - -           z'0000'   z'F80F'
!^a 16th blank column on the left side is implicitly in the hex representation.

!Produces: "CFontOut.Txt" which can be copied into "AlphaCF" as the font.
!        A 16 x 21 pixel font (with the extra column on the left side).
!e.g. the letter "A" as copied into subroutine "AlphaCF" as:
!,"A",z'0000',z'0220',z'0630',z'0E38',z'0E38',z'0E38',z'0E38' &  character
!    ,z'0E38',z'0E38',z'F637',z'F80F',z'F637',z'0E38',z'0E38' &
!    ,z'0E38',z'0E38',z'0E38',z'F417',z'F80F',z'F007',z'0000' &
!,"A",z'0770',z'0D58',z'194C',z'1144',z'1144',z'1144',z'1144' &  void/border
!    ,z'F147',z'F147',z'0948',z'0770',z'0948',z'F147',z'1144' &
!    ,z'1144',z'1144',z'F147',z'0B68',z'0630',z'0C18',z'F80F' &

!           (symbolic)               ->   (hexadecimal (z'') )
!47 "/" !---------------------- 15x21       C's       -'s
! . . . . . . . . . . . . . . .           z'0000'   z'0000'
! . . . . . . . . . . . . . . .           z'0000'   z'0000'
! . . . . . . . . . . . . - - -           z'0000'   z'0070'
! . . . . . . . . . . . - - C -           z'0020'   z'0058'
! . . . . . . . . . . - - C C -           z'0030'   z'004C'
! . . . . . . . . . - - C C C -           z'0038'   z'0046'
! . . . . . . . . - - C C C - -           z'001C'   z'0063'
! . . . . . . . - - C C C - - .           z'000E'   z'8031'
! . . . . . . . - C C C - - . .           z'0007'   z'8018'
! . . . . . - - - C C - - . . .           z'0003'   z'E00C'
! . . . . - - C - C - - . . . .           z'4001'   z'B006'
! . . . - - C C - - - . . . . .           z'6000'   z'9803'
! . . - - C C C - . . . . . . .           z'7000'   z'8C00'
! . - - C C C - - . . . . . . .           z'3800'   z'C600'
! - - C C C - - . . . . . . . .           z'1C00'   z'6300'
! - C C C - - . . . . . . . . .           z'0E00'   z'3100'
! - C C - - . . . . . . . . . .           z'0600'   z'1900'
! - C - - . . . . . . . . . . .           z'0200'   z'0D00'
! - - - . . . . . . . . . . . .           z'0000'   z'0700'
! . . . . . . . . . . . . . . .           z'0000'   z'0000'
! . . . . . . . . . . . . . . .           z'0000'   z'0000'
!How the hexadecimal codes should look was not obvious to me.
!I experimented with the hexadecimal generator until it worked.

!In this implementation:
!  The "&" (38d) symbol produces full-on.                (255d)

 implicit none
  integer*4::nHor,mVer,nCharTot,nPower
  integer*4::iAsc,iComma,iPass,m,n,nC,nCSeq                                !,nA
  integer*4::iAscii(0:255)
  integer*4::i4Line(21,128,2)                              !128 characters max.
  character::  cString(31)*1 ,cString31*31
  equivalence( cString       ,cString31    )                     

   nCSeq=0
   i4Line=0
   open(unit=14,file='CFontIn.Txt',action='read') !Import the character set.
    read(14,*) nHor,mVer,nCharTot     !Horizontal and vertical pixels + #char's
    if((nHor.ne.15).or.(mVer.ne.21)) stop 'Expects 15 x 21 pixel font input.'
    if(nCharTot.gt.128) stop 'Character count must be <= 128.'
    do 10 nC=1,nCharTot
      read(14,*) iAsc
       if(iAsc.eq.0) goto 11          !"0" at beginning of line ends reading.
      nCSeq=nC                        !Otherwise, nCharTot characters are read.
      iAscii(iAsc)=nCSeq              !nCSeq: number of Character in sequence.
      write(6,"(1x,'nC=',i3,2x,'iAsc=',i3,2x,3a1)") & !Prints to the DOS screen
       nCSeq,iAsc,char(34),char(iAsc),char(34)
      do 5 m=1,mVer
        read(14,"(a31)") cString31
        do 4 n=1,nHor                 !Hexadecimal generator.
                     nPower= 7 -n         !Reverse the bits and swap the bytes.
          if(n.gt.7) nPower=23 -n        
          if(cString(n*2+1).eq.'-') &                        !Voids
             i4Line(m,nCSeq,1)=i4Line(m,nCSeq,1)+2**(nPower)
          if(cString(n*2+1).eq.'C') &                        !Characters
             i4Line(m,nCSeq,2)=i4Line(m,nCSeq,2)+2**(nPower)
 4      continue
 5      if(iAsc.eq.38) i4Line(m,nCSeq,2)=z'FFFF' !Blanks a 16th column on the
10  continue !char(38)="&"                       !left side of the character.
11 close(14)
   write(6,"(1x,i3,' characters read. Writing CFontOut.Txt...')") nCSeq

   open(unit=15,file='CFontOut.Txt',action='write') !Export the representation.
   write(15,"( '!This is the CFontOut.Txt output:')")
   do 20 iPass=2,1,-1            !Write the characters, then the voids/borders.
!   An extremely format-specific write follows (which works in CVF6.6b):
     if(iPass.eq.2) write(15  &
   ,"('Data(cAsciiC(j),(iFLineC(i,j),i=1,21),j=1,',i3,') / & !Characters.')") &
                                                nCharTot
     if(iPass.eq.1) write(15  &
   ,"('Data(cAsciiC(j),(iFLineV(i,j),i=1,21),j=1,',i3,') / & !Voids.')") &
                                                nCharTot
     iComma=32
!    Write the characters in ASCII# order, skipping "underfined"'s:
     do 15 iAsc=0,255 ;nCSeq=iAscii(iAsc) ;if(nCSeq.eq.0) goto 15 
       nC=34; if(iAsc.eq.34) nC=39          !puts apostrophes around the quote.
       write(15,"(4a1,7(',z',a1,z4.4,a1),' &')")               &
             char(iComma),char(nC),char(iAsc),char(nC)             &
                ,(char(39),i4Line(m,nCSeq,iPass),char(39),m=21,15,-1)
       write(15,"(4x ,7(',z',a1,z4.4,a1),' &')")   &
                 (char(39),i4Line(m,nCSeq,iPass),char(39),m=14, 8,-1)
       write(15,"(4x ,7(',z',a1,z4.4,a1),' &')")   &
                 (char(39),i4Line(m,nCSeq,iPass),char(39),m= 7, 1,-1)
       iComma=44
15   continue
     write(15,"('/')/1x")
20 continue
   close(15)
   stop 'CFontOut.Txt written. Copy into CFont.F90:subroutine AlphaCF.' !Done
  return
End Subroutine CFontGen
!---------------------------------------------------------------------------7 9
