summaryrefslogtreecommitdiffstats
path: root/src/textable.js
blob: c9a90db5f5d8af03b0100d7599ac4ffe86fd5863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Create plain text node
export function plain (text) {
  // clear if build mode is disabled
  if (this._build === false) {
    this.clear()
  }

  // create text node
  this.node.appendChild(document.createTextNode(text))

  return this
}

// FIXME: Does this also work for textpath?
// Get length of text element
export function length () {
  return this.node.getComputedTextLength()
}