Term-Gnuplot

 view release on metacpan or  search on metacpan

gnuterm/term/cgm.trm  view on Meta::CPAN

       square, cross: half height = sqrt(1/2) ~ 12/17

       triangle: half width = sqrt(sqrt(4/3)) ~ 14/13,
       height = sqrt(3*sqrt(4/3)) ~ 54/29

       star: half height = 1, half width = sqrt(3/4) ~ 13/15

       dodecagon: coordinates of vertices are 0,
       sin(30) = 1/2, cos(30) = sqrt(3/4) ~ 13/15, or 1

       The fractions are approximates of the equivalent
       continued fractions. */
    cgm_tic = (size * term->h_tic / 2);
    cgm_tic707 = cgm_tic * 12 / 17;
    cgm_tic866 = cgm_tic * 13 / 15;
    cgm_tic500 = cgm_tic / 2;
    cgm_tic1241 = cgm_tic * 36 / 29;
    cgm_tic1077 = cgm_tic * 14 / 13;
    cgm_tic621 = cgm_tic * 18 / 29;
}

static void
CGM_flush_polygon()
{
    if (cgm_coords == 0)
	return;
    CGM_write_int_record(4, 7, cgm_coords * 2, cgm_polyline);
    cgm_coords = 0;
}


#ifdef DEFEAT_ASSERTIONS
#define NDEBUG
#include <assert.h>
#undef DEFEAT_ASSERTIONS
#endif /* DEFEAT_ASSERTIONS */

#ifdef NEXT
#undef id
#undef datum
#endif

#endif /* TERM_BODY */

#ifdef TERM_TABLE
TERM_TABLE_START(cgm_driver)
    "cgm", "Computer Graphics Metafile",
    CGM_LARGE - CGM_MARGIN, CGM_SMALL - CGM_MARGIN, CGM_VCHAR, CGM_HCHAR,
    CGM_VTIC, CGM_HTIC, CGM_options, CGM_init, CGM_reset,
    CGM_text, null_scale, CGM_graphics, CGM_move, CGM_solid_vector,
    CGM_linetype, CGM_put_text, CGM_text_angle,
    CGM_justify_text, CGM_point, do_arrow, CGM_set_font,
    CGM_set_pointsize,
    TERM_BINARY,		/* various flags */
    NULL,			/* after one plot of multiplot */
    NULL,			/* before subsequent plot of multiplot */
    NULL,			/* clear part of multiplot */
    CGM_linewidth
#ifdef USE_MOUSE
    , NULL, NULL, NULL, NULL, NULL
/*  , waitforinput, put_tmptext, set_ruler, set_cursor, set_clipboard */
#endif
#ifdef PM3D
    , CGM_make_palette,
    NULL /* _previous_palette */,
    CGM_set_color,
    CGM_filled_polygon
#endif
TERM_TABLE_END(cgm_driver)

#undef LAST_TERM
#define LAST_TERM cgm_driver

#endif /* TERM_TABLE */
#endif /* TERM_PROTO_ONLY */

#ifdef TERM_HELP
START_HELP(cgm)
"1 cgm",
"?commands set terminal cgm",
"?set terminal cgm",
"?set term cgm",
"?terminal cgm",
"?term cgm",
"?cgm",
" The `cgm` terminal generates a Computer Graphics Metafile, Version 1. ",
" This file format is a subset of the ANSI X3.122-1986 standard entitled",
" \"Computer Graphics - Metafile for the Storage and Transfer of Picture",
" Description Information\".",
" Several options may be set in `cgm`.",
"",
" Syntax:",
"       set terminal cgm {<mode>} {<color>} {<rotation>} {solid | dashed}",
"                        {width <plot_width>} {linewidth <line_width>}",
"                        {\"<font>\"} {<fontsize>}",
"                        {<color0> <color1> <color2> ...}",
"",
" where <mode> is `landscape`, `portrait`, or `default`;",
" <color> is either `color` or `monochrome`; ",
" <rotation> is either `rotate` or `norotate`;",
" `solid` draws all curves with solid lines, overriding any dashed patterns;",
" <plot_width> is the assumed width of the plot in points; ",
" <line_width> is the line width in points (default 1); ",
" <font> is the name of a font; and ",
" <fontsize> is the size of the font in points (default 12).",
"",
" By default, `cgm` uses rotated text for the Y axis label.",
"",
" The first six options can be in any order.  Selecting `default` sets all",
" options to their default values.",
"",
" Each color must be of the form 'xrrggbb', where x is the literal",
" character 'x' and 'rrggbb' are the red, green and blue components in",
" hex.  For example, 'x00ff00' is green.  The background color is set",
" first, then the plotting colors."
"",
" Examples:",
"       set terminal cgm landscape color rotate dashed width 432 \\",
"                      linewidth 1  'Helvetica Bold' 12       # defaults",
"       set terminal cgm 14 linewidth 2  14  # wider lines & larger font",
"       set terminal cgm portrait \"Times Italic\" 12",



( run in 1.183 second using v1.01-cache-2.11-cpan-2398b32b56e )