Someone asked me time back how to control the fonts in OpenGL. I'm posting this example, otherwise it will be lost (even though posting such not that long example on phpBB with its length restrictions is not a pleasant thing. You do that many times and start over again. To post this I edited it 25 times at least swearing like hell). Some small help is inside but i suggest you just play with it and see how fonts are changed.
! Dan RRight
! 2014 December 13
! No rights reserved :)
subroutine spinDisplay(spin)
include <opengl.ins>
include <clearwin.ins>
double precision spin
logical do_draw
common /animate_com/ do_draw
if (do_draw)then
call glClear (OR(GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT))
call glMatrixMode (GL_MODELVIEW)
call glLoadIdentity()
call glTranslated(0d0,0d0,-10d0)
call glRotated(spin,1d0,0d0,0d0)
call glCallList(101)
call swap_opengl_buffers()
spin=spin+1d0
endif
1000 call temporary_yield@()
end
subroutine spinSlab()
logical do_draw
common /animate_com/ do_draw
data do_draw/.TRUE./
do_draw=.TRUE.
end
subroutine stopSlab()
logical do_draw
common /animate_com/ do_draw
do_draw=.FALSE.
end
subroutine assemble_list
include <clearwin.ins>
include <opengl.ins>
real*4 white_colour(4), grey_colour(4), dark_grey_colour(4)
real*4 red_colour(4), yellow_colour(4), green_colour(4)
real*4 blue_colour(4), purple_colour(4), cyan_colour(4)
real*8 dimension,scale,d,fd,front,back
integer flags,k
integer hdc
logical ok
external opengl_proc
data white_colour/1.0,1.0,1.0,1.0/
data grey_colour/0.5,0.5,0.5,1.0/
data dark_grey_colour/0.3,0.3,0.3,1.0/
data red_colour/1.0,0.0,0.0,1.0/
data yellow_colour/1.0,1.0,0.0,1.0/
data green_colour/0.0,1.0,0.0,1.0/
data blue_colour/0.0,0.0,1.0,1.0/
data purple_colour/1.0,0.0,1.0,1.0/
data cyan_colour/0.0,1.0,1.0,1.0/
data front,back/-0.01d0,-0.5d0/
call glEnable(GL_DEPTH_TEST)
hDC=clearwin_info@('OPENGL_DEVICE_CONTEXT')
call glColor3f(1.0,1.0,1.0)
ibase = glGenLists(96) ! Storage For 96 Characters
!.................. Not all this works with wglUseFontOutlines .....................
! ifont =CreateFont (-122, ! Height Of Font
! * 0, ! Width Of Font
! * 0, ! Angle Of Escapement
! * 0, ! Orientation Angle
! * FW_BOLD, ! Font Weight
! * .TRUE., ! Italic
! * .FALSE., ! Underline
! * .FALSE., ! Strikeout
! * ANSI_CHARSET, ! Character Set Identifier
! * OUT_TT_PRECIS, ! Output Precision
! * CLIP_DEFAULT_PRECIS, ! Clipping Precision
! * ANTIALIASED_QUALITY, ! Output Quality
! * or(FF_DONTCARE,DEFAULT_PITCH), ! Family And Pitch
! * 'Comic Sans MS' )
!
! * ior(FF_DONTCARE,DEFAULT_PITCH), ! Family And Pitch
!
! ignor = SelectObject(hDC, ifont) ! Selects The Font We Want
!..............................................
ok=wglUseFontOutlines(hDC, 0, 255, 1000, 0.0, 0.31, WGL_FONT_POLYGONS,core4(0))