Skip to content

Latest commit

 

History

History
123 lines (67 loc) · 2.84 KB

File metadata and controls

123 lines (67 loc) · 2.84 KB

Table of Contents

addRegion

addRegion creates and adds a region to a Bowlcut object

Parameters

  • regionOptions Object allow for overrides for fill, stroke, etc. to be passed in on construction of a region.

Returns Object the region object

fitTextInBounds

fitTextInBounds scales the region's text to fit inside the region's bounds, with no other transformations

Returns Object the scaled text as an opentype Path

renderRegion

renderRegion uses the provided bounds and top/bottom paths for a region to render an SVG path in between

Returns Object the rendered SVGPathElement

makeStraightPaths

makeStraightPaths makes top and bottom paths from the verical edges of the region bounds

makeArch

makeArch makes quadratic arcs for the top and bottom path of a region

Parameters

  • topBend Number can be positive or negative
  • bottomBend Number can be positive or negative

makeRadialArch

makeRadialArch sets the region's paths to a rainbow-shaped arch from the bounds and a bend strength

Parameters

  • radialBend Number must be >= 0

removeRegion

removeRegion deletes a region from a Bowlcut wordmark

Parameters

  • region Object the region to delete

render

render creates an SVGGroupElement containing the rendered region paths

Parameters

  • unify Boolean? merges region paths with a union operation, removing overlaps. Expensive so defaults to false. (optional, default false)

Returns Object the group element

loadFonts

loadFonts takes an array of tuples like so: [[fontName, fontUrl], ...]]

Parameters

Returns Object a promise resolved when the fonts have loaded

papercut

papercut generates the union of each group of characters in an svg DOM element

Parameters

  • domElem Object svg element generated from Bowlcut.

Returns Object New svg DOM element with unions applied.