Text Routines.


VOGLE supports hardware and software fonts. The software fonts are based on the character set digitized by Dr Allen V. Hershey while working at the U. S. National Bureau of Standards. Exactly what hardware fonts are supported depends on the device, but it is guaranteed that the names "large" and "small" will result in something readable. For X11 displays the default large and small fonts used by the program can be overridden by placing the following defaults in the ~/.Xdefaults file:

  vogle.smallfont:<font >
  vogle.largefont:<font >

It is noted here that text is always assumed to be drawn parallel to the (x, y) plane, using whatever the current z coordinate is. The following software fonts are supported:

   astrology       cursive         cyrillic        futura.l
   futura.m        gothic.eng      gothic.ger      gothic.ita
   greek           markers         math.low        math.upp
   meteorology     music           script          symbolic
   times.g         times.i         times.ib        times.r
   times.rb        japanese

A markers font "markers" is also provided for doing markers - you need to have centertext on for this to give sensible results - with the markers starting at 'A' and 'a'.

If the environment variable "VFONTLIB" is set VOGLE looks for the software fonts in the directory given by this value.

the default font is futura.l

text

font(fontname)

Set the current font

   Fortran:
        subroutine font(fontname)
        character*(*) fontname
   C:
        font(fontname)
             char *fontname

   Pascal:
        procedure Font(fontname: string_t)

WHEN ASK FOR NON-EXISTENT FONT, PROGRAM STOPS


numchars()

Return the number of characters in the current font. Applicable only to software fonts.

   Fortran:
        integer function numchars
   C:
        int
        numchars()

   Pascal:
        function NumChars: integer;

textsize(width, height)

Set the maximum size of a character in the current font. Width and height are values in world units. This only applies to software text. This must be done after the font being scaled is loaded.

   Fortran:
        subroutine textsize(width, height)
        real width, height
   C:
        textsize(width, height)
                    float     width, height;

   Pascal:
        procedure TextSize(width, height: real)

textang(ang)

Set the text angle. This angles strings and chars. This routine only affects software text.

   Fortran:
        subroutine textang(ang)
        real ang
   C:
        textang(ang)
             float     ang;

   Pascal:
        procedure TexTang(ang: real)

fixedwidth(onoff)

Turns fixedwidth text on or off. Non-zero (.true.) is on. Causes all text to be printed fixedwidth. This routine only affects software text.

The default at program initialization is fixedwidth(.true.)

   Fortran:
        subroutine fixedwidth(onoff)
        logical onoff
   C:
        fixedwidth(onoff)
             int onoff;

   Pascal:
        procedure FixedWidth(onoff: boolean)

centertext(onoff)

Turns centertext text on or off. Non-zero (.true.) is on. This centers strings and chars. This routine only affects software text.

   Fortran:
        subroutine centertext(onoff)
        logical onoff
   C:
        centertext(onoff)
             int onoff;

   Pascal:
        procedure CenterText(onoff: boolean)

getcharsize(c, width, height)

Get the width and height of a character. At the moment the height returned is always that of the difference between the maximum descender and ascender.

   Fortran:
        subroutine getcharsize(c, width, height)
        character*1 c
        real width, height
   C:
        getcharsize(c, width, height)
             char c;
             float     *width, *height;

   Pascal:
        procedure GetCharSize(c: char; var width, height: real)

getfontdec(dec)

Get the decender size of a character in a font.

   Fortran:
        real function getfontdec
   C:
        float
        getfontdec()

   Pascal:
        function NumChars: real;

getfontsize(width, height)

Get the maximum width and height of a character in a font.

   Fortran:
        subroutine getfontsize(width, height)
        real width, height
   C:
        getfontsize(width, height)
             float     *width, *height;

   Pascal:
        procedure GetFontSize(var width, height: real)

drawchar(c)

Draw the character c. The current graphics position represents the bottom left hand corner of the character space.

   Fortran:
        subroutine drawchar(c)
        character c
   C:
        drawchar(str)
             char c;

   Pascal:
        procedure DrawChar(c: char)

