C From: fred@niwot.scd.ucar.EDU (Fred Clare)
C Date: Thu, 17 Dec 92 16:16:51 MST
C To: emmerson@ncar.ucar.edu
C Subject: CGM
C Cc: haley@niwot.scd.ucar.EDU
C 
C I seem to be having some very basic problems with color table
C settings in a CGM output from XGKS.  The following should generate
C red text on a black background; what I get is white text on a 
C green background.  I enclose a metachek output of the resultant
C metafile.
C 
C Thanks.
C 
C Fred
C 
C ------------------------- Begin sample code -----------------------
      PROGRAM TEST
C
      OPEN(2,FILE='test.cgm',STATUS='UNKNOWN')
C
C  Open GKS, open and activate a CGM workstation.
C
      CALL GOPKS(6,10000)
C      CALL GOPWK(1,2,2)	! metafile
      CALL GOPWK(1,5,4)		! X
      CALL GACWK(1)
C
C  Set color index 1 to red and assign text color red.
C
      CALL GSCR(1,0,0.,0.,0.)
      CALL GSCR(1,1,1.,0.,0.)
      CALL GSTXCI(1)
C
C  Draw a text string.
C
      CALL GSCHH(.05)
      CALL GSTXAL(2,3)
      CALL GTX(.5,.5,'Picture 1')
C
C  End picture
C
      CALL GUWK(1,0)
      CALL GCLRWK(1,1)
C
C  Close things out.
C
      CALL GDAWK(1)
      CALL GCLWK(1)
      CALL GCLKS
C
      STOP
      END
