async function isAvailable(fontSpec) {
    await fontFaceSet.ready;
    const fontFaces = await fontFaceSet.load(fontSpec);
    if (fontFaces.length === 0) {
      return false;
    }
    const font = getFontParameters(fontSpec);
    const checkFamily = font.families[0].toLowerCase();
    const checkWeight = font.weight;
    return fontFaces.some(
      /**
       * @param {import('../css.js').FontParameters} f Font.
       * @return {boolean} Font matches.
       */
      (f) => {
        const family = f.family.replace(/^['"]|['"]$/g, '').toLowerCase();
        const weight = fontWeights[f.weight] || f.weight;
        return (
          family === checkFamily &&
          f.style === font.style &&
          weight == checkWeight
        );
      },
    );
  }
@param {string} fontSpec Css font spec
@return {Promise<boolean>} Font with style and weight is available