function loadFont(fontUrl, callback) {
    let font = parsedFonts[fontUrl]
    if (font) {
      callback(font)
    } else if (loadingFonts[fontUrl]) {
      loadingFonts[fontUrl].push(callback)
    } else {
      loadingFonts[fontUrl] = [callback]
      doLoadFont(fontUrl, fontObj => {
        fontObj.src = fontUrl
        parsedFonts[fontUrl] = fontObj
        loadingFonts[fontUrl].forEach(cb => cb(fontObj))
        delete loadingFonts[fontUrl];
      })
    }
  }
Load a given font url if needed, invoking a callback when it's loaded. If already
loaded, the callback will be called synchronously.
@param {string} fontUrl
@param {(font: ParsedFont) => void} callback