Options
All
  • Public
  • Public/Protected
  • All
Menu

External module lib/utils/svgUtils

Index

Variables

SVG_NAMESPACE

SVG_NAMESPACE: string = "http://www.w3.org/2000/svg"

Functions

createSVGElement

  • createSVGElement(name: any): SVGElement

getUnicodeRanges

  • getUnicodeRanges(u: Array<string>, g: Array<string>): Array<[number, number]>
  • Returns a set of unicode ranges based on the supplied u and g arguments. Used as a helper function to parse attributes of the element in an SVG font file. Parsed according to rules defined at https://www.w3.org/TR/SVG/fonts.html#KernElements

    Parameters

    • u: Array<string>

      Array of strings that corresponds with the "u1" or "u2" attribute, split by comma

    • g: Array<string>

      Array of strings that corresponds with the "g1" or "g2" attribute, split by comma

    Returns Array<[number, number]>

    An array of number tuples that present unicode ranges. The first number is the start, the second is the end of the range (inclusive). For single unicode characters, these numbers are the same.

positionTransformSVG

  • positionTransformSVG(element: SVGGElement, x?: number, y?: number): void
  • Parameters

    • element: SVGGElement
    • Default value x: number = 0
    • Default value y: number = 0

    Returns void

setSVGAttributes

  • setSVGAttributes(element: SVGElement, attributes: Object): void

Generated using TypeDoc