function generateFont(
  { alias, local, path, fallback, style, ultimate },
  src,
  localFontPath,
  useFallback = true,
  usePath = true,
  append = ""
) {
  const result = {
    style: null,
    ultimate: null,
  };
  if (local) {
    const extra = append ? ` ${append}` : "";
    for (const name of local) {
      src.push(`local(${name}${extra})`);
    }
  }
  if (alias) {
    const substitution = substitutionMap.get(alias);
    const aliasAppend = append || getStyleToAppend(style);
    Object.assign(
      result,
      generateFont(
        substitution,
        src,
        localFontPath,
        /* useFallback = */ useFallback && !fallback,
        /* usePath = */ usePath && !path,
        aliasAppend
      )
    );
  }
  if (style) {
    result.style = style;
  }
  if (ultimate) {
    result.ultimate = ultimate;
  }
  if (useFallback && fallback) {
    const fallbackInfo = substitutionMap.get(fallback);
    const { ultimate: fallbackUltimate } = generateFont(
      fallbackInfo,
      src,
      localFontPath,
      useFallback,
      /* usePath = */ usePath && !path,
      append
    );
    result.ultimate ||= fallbackUltimate;
  }
  if (usePath && path && localFontPath) {
    src.push(`url(${localFontPath}${path})`);
  }

  return result;
}
Generate font description.
@param {Object} param0, font substitution description.
@param {Array<String>} src, contains src values (local(...) or url(...)).
@param {String} localFontPath, path to local fonts.
@param {boolean} useFallback, whether to use fallback font.
@param {boolean} usePath, whether to use path to font.
@param {String} append, style (Bold, Italic, ...) to append to font name.
@return {Object} { style, ultimate }.