Hierarchy

  • Graphics

Index

Constructors

constructor

  • new Graphics(context: CanvasRenderingContext2D): Graphics
  • Parameters

    • context: CanvasRenderingContext2D

    Returns Graphics

Properties

Static customFonts

customFonts: Hashtable<string, Hashtable<FontStyle, CustomFontType>> = new Hashtable()

Static measureBearingScale

measureBearingScale: number = 0.8

Methods

drawImage

  • Parameters

    Returns void

drawLine

  • drawLine(pen: Pen, x1: number, y1: number, x2: number, y2: number): void
  • Parameters

    • pen: Pen
    • x1: number
    • y1: number
    • x2: number
    • y2: number

    Returns void

drawRectangle

drawString

  • drawString(text: string, font: Font, brush: Brush, x: number, y: number): void
  • Parameters

    • text: string
    • font: Font
    • brush: Brush
    • x: number
    • y: number

    Returns void

fillRectangle

  • fillRectangle(brush: Brush, x: number, y: number, width: number, height: number): void
  • Parameters

    • brush: Brush
    • x: number
    • y: number
    • width: number
    • height: number

    Returns void

translateTransform

  • translateTransform(dx: number, dy: number): void
  • Parameters

    • dx: number
    • dy: number

    Returns void

Static addCustomFont

  • addCustomFont(font: any, fontName?: string, binFont?: any, filePath?: string, fontStyle?: FontStyle, store?: boolean): void
  • Parameters

    • font: any
    • Default value fontName: string = null
    • Default value binFont: any = null
    • Default value filePath: string = null
    • Default value fontStyle: FontStyle = null
    • Default value store: boolean = true

    Returns void

Static addCustomFontBytes

  • addCustomFontBytes(data: any, fontName?: string, fontStyle?: FontStyle, store?: boolean): void
  • Parameters

    • data: any
    • Default value fontName: string = null
    • Default value fontStyle: FontStyle = null
    • Default value store: boolean = true

    Returns void

Static addCustomFontFile

  • addCustomFontFile(filePath: string, fontName?: string, fontStyle?: FontStyle, store?: boolean): void
  • Parameters

    • filePath: string
    • Default value fontName: string = null
    • Default value fontStyle: FontStyle = null
    • Default value store: boolean = true

    Returns void

Static addCustomFontFileAsync

  • addCustomFontFileAsync(callback: function, filePath: string, fontName?: string, fontStyle?: FontStyle, store?: boolean): void
  • Parameters

    • callback: function
        • (): object
        • Returns object

    • filePath: string
    • Default value fontName: string = null
    • Default value fontStyle: FontStyle = null
    • Default value store: boolean = true

    Returns void

Static allowStyle

  • allowStyle(fontName: string, fontStyle: FontStyle): boolean
  • Parameters

    Returns boolean

Static clearAutoLoadFonts

  • clearAutoLoadFonts(): void
  • Returns void

Static clearCache

  • clearCache(): void
  • Returns void

Static getCustomFont

  • getCustomFont(fontName: string, fontStyle: FontStyle): any
  • Parameters

    Returns any

Static getCustomFontName

  • getCustomFontName(fontName: string, fontStyle: FontStyle): string
  • Parameters

    Returns string

Static getCustomFontsCss

  • getCustomFontsCss(embeddedData?: boolean): string
  • Parameters

    • Default value embeddedData: boolean = false

    Returns string

Static getLineHeightFactor

  • getLineHeightFactor(font: string | Font): number
  • Parameters

    • font: string | Font

    Returns number

Static measureChars

  • measureChars(chars: number[], count: number, font: Font): Size
  • Parameters

    • chars: number[]
    • count: number
    • font: Font

    Returns Size

Static measureString

  • measureString(text: string, font: Font, width?: number, useCache?: boolean, multiple?: number, angle?: number, replaceTags?: boolean): Size
  • Parameters

    • text: string
    • font: Font
    • Default value width: number = null
    • Default value useCache: boolean = true
    • Default value multiple: number = 1
    • Default value angle: number = 0
    • Default value replaceTags: boolean = false

    Returns Size

Generated using TypeDoc