



export async function loadFonts (fontName, fontFile) {


  // const font = new FontFace(
  //   "DroidSansFallback",
  //   "url(" + "../../assets/play/font/DroidSansFallback.ttf" + ")"
  // );
  
  try {
    console.log(location.href.split("#")[0] + "assets/play/font/" + fontFile);
    const font = new FontFace(
      fontName,
      "url(" + location.href.split("#")[0] + "../../assets/play/font/" + fontFile + ")"
    );
    
    console.log('start: ', new Date().getTime())
    await font.load();
    console.log('end: ', new Date().getTime())
    document.fonts.add(font);
    document.body.classList.add("fonts-loaded");

  } catch (error) {
    console.log(error);
  }
  
}


// --------------- custom class --------------------

