Grid

public struct Grid : Equatable

Represents a grid that can be drawn on a PDF page.

  • Creates a new grid.

    Declaration

    Swift

    public init(size: Size, lines: Lines = .default, labels: Labels? = nil, serifs: Serifs? = .default)

    Parameters

    size

    The size of the grid.

    lines

    The parameters of the vertical and horizontal major and minor lines of the grid. Default value is Lines.default.

    labels

    The parameters of the labels for vertocal and horizontal lines of the grid. If specified nil, no labels will be drawn. Default value is nil.

    serifs

    The parameters of the serifs for vertocal and horizontal lines of the grid. If specified nil, no serifs will be drawn. Default value is Serifs.defalut.

  • Creates a new grid.

    Declaration

    Swift

    public init(width: Float,
                height: Float,
                lines: Lines = .default,
                labels: Labels? = nil,
                serifs: Serifs? = .default)

    Parameters

    width

    The width of the grid.

    height

    The height of the grid.

    lines

    The parameters of the vertical and horizontal major and minor lines of the grid. Default value is Lines.default.

    labels

    The parameters of the labels for vertocal and horizontal lines of the grid. If specified nil, no labels will be drawn. Default value is nil.

    serifs

    The parameters of the serifs for vertocal and horizontal lines of the grid. If specified nil, no serifs will be drawn. Default value is Serifs.defalut.

  • The size of the grid.

    Declaration

    Swift

    public var size: Size
  • The parameters of the lines of the grid.

    Declaration

    Swift

    public var lines: Lines
  • The parameters of the labels of the grid.

    Declaration

    Swift

    public var labels: Labels
  • The parameters of the serifs of the grid.

    Declaration

    Swift

    public var serifs: Serifs
  • Draws the grid in the provided context.

    Declaration

    Swift

    public func draw(in context: DrawingContext, position: Point) throws

    Parameters

    context

    The context to draw the grid in.

    position

    The lower-left corner of the grid.

  • Represents the properties of a grid’s line labels. Labels can only be placed near serifs.

    See more

    Declaration

    Swift

    public struct LabelParameters
  • Encapsulates the parameters of the labels for vertical and horizontal lines.

    See more

    Declaration

    Swift

    public struct Labels : Equatable
  • Encapsulates the parameters of the vertical and horizontal major and minor lines.

    See more

    Declaration

    Swift

    public struct Lines : Hashable
  • Represents the properties of a grid’s major lines.

    See more

    Declaration

    Swift

    public struct MajorLineParameters : Hashable
  • Represents the properties of a grid’s minor lines.

    See more

    Declaration

    Swift

    public struct MinorLineParameters : Hashable
  • Represents the properties of a grid’s serifs. Serifs are short lines that can be placed on the edges of a grid and serve to put labels near them.

    See more

    Declaration

    Swift

    public struct SerifParameters : Hashable
  • Encapsulates the parameters of the top, bottom, left and right serifs of the grid.

    See more

    Declaration

    Swift

    public struct Serifs : Hashable