/*  -- translated by f2c (version 20090411).
   You must link the resulting object file with libf2c:
	on Microsoft Windows system, link with libf2c.lib;
	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
	or, if you install libf2c.a in a standard place, with -lf2c -lm
	-- in that order, at the end of the command line, as in
		cc *.o -lf2c -lm
	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,

		http://www.netlib.org/f2c/libf2c.zip
*/

#include "libtinyf2c.h"

/* Table of constant values */

static integer c__9 = 9;
static integer c__1 = 1;
static integer c__3 = 3;
static real c_b6 = .1f;
static real c_b10 = 1.f;
static real c_b14 = 0.f;
static real c_b15 = 16.f;
static real c_b18 = .05f;
static real c_b19 = .95f;
static real c_b21 = .9f;
static integer c__2 = 2;
static real c_b32 = .5f;
static real c_b34 = .03f;
static integer c__0 = 0;
static real c_b39 = .035f;
static real c_b45 = .01f;

/* ----------------------------------------------------------------------- */
/*     Copyright (C) 2000-2004 GFD Dennou Club. All rights reserved. */
/* ----------------------------------------------------------------------- */
/* Main program */ int MAIN__(void)
{
    /* Initialized data */

    static char cttl[32] = "FONT NO. = #                    ";

    /* System generated locals */
    real r__1, r__2;
    char ch__1[1];

    /* Builtin functions */
    integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
	    e_wsle(void), s_rsle(cilist *), e_rsle(void), s_wsfi(icilist *), 
	    do_fio(integer *, char *, ftnlen), e_wsfi(void);

    /* Local variables */
    static integer i__, n;
    static char ch[3];
    static real ux, uy;
    static integer iws;
    extern /* Character */ VOID csgi_(char *, ftnlen, integer *);
    extern /* Subroutine */ int sgcls_(void), sgfrm_(void), slmgn_(real *, 
	    real *, real *, real *), slrat_(real *, real *), sgopn_(integer *)
	    , sgiset_(char *, integer *, ftnlen), sgswnd_(real *, real *, 
	    real *, real *), sgstrf_(void), sgstrn_(integer *), sgpwsn_(void),
	     sglnzu_(real *, real *, real *, real *, integer *), sgsvpt_(real 
	    *, real *, real *, real *), sgtxzu_(real *, real *, char *, real *
	    , integer *, integer *, integer *, ftnlen), sgtxzv_(real *, real *
	    , char *, real *, integer *, integer *, integer *, ftnlen);

    /* Fortran I/O blocks */
    static cilist io___2 = { 0, 6, 0, 0, 0 };
    static cilist io___3 = { 0, 5, 0, 0, 0 };
    static icilist io___7 = { 0, cttl+11, 0, "(I1)", 1, 1 };
    static icilist io___11 = { 0, ch, 0, "(I3)", 3, 1 };


    s_wsle(&io___2);
    do_lio(&c__9, &c__1, " WORKSTATION ID (I)  ? ;", (ftnlen)24);
    e_wsle();
    sgpwsn_();
    s_rsle(&io___3);
    do_lio(&c__3, &c__1, (char *)&iws, (ftnlen)sizeof(integer));
    e_rsle();
    iws = -abs(iws);
    sgopn_(&iws);
    slmgn_(&c_b6, &c_b6, &c_b6, &c_b6);
    slrat_(&c_b10, &c_b10);
    for (n = 1; n <= 2; ++n) {
	sgfrm_();
	sgiset_("IFONT", &n, (ftnlen)5);
	sgswnd_(&c_b14, &c_b15, &c_b14, &c_b15);
	sgsvpt_(&c_b18, &c_b19, &c_b14, &c_b21);
	sgstrn_(&c__1);
	sgstrf_();
	for (i__ = 0; i__ <= 16; ++i__) {
	    r__1 = (real) i__;
	    r__2 = (real) i__;
	    sglnzu_(&r__1, &c_b14, &r__2, &c_b15, &c__2);
	    r__1 = (real) i__;
	    r__2 = (real) i__;
	    sglnzu_(&c_b14, &r__1, &c_b15, &r__2, &c__2);
/* L10: */
	}
	s_wsfi(&io___7);
	do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
	e_wsfi();
	sgtxzv_(&c_b32, &c_b19, cttl, &c_b34, &c__0, &c__0, &c__3, (ftnlen)32)
		;
	for (i__ = 0; i__ <= 255; ++i__) {
	    ux = i__ / 16 + .5f;
	    uy = 16 - i__ % 16 - .5f;
	    if (! (i__ == 30 || i__ == 31)) {
		csgi_(ch__1, (ftnlen)1, &i__);
		sgtxzu_(&ux, &uy, ch__1, &c_b39, &c__0, &c__0, &c__3, (ftnlen)
			1);
	    }
	    ux += .48f;
	    uy += .38f;
	    s_wsfi(&io___11);
	    do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
	    e_wsfi();
	    sgtxzu_(&ux, &uy, ch, &c_b45, &c__0, &c__1, &c__1, (ftnlen)3);
/* L15: */
	}
/* L20: */
    }
    sgcls_();
    return 0;
} /* MAIN__ */

/* Main program alias */ int sgfonz_ () { MAIN__ (); return 0; }
