function handleFileSelection(event) {
    const selectedFile = event.target.files[0];

    if (selectedFile) {
      if (selectedFile.type === 'application/json') {
        const reader = new FileReader();

        reader.onload = function (e) {
          const jsonContent = e.target.result;

          try {
            const parsedConfig = JSON.parse(jsonContent);

            advancedFonts.applyImportedSettings(parsedConfig);
          } catch (error) {
            console.error('Error parsing JSON:', error);
          }
        };

        reader.readAsText(selectedFile);
      } else {
        console.error('Please select a valid JSON file.');
      }
    }
  }
Import a JSON file of existing font settings