Class

Gjsgjs/cairodefaultSVGSurface

A surface that produces output in the SVG format

Hierarchy (View Summary)

Index

Constructors

Methods - Inherited from gjs/cairo.default.Surface

Constructors

  • Creates a new SVG surface

    Parameters

    • filename: string

      Path to the SVG file to write to

    • width: number

      Width of the surface in points (1 point = 1/72 inch)

    • height: number

      Height of the surface in points (1 point = 1/72 inch)

    Returns SVGSurface

Methods - Inherited from gjs/cairo.default.Surface

  • Gets the device scale of the surface

    Returns [number, number]

    An array with [x, y] device scale

  • Attaches user data to the surface (C API: cairo_surface_set_user_data)

    Parameters

    • key: UserDataKey

      Key for the user data

    • userData: unknown

      Data to attach

    • Optionaldestroy: (data: unknown) => void

      Optional callback when the surface is destroyed or data is replaced

    Returns Status

  • Sets the device offset of the surface

    Parameters

    • x: number

      X offset

    • y: number

      Y offset

    Returns void

  • Sets the device scale of the surface

    Parameters

    • x: number

      X scale factor

    • y: number

      Y scale factor

    Returns void