DEFINITION MODULE GKSFount;

(*
    Title: 	conversion of fount names to fount numbers
    LastEdit:	"Fri Sep 23 17:11:59 1983"
    Author: 	pr
		Cambridge University Computer Laboratory

GKS, in its semi-infinite wisdom, chooses to refer to type founts by
numbers rather than names.  The interpretation of these names is entirely
implementation dependent (hooray for metafiles...).  In an attempt to
introduce some semblance of order to the use of raster founts, this
module provides a standard set of conversions between names and numbers.

The numbers used work up from 100 so as to clear any genuine device's
fount numbers.

*)


EXPORT QUALIFIED
    STYLE, PixelsPerInch, PointsPerInch, FountNumber, FountName, FileName;


CONST PointsPerInch = 72.0;

VAR PixelsPerInch: REAL;


TYPE STYLE = (Roman, Italic, Bold);
(*  used to distinguish between different faces within a family		  *)

PROCEDURE FountNumber
    (family: ARRAY OF CHAR; style: STYLE; VAR number: CARDINAL): BOOLEAN;
(*  generate the GKS standard fount number for the given family and
    style, the BOOLEAN result indicates the availability of the fount	  *)

PROCEDURE FountName (number: CARDINAL; VAR name: ARRAY OF CHAR): BOOLEAN;
(*  makes up a printable name (like "times roman") for the given GKS
    fount number							  *)

PROCEDURE FileName
    (number, pointsize: CARDINAL; VAR filename: ARRAY OF CHAR): BOOLEAN;
(*  makes up a file name (like "/usr/lib/vfont/times.r.12") for the
    given GKS fount number						  *)


END GKSFount.