C ------------------------- End sample code -----------------------
C 
C ----------------------- Begin metachek output -------------------
C 
C 
C MetaCheck Version 2.06 -- CGM Conformance Analyzer
C Copyright 1988-91 CGM Technology Software 
C Execution Date: 12/17/92     Time:  16:12:25 
C 
C 
C Metafile Examined    : junk.cgm
C 
C Pictures Examined    : All
C Elements Examined    : All
C Bytes    Examined    : All
C 
C 
C ======================= Trace Report ========================
C 
C 
C    1:BEGIN METAFILE                     Offset:0           Length:9     
C     P1 : Metafile Name                  Value: >XGKS CGM<                  
C 
C    2:METAFILE VERSION                   Offset:12          Length:2     
C     P1 : Metafile Version               Value: 1
C 
C    3:METAFILE ELEMENT LIST              Offset:16          Length:6     
C     P1 : Number of Elements             Value: 1
C     P2 : Element List                   Value:                             
C           Drawing Set                                                
C 
C    4:METAFILE DESCRIPTION               Offset:24          Length:84    
C     P1 : Metafile Description           Value: >UCAR/Unidata XGKS/CGM $Re< 
C                                                >vision: 1.2 $: fred@conun< 
C                                                >drum 1992-12-17 16:04:42 < 
C                                                >UTC-0700<                  
C 
C    5:BEGIN PICTURE                      Offset:112         Length:7     
C     P1 : Picture Identifier             Value: >XGKS 1<                    
C 
C    6:BEGIN PICTURE BODY                 Offset:122         Length:0     
C 
C    7:CLIP RECTANGLE                     Offset:124         Length:8     
C     P1 : First Corner Point             Value:          0,0         
C     P2 : Second Corner Point            Value:      32767,32767     
C 
C    8:LINE BUNDLE INDEX                  Offset:134         Length:2     
C     P1 : Line Bundle Index              Value: 1
C 
C    9:LINE TYPE                          Offset:138         Length:2     
C     P1 : Line Type                      Value:                    Solid (1)
C 
C   10:LINE WIDTH                         Offset:142         Length:4     
C     P1 : Line Width                     Value: 1.000000      
C 
C   11:LINE COLOUR                        Offset:148         Length:1     
C     P1 : Line Colour                    Value: 1
C 
C   12:MARKER BUNDLE INDEX                Offset:152         Length:2     
C     P1 : Marker Bundle Index            Value: 1
C 
C   13:MARKER TYPE                        Offset:156         Length:2     
C     P1 : Marker Type                    Value:                 Asterisk (3)
C 
C   14:MARKER SIZE                        Offset:160         Length:4     
C     P1 : Marker Size                    Value: 1.000000      
C 
C   15:MARKER COLOUR                      Offset:166         Length:1     
C     P1 : Marker Colour                  Value: 1
C 
C   16:TEXT BUNDLE INDEX                  Offset:170         Length:2     
C     P1 : Text Bundle Index              Value: 1
C 
C   17:TEXT FONT INDEX                    Offset:174         Length:2     
C     P1 : Text Font Index                Value: 1
C 
C   18:TEXT PRECISION                     Offset:178         Length:2     
C     P1 : Text Precision                 Value:                   String (0)
C 
C   19:CHARACTER EXPANSION FACTOR         Offset:182         Length:4     
C     P1 : Character Expansion            Value: 1.000000      
C 
C   20:CHARACTER SPACING                  Offset:188         Length:4     
C     P1 : Character Spacing              Value: 0.0
C 
C   21:TEXT COLOUR                        Offset:194         Length:1     
C     P1 : Text Colour                    Value: 1
C 
C   22:TEXT PATH                          Offset:198         Length:2     
C     P1 : Text Path                      Value:                    Right (0)
C 
C   23:TEXT ALIGNMENT                     Offset:202         Length:12    
C     P1 : Horizontal Alignment           Value:                   Normal (0)
C     P2 : Vertical Alignment             Value:                   Normal (0)
C     P3 : Continuous Horizontal          Value: 0.0
C     P4 : Continuous Vertical            Value: 0.0
C 
C   24:CHARACTER ORIENTATION              Offset:216         Length:8     
C     P1 : Up Vector X                    Value:          0
C     P2 : Up Vector Y                    Value:        328
C     P3 : Base Vector X                  Value:        328
C     P4 : Base Vector Y                  Value:          0
C 
C   25:CHARACTER HEIGHT                   Offset:226         Length:2     
C     P1 : Character Height               Value:        328
C 
C   26:FILL BUNDLE INDEX                  Offset:230         Length:2     
C     P1 : Fill Bundle Index              Value: 1
C 
C   27:INTERIOR STYLE                     Offset:234         Length:2     
C     P1 : Interior Style                 Value:                   Hollow (0)
C 
C   28:PATTERN INDEX                      Offset:238         Length:2     
C     P1 : Pattern Index                  Value: 1
C 
C   29:HATCH INDEX                        Offset:242         Length:2     
C     P1 : Hatch Index                    Value:               Horizontal (1)
C 
C   30:FILL COLOUR                        Offset:246         Length:1     
C     P1 : Fill Colour                    Value: 1
C 
C   31:PATTERN SIZE                       Offset:250         Length:8     
C     P1 : Height Vector X                Value:          0
C     P2 : Height Vector Y                Value:      32767
C     P3 : Width Vector X                 Value:      32767
C     P4 : Width Vector Y                 Value:          0
C 
C   32:FILL REFERENCE POINT               Offset:260         Length:4     
C     P1 : Fill Reference Point           Value:          0,0         
C 
C   33:ASPECT SOURCE FLAGS                Offset:266         Length:60    
C     P1 : Aspect Pair 1                  Value: Line Type       , Individual
C     P2 : Aspect Pair 2                  Value: Line Width      , Individual
C     P3 : Aspect Pair 3                  Value: Line Colour     , Individual
C     P4 : Aspect Pair 4                  Value: Marker Type     , Individual
C     P5 : Aspect Pair 5                  Value: Marker Size     , Individual
C     P6 : Aspect Pair 6                  Value: Marker Colour   , Individual
C     P7 : Aspect Pair 7                  Value: Font Index      , Individual
C     P8 : Aspect Pair 8                  Value: Text Precision  , Individual
C     P9 : Aspect Pair 9                  Value: Char Expansion  , Individual
C     P10 : Aspect Pair 10                 Value: Char Spacing    , Individual
C     P11 : Aspect Pair 11                 Value: Text Colour     , Individual
C     P12 : Aspect Pair 12                 Value: Interior Style  , Individual
C     P13 : Aspect Pair 13                 Value: Fill Colour     , Individual
C     P14 : Aspect Pair 14                 Value: Hatch Index     , Individual
C     P15 : Aspect Pair 15                 Value: Pattern Index   , Individual
C 
C   34:COLOUR TABLE                       Offset:330         Length:5     
C     P1 : Starting Index                 Value: 0
C     P2 : Colour List                    Value:                             
C     (   0) 44        0         0       
C 
C   35:COLOUR TABLE                       Offset:338         Length:5     
C     P1 : Starting Index                 Value: 0
C     P2 : Colour List                    Value:                             
C     (   0) 44        255       0       
C 
C   36:TEXT COLOUR                        Offset:346         Length:1     
C     P1 : Text Colour                    Value: 1
C 
C   37:CHARACTER ORIENTATION              Offset:350         Length:8     
C     P1 : Up Vector X                    Value:          0
C     P2 : Up Vector Y                    Value:       1638
C     P3 : Base Vector X                  Value:       1638
C     P4 : Base Vector Y                  Value:          0
C 
C   38:CHARACTER HEIGHT                   Offset:360         Length:2     
C     P1 : Character Height               Value:       1638
C 
C   39:TEXT ALIGNMENT                     Offset:364         Length:12    
C     P1 : Horizontal Alignment           Value:                   Normal (0)
C     P2 : Vertical Alignment             Value:                   Normal (0)
C     P3 : Continuous Horizontal          Value: 0.0
C     P4 : Continuous Vertical            Value: 0.0
C 
C   40:TEXT ALIGNMENT                     Offset:378         Length:12    
C     P1 : Horizontal Alignment           Value:                   Center (2)
C     P2 : Vertical Alignment             Value:                     Half (3)
C     P3 : Continuous Horizontal          Value: 0.0
C     P4 : Continuous Vertical            Value: 0.0
C 
C   41:TEXT                               Offset:392         Length:16    
C     P1 : Text Position                  Value:      16384,16384     
C     P2 : Final Flag                     Value:                    Final (1)
C     P3 : Text String                    Value: >Picture 1<                 
C 
C   42:END PICTURE                        Offset:410         Length:0     
C 
C   43:BEGIN PICTURE                      Offset:412         Length:7     
C     P1 : Picture Identifier             Value: >XGKS 2<                    
C 
C   44:VDC EXTENT                         Offset:422         Length:8     
C     P1 : First Corner Point             Value:          0,0         
C     P2 : Second Corner Point            Value:          0,0         
C 
C   45:BACKGROUND COLOUR                  Offset:432         Length:3     
C    P1 : Background Colour               Value: R:0    G:0    B:0   
C 
C   46:BEGIN PICTURE BODY                 Offset:438         Length:0     
C 
C   47:LINE BUNDLE INDEX                  Offset:440         Length:2     
C     P1 : Line Bundle Index              Value: 1
C 
C   48:LINE TYPE                          Offset:444         Length:2     
C     P1 : Line Type                      Value:                    Solid (1)
C 
C   49:LINE WIDTH                         Offset:448         Length:4     
C     P1 : Line Width                     Value: 1.000000      
C 
C   50:LINE COLOUR                        Offset:454         Length:1     
C     P1 : Line Colour                    Value: 1
C 
C   51:MARKER BUNDLE INDEX                Offset:458         Length:2     
C     P1 : Marker Bundle Index            Value: 1
C 
C   52:MARKER TYPE                        Offset:462         Length:2     
C     P1 : Marker Type                    Value:                 Asterisk (3)
C 
C   53:MARKER SIZE                        Offset:466         Length:4     
C     P1 : Marker Size                    Value: 1.000000      
C 
C   54:MARKER COLOUR                      Offset:472         Length:1     
C     P1 : Marker Colour                  Value: 1
C 
C   55:TEXT BUNDLE INDEX                  Offset:476         Length:2     
C     P1 : Text Bundle Index              Value: 1
C 
C   56:TEXT FONT INDEX                    Offset:480         Length:2     
C     P1 : Text Font Index                Value: 1
C 
C   57:TEXT PRECISION                     Offset:484         Length:2     
C     P1 : Text Precision                 Value:                   String (0)
C 
C   58:CHARACTER EXPANSION FACTOR         Offset:488         Length:4     
C     P1 : Character Expansion            Value: 1.000000      
C 
C   59:CHARACTER SPACING                  Offset:494         Length:4     
C     P1 : Character Spacing              Value: 0.0
C 
C   60:TEXT COLOUR                        Offset:500         Length:1     
C     P1 : Text Colour                    Value: 1
C 
C   61:CHARACTER HEIGHT                   Offset:504         Length:2     
C     P1 : Character Height               Value:       1638
C 
C   62:CHARACTER ORIENTATION              Offset:508         Length:8     
C     P1 : Up Vector X                    Value:          0
C     P2 : Up Vector Y                    Value:       1638
C     P3 : Base Vector X                  Value:       1638
C     P4 : Base Vector Y                  Value:          0
C 
C   63:TEXT PATH                          Offset:518         Length:2     
C     P1 : Text Path                      Value:                    Right (0)
C 
C   64:TEXT ALIGNMENT                     Offset:522         Length:12    
C     P1 : Horizontal Alignment           Value:                   Normal (0)
C     P2 : Vertical Alignment             Value:                   Normal (0)
C     P3 : Continuous Horizontal          Value: 0.0
C     P4 : Continuous Vertical            Value: 0.0
C 
C   65:TEXT ALIGNMENT                     Offset:536         Length:12    
C     P1 : Horizontal Alignment           Value:                   Center (2)
C     P2 : Vertical Alignment             Value:                     Half (3)
C     P3 : Continuous Horizontal          Value: 0.0
C     P4 : Continuous Vertical            Value: 0.0
C 
C   66:FILL BUNDLE INDEX                  Offset:550         Length:2     
C     P1 : Fill Bundle Index              Value: 1
C 
C   67:INTERIOR STYLE                     Offset:554         Length:2     
C     P1 : Interior Style                 Value:                   Hollow (0)
C 
C   68:FILL COLOUR                        Offset:558         Length:1     
C     P1 : Fill Colour                    Value: 1
C 
C   69:HATCH INDEX                        Offset:562         Length:2     
C     P1 : Hatch Index                    Value:               Horizontal (1)
C 
C   70:PATTERN INDEX                      Offset:566         Length:2     
C     P1 : Pattern Index                  Value: 1
C 
C   71:FILL REFERENCE POINT               Offset:570         Length:4     
C     P1 : Fill Reference Point           Value:          0,0         
C 
C   72:COLOUR TABLE                       Offset:576         Length:5     
C     P1 : Starting Index                 Value: 0
C     P2 : Colour List                    Value:                             
C     (   0) 255       0         0       
C 
C   73:COLOUR TABLE                       Offset:584         Length:5     
C     P1 : Starting Index                 Value: 0
C     P2 : Colour List                    Value:                             
C     (   0) 255       255       0       
C 
C   74:ASPECT SOURCE FLAGS                Offset:592         Length:60    
C     P1 : Aspect Pair 1                  Value: Line Type       , Individual
C     P2 : Aspect Pair 2                  Value: Line Width      , Individual
C     P3 : Aspect Pair 3                  Value: Line Colour     , Individual
C     P4 : Aspect Pair 4                  Value: Marker Type     , Individual
C     P5 : Aspect Pair 5                  Value: Marker Size     , Individual
C     P6 : Aspect Pair 6                  Value: Marker Colour   , Individual
C     P7 : Aspect Pair 7                  Value: Font Index      , Individual
C     P8 : Aspect Pair 8                  Value: Text Precision  , Individual
C     P9 : Aspect Pair 9                  Value: Char Expansion  , Individual
C     P10 : Aspect Pair 10                 Value: Char Spacing    , Individual
C     P11 : Aspect Pair 11                 Value: Text Colour     , Individual
C     P12 : Aspect Pair 12                 Value: Interior Style  , Individual
C     P13 : Aspect Pair 13                 Value: Fill Colour     , Individual
C     P14 : Aspect Pair 14                 Value: Hatch Index     , Individual
C     P15 : Aspect Pair 15                 Value: Pattern Index   , Individual
C 
C   75:CLIP RECTANGLE                     Offset:656         Length:8     
C     P1 : First Corner Point             Value:          0,0         
C     P2 : Second Corner Point            Value:      32767,32767     
C 
C   76:END PICTURE                        Offset:666         Length:0     
C 
C   77:END METAFILE                       Offset:668         Length:0     
C 
C 
C ================ Element Use Summary Report =================
C 
C    Total Delimiter Elements (Class 0). . . . . . . 8
C    Begin Metafile. . . . . . . . . . . . . . . . . 1
C    End Metafile. . . . . . . . . . . . . . . . . . 1
C    Begin Picture . . . . . . . . . . . . . . . . . 2
C    Begin Picture Body. . . . . . . . . . . . . . . 2
C    End Picture . . . . . . . . . . . . . . . . . . 2
C 
C 
C    Total Metafile Descriptor Elements (Class 1). . 3
C    Metafile Version. . . . . . . . . . . . . . . . 1
C    Metafile Description. . . . . . . . . . . . . . 1
C    Metafile Element List . . . . . . . . . . . . . 1
C 
C 
C    Total Picture Descriptor Elements . . . . . . . 2
C    VDC Extent. . . . . . . . . . . . . . . . . . . 1
C    Background Colour . . . . . . . . . . . . . . . 1
C 
C 
C    Total Control Elements (Class 2). . . . . . . . 2
C    Clip Rectangle. . . . . . . . . . . . . . . . . 2
C 
C 
C    Total Graphical Primitive Elements (Class 4). . 1
C    Text. . . . . . . . . . . . . . . . . . . . . . 1
C 
C 
C    Total Attribute Elements (Class 5). . . . . . . 61
C    Line Bundle Index . . . . . . . . . . . . . . . 2
C    Line Type . . . . . . . . . . . . . . . . . . . 2
C    Line Width. . . . . . . . . . . . . . . . . . . 2
C    Line Colour . . . . . . . . . . . . . . . . . . 2
C    Marker Bundle Index . . . . . . . . . . . . . . 2
C    Marker Type . . . . . . . . . . . . . . . . . . 2
C    Marker Size . . . . . . . . . . . . . . . . . . 2
C    Marker Colour . . . . . . . . . . . . . . . . . 2
C    Text Bundle Index . . . . . . . . . . . . . . . 2
C    Text Font Index . . . . . . . . . . . . . . . . 2
C    Text Precision. . . . . . . . . . . . . . . . . 2
C    Character Expansion Factor. . . . . . . . . . . 2
C    Character Spacing . . . . . . . . . . . . . . . 2
C    Text Colour . . . . . . . . . . . . . . . . . . 3
C    Character Height. . . . . . . . . . . . . . . . 3
C    Character Orientation . . . . . . . . . . . . . 3
C    Text Path . . . . . . . . . . . . . . . . . . . 2
C    Text Alignment. . . . . . . . . . . . . . . . . 5
C    Fill Bundle Index . . . . . . . . . . . . . . . 2
C    Interior Style. . . . . . . . . . . . . . . . . 2
C    Fill Colour . . . . . . . . . . . . . . . . . . 2
C    Hatch Index . . . . . . . . . . . . . . . . . . 2
C    Pattern Index . . . . . . . . . . . . . . . . . 2
C    Fill Reference Point. . . . . . . . . . . . . . 2
C    Pattern Size. . . . . . . . . . . . . . . . . . 1
C    Colour Table. . . . . . . . . . . . . . . . . . 4
C    Aspect Source Flags . . . . . . . . . . . . . . 2
C 
C 
C    Total Escape Elements (Class 6) . . . . . . . . 0
C 
C 
C    Total External Elements (Class 7) . . . . . . . 0
C 
C 
C ============= CGM Conformance Violation Report ==============
C 
C 
C 
C No Errors Detected
C 
C 
C ================ Conformance Summary Report =================
C 
C 
C 
C MetaCheck Version 2.06 -- CGM Conformance Analyzer
C Copyright 1988-91 CGM Technology Software 
C Execution Date: 12/17/92     Time:  16:12:25 
C 
C Name of CGM under test: junk.cgm
C Encoding              : Binary
C 
C Pictures Examined    : All
C Elements Examined    : All
C Bytes    Examined    : All
C 
C BEGIN METAFILE string : "XGKS CGM"
C METAFILE DESCRIPTION  : "UCAR/Unidata XGKS/CGM $Revision: 2.5.4.1 $:
C                          fred@conundrum 1992-12-17 16:04:42 UTC-0700"
C 
C Picture 1 starts at octet offset 112; string contains: "XGKS 1"
C 
C 
C Picture 2 starts at octet offset 412; string contains: "XGKS 2"
C 
C 
C 
C Conformance Summary  :  This file conforms to the CGM specification.
C 
C 
C 
C Summary of Testing Performed and Errors Found:
C 
C            2 Pictures Tested
C           77 Elements Tested
C          670 Octets Tested
C 
C 
C                 =================================                
C                 |    No Errors Were Detected    |                
C                 =================================                
C 
C 
C ================ End of Conformance Report ==================
C -------------------------- End metachek output --------------
C 
C 