drawstr(str)

Draw the text in string at the current position.

   Fortran:
        subroutine drawstr(str)
        character*(*) str
   C:
        drawstr(str)
             char *str;
   Pascal:
        procedure DrawStr(str: string_t)

strlength(str)

Return the length of the string s in world units.

   Fortran:
        real function strlength(str)
        character*(*) str
   C:
        float
        strlength(char *str)

   Pascal:
        function StrLength(str: string_t): real;

boxtext(x, y, l, h, s)

Draw the string s so that it fits in the imaginary box defined with bottom left hand corner at (x, y), length l, and height h. This only applies to software text.

   Fortran:
        subroutine boxtext(x, y, l, h, s)
        real x, y, l, h, s
   C:
        boxtext(x, y, l, h, s)
             float     x, y, l, h, s;

   Pascal:
        procedure BoxText(x, y, l, h: real; s: string_t)

boxfit(l, h, nchars)

Set scale for text so that a string of the biggest characters in the font will fit in a box l by h. l and h are real values in world dimensions. This only applies to software text.

   Fortran:
        subroutine boxfit(l, h, nchars)
        real l, h
        integer nchars
   C:
        boxfit(l, h, nchars)
             float     l, h
             int  nchars

   Pascal:
        procedure BoxFit(l, h: real; nchars: integer)

textjustify(val)

General (direct) control of text justification. The value of val is made up of the logical OR of the following predefines constants in vogle.h (FOR C only). LEFT, RIGHT, XCENTERED, TOP, BOTTOM, YCENTERED. Centering takes priority, as does RIGHT and TOP justification (if you were silly enough to set it to LEFT|RIGHT for example that is). A value of 0 (zero) (in all languages) resets the textjustification to the default.

   Fortran:
       subroutine textjustify(val)
       integer val

   C:
       textjustify(val)
          unsigned val;


   Pascal:
       procedure TextJustify(val: integer)

leftjustify()

Left justifies text. The text string will begin at the current position and extend to the notional right. Right justification and X centering are turned off.

    Fortran:
        subroutine leftjustify

    C:
        leftjustify()

    Pascal:
        procedure LeftJustify

rightjustify()

Right justifies text. The text string will begin at a point to the notional left of the current position and finish at the current position. Left justification and X centering are turned off.

   Fortran:
       subroutine rightjustify

   C:
       rightjustify()

   Pascal:
       procedure RightJustify

xcentertext()

Centers text in the X direction. The text string will begin at a point to the notional left of the current position and finish at a point to the right of the current position. Left justification and Right justification are turned off.

   Fortran:
       subroutine xcentertext

   C:
       xcentertext()

   Pascal:
       procedure XcenterText

topjustify()

Top justifies text. The text string will be drawn with it's upper edge aligned with the current Y position. Bottom justification and Y centering are turned off.

    Fortran:
        subroutine topjustify

    C:
        topjustify()

    Pascal:
        procedure TopJustify

bottomjustify()

Bottom justifies text. The text string will be drawn with it's lower edge aligned with the current Y position. Top justification and Y centering are turned off.

   Fortran:
       subroutine bottomjustify

   C:
       bottomjustify()

   Pascal:
       procedure BottomJustify

ycentertext()

Centers text in the Y direction. The text string will so that it's center line is aligned with the current y position. Top justification and Bottom justification are turned off.

   Fortran:
       subroutine ycentertext
   C:
       ycentertext()

   Pascal:
       procedure YcenterText

textslant()

Defines the obliqness of the fonts.

   Fortran:
       subroutine textslant(var)
       real var
   C:
       textslant(float var)

   Pascal:
       procedure TextSlant()

textweight()

Defines the weight of the fonts.

   Fortran:
       subroutine textweight(ival)
       integer ival
   C:
       textweight(int ival)

   Pascal:
       procedure TextWeight(ival: integer)