function generateSDF(width, height, path, viewBox, distance, exponent, canvas, x, y, channel, useWebGL = true) {
  // Allow opt-out
  if (!useWebGL) {
    return generateSDF_JS_Worker(width, height, path, viewBox, distance, exponent, canvas, x, y, channel)
  }

  // Attempt GPU-accelerated generation first
  return generateSDF_GL(width, height, path, viewBox, distance, exponent, canvas, x, y, channel).then(
    null,
    err => {
      // WebGL failed either due to a hard error or unexpected results; fall back to JS in workers
      if (!warned) {
        console.warn(`WebGL SDF generation failed, falling back to JS`, err)
        warned = true
      }
      return generateSDF_JS_Worker(width, height, path, viewBox, distance, exponent, canvas, x, y, channel)
    }
  )
}
Generate an SDF texture image for a single glyph path, placing the result into a webgl canvas at a
given location and channel. Utilizes the webgl-sdf-generator external package for GPU-accelerated SDF
generation when supported.