- Main Page
- Modules
- Files
- Related Pages

# g2_PS_definitions.h

    00001 /*****************************************************************************
    00002 **  Copyright (C) 1998-2001  Ljubomir Milanovic & Horst Wagner
    00003 **  This file is part of the g2 library
    00004 **
    00005 **  This library is free software; you can redistribute it and/or
    00006 **  modify it under the terms of the GNU Lesser General Public
    00007 **  License as published by the Free Software Foundation; either
    00008 **  version 2.1 of the License, or (at your option) any later version.
    00009 **
    00010 **  This library is distributed in the hope that it will be useful,
    00011 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013 **  Lesser General Public License for more details.
    00014 **
    00015 **  You should have received a copy of the GNU Lesser General Public
    00016 **  License along with this library; if not, write to the Free Software
    00017 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00018 ******************************************************************************/
    00019 #ifndef _G2_PS_DEFINITIONS_H
    00020 #define _G2_PS_DEFINITIONS_H
    00021
    00022 /*
    00023  *
    00024  * Sizes for paper defined in g2_PS.h
    00025  * Size is in 1/72 inch (=0.351mm)
    00026  */
    00027 static int g2_PS_paper_size[][2]={
    00028  { 2384, 3370 },   /* g2_A0               -  A0                */
    00029  { 1684, 2384 },   /* g2_A1               -  A1                */
    00030  { 1191, 1684 },   /* g2_A2               -  A2                */
    00031  {  842, 1191 },   /* g2_A3               -  A3                */
    00032  {  595,  842 },   /* g2_A4               -  A4                */
    00033  {  420,  595 },   /* g2_A5               -  A5                */
    00034  {  297,  420 },   /* g2_A6               -  A6                */
    00035  {  210,  297 },   /* g2_A7               -  A7                */
    00036  {  148,  210 },   /* g2_A8               -  A8                */
    00037  {  105,  148 },   /* g2_A9               -  A9                */
    00038  { 2920, 4127 },   /* g2_B0               -  B0                */
    00039  { 2064, 2920 },   /* g2_B1               -  B1                */
    00040  { 1460, 2064 },   /* g2_B2               -  B2                */
    00041  { 1032, 1460 },   /* g2_B3               -  B3                */
    00042  {  729, 1032 },   /* g2_B4               -  B4                */
    00043  {  516,  729 },   /* g2_B5               -  B5                */
    00044  {  363,  516 },   /* g2_B6               -  B6                */
    00045  {  258,  363 },   /* g2_B7               -  B7                */
    00046  {  181,  258 },   /* g2_B8               -  B8                */
    00047  {  127,  181 },   /* g2_B9               -  B9                */
    00048  {   91,  127 },   /* g2_B10              -  B10               */
    00049  {  297,  684 },   /* g2_Comm_10_Envelope -  Comm #10 Envelope */
    00050  {  461,  648 },   /* g2_C5_Envelope      -  C5 Envelope       */
    00051  {  312,  624 },   /* g2_DL_Envelope      -  DL Envelope       */
    00052  {  595,  935 },   /* g2_Folio            -  Folio             */
    00053  {  522,  756 },   /* g2_Executive        -  Executive         */
    00054  {  612,  792 },   /* g2_Letter           -  Letter            */
    00055  {  612, 1008 },   /* g2_Legal            -  Legal             */
    00056  { 1224,  792 },   /* g2_Ledger           -  Ledger            */
    00057  {  792, 1224 }    /* g2_Tabloid          -  Tabloid           */
    00058 };
    00059
    00060
    00061 /*
    00062  *
    00063  * PS operators
    00064  *
    00065  */
    00066 char *g2_PS_operators[]={
    00067     " /L { lineto } def",                              /* lineto */
    00068     " /St { stroke } def",                             /* stroke */
    00069     " /M { moveto } def",                              /* moveto */
    00070     " /P {",                                           /* plot */
    00071     " gsave newpath [] 0 setdash 1 setlinecap 0 setlinewidth",
    00072     " 0.2 sub exch 0.2 sub exch moveto 0.4 0.4 rlineto",
    00073     " stroke grestore} def",
    00074     " /T {",                                           /* triangle */
    00075     " newpath",
    00076     " moveto lineto lineto",
    00077     " closepath stroke} def",
    00078     " /FT {",                                          /* filled triangle */
    00079     " newpath",
    00080     " moveto lineto lineto",
    00081     " closepath fill} def",
    00082     " /R {",                                           /* rectangle */
    00083     " newpath",
    00084     " 3 index 1 index 6 4 roll 5 index 1 index",
    00085     " moveto lineto lineto lineto closepath stroke} def",
    00086     " /FR {",                                          /* filled rectangle */
    00087     " newpath",
    00088     " 3 index 1 index 6 4 roll 5 index 1 index",
    00089     " moveto lineto lineto lineto closepath fill} def",
    00090     " /A {",                                           /* arc */
    00091     " gsave /g2_old_matrix matrix currentmatrix def newpath",
    00092     " translate scale 0 0 1 5 3 roll arc",
    00093     " g2_old_matrix setmatrix stroke grestore } def",
    00094     " /FA {",                                          /* filled arc */
    00095     " gsave /g2_old_matrix matrix currentmatrix def newpath",
    00096     " translate scale 0 0 moveto 0 0 1 5 3 roll arc closepath",
    00097     " g2_old_matrix setmatrix fill grestore } def",
    00098     " /S {",                                           /* draw string */
    00099     " gsave newpath",
    00100     " translate 0 0 moveto show",
    00101     " stroke grestore} def",
    00102     "\n",
    00103     NULL
    00104 };
    00105
    00106 #endif /* _G2_PS_DEFINITIONS_H */