The graphics state: the parameters every painting operator consults, as the content interpreter holds them. A processor reads it through State, by reference and read-only; it may copy it.
[SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "A snapshot of interpreter state, never compared; value equality over every parameter would mislead.")]
public struct GraphicsState
ISO 32000-2 §8.4.1, Tables 51 and 52, with the text state parameters of §9.3 (Table 102). The initial values are those of
Tables 51, 52 and 102, except the CTM, which starts at the identity: a run reports geometry in default user space and the
consumer maps it to its device (§8.3.2.3). q pushes a copy of the whole state and Q pops it (§8.4.2); the current
path and the text matrices are not part of it (§8.5.2.1, §9.4.1).
The text state (§9.3) is set by its operators and the parameters of Table 57 through gs (§8.4.5). Parameters whose
values are document-model objects (font, soft mask, transfer, black generation, undercolour removal) are live views; a halftone
is kept as written. The colours (§8.6) are PdfColor values. Numeric parameters are always within their valid ranges:
the interpreter clips out-of-range operands and records a diagnostic (§8.4.1).
kind:method, kind:property, kind:ctor. Press Esc to clear.AlphaIsShapeGets a value indicating whether the soft mask and alpha are shape values rather than opacity. Initially false.BlackGenerationGets the black-generation function, or null for the device's default. Initially the default.BlackPointCompensationGets whether colour conversions compensate for black points. Initially Default.CharacterSpacingGets the character spacing Tc, in unscaled text space units. Initially 0.ClipHandleGets the current clipping path as a handle that GetClip(Int32) resolves; 0 is the run's initial clipping path (for a page, its media box). Meaningful only to a processor that asks for Clips.CtmGets the current transformation matrix: user space to the run's default user space.DashArrayGets the lengths of the alternating dashes and gaps, in user space units; empty for a solid line. Initially empty.DashPhaseGets the distance into the dash pattern at which a stroke starts, never negative; 0 for a solid line. Initially 0.FillAlphaGets the constant opacity for everything else, 0 to 1. Initially 1.0.FillColorGets the colour used for all other painting: its colour space and values. Initially DeviceGray black (0).FillOverprintGets a value indicating whether other painting overprints. Initially false.FlatnessGets the flatness tolerance, 0 to 100; 0 selects the device's default. Initially 1.0.FontGets the text font: the font Tf selected, or the Font entry of a graphics state parameter dictionary; null until one is selected.FontSizeGets the text font size Tfs; 0 until Tf sets a font.HalftoneGets the halftone as written (a halftone dictionary or stream), or null for the device's default. Initially the default. Halftones are a device concern and are not interpreted.HalftoneOriginGets the halftone origin in device space, or null when not set. Initially not set.HorizontalScalingGets the horizontal scaling Th as a factor (the Tz operand divided by 100). Initially 1.0.LeadingGets the leading Tl, in unscaled text space units. Initially 0.LineWidthGets the line width in user space units; 0 is the thinnest line the device can render. Initially 1.0.MiterLimitGets the miter limit, at least 1. Initially 10.0.OutputIntentGets the output intent in effect for the content being run: the page's first output intent with a profile, else the document's, or null. Not a graphics state parameter; carried here so every conversion made from the state can honour it.OverprintModeGets the overprint mode, 0 or 1. Initially 0.RenderingIntentGets the colour rendering intent. Initially RelativeColorimetric.SmoothnessGets the smoothness tolerance for shadings, 0 to 1. Initially 0 (the device's default).SoftMaskGets the soft mask: where it comes from and how it gives shape or opacity values; null for none. Initially none.SoftMaskMatrixGets the CTM at the gs that set SoftMask: the mask's group is painted in that coordinate system, not the one current when something is painted through it. The identity when there is no soft mask.StrokeAdjustmentGets a value indicating whether automatic stroke adjustment is on. Initially false.StrokeAlphaGets the constant opacity for stroking, 0 to 1. Initially 1.0.StrokeColorGets the colour used for stroking: its colour space and values. Initially DeviceGray black (0).StrokeOverprintGets a value indicating whether stroking overprints. Initially false.TextKnockoutGets a value indicating whether text is a knockout group. Initially true.TextRenderingModeGets the text rendering mode Tmode. Initially Fill.TextRiseGets the text rise Trise, in unscaled text space units. Initially 0.TransferFunctionGets the transfer function, or null for the device's default. Initially the default.UndercolorRemovalGets the undercolour-removal function, or null for the device's default. Initially the default.WordSpacingGets the word spacing Tw, in unscaled text space units. Initially 0.