Skip to content

fix(scripts): font download for new Google Fonts URL format - #34

Open
tomvoet wants to merge 3 commits into
marella:mainfrom
tomvoet:fix/google-fonts-url-format-change
Open

tomvoet wants to merge 3 commits into
marella:mainfrom
tomvoet:fix/google-fonts-url-format-change

Conversation

@tomvoet

@tomvoet tomvoet commented Feb 16, 2026

Copy link
Copy Markdown

Google Fonts API now returns opaque URLs without file extensions:
https://fonts.gstatic.com/l/font?kit=...&skey=...&v=v145

This broke the font download script which extracted the format from the URL extension:

file:///C:/Users/tomvo/git/material-design-icons/scripts/utils.js:109
    throw new Error(`${name} should be '${expected}' not '${actual}'`);
          ^

Error: font extension should be 'woff' not 'com/l/font?kit=flUhRq6tzZclQEJ-Vdg-IuiaDsNa&skey=4fbfe4498ec2960a&v=v145'
    at assertEquals (file:///C:/Users/tomvo/git/material-design-icons/scripts/utils.js:109:11)
    at parseCss (file:///C:/Users/tomvo/git/material-design-icons/scripts/font.js:73:3)
    at getFontUrl (file:///C:/Users/tomvo/git/material-design-icons/scripts/font.js:60:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async next (file:///C:/Users/tomvo/git/material-design-icons/scripts/utils.js:86:18)
    at async Promise.all (index 1)
    at async apply (file:///C:/Users/tomvo/git/material-design-icons/scripts/utils.js:89:3)
    at async downloadFonts (file:///C:/Users/tomvo/git/material-design-icons/scripts/font.js:40:16)
    at async Command.<anonymous> (file:///C:/Users/tomvo/git/material-design-icons/scripts/index.js:54:5)
    at async Command.parseAsync (C:\Users\tomvo\git\material-design-icons\node_modules\commander\lib\command.js:923:5)

Solution

  • Remove URL extension validation from parseCss (URLs no longer contain extensions)
  • Verify font format by inspecting the downloaded file's metadata
  • Add font family name verification as extra validation

Testing

Ran the script using various configurations successfully.

@tomvoet tomvoet changed the title Fix font download for new Google Fonts URL format fix(scripts): font download for new Google Fonts URL format Feb 27, 2026
@tomvoet

tomvoet commented Feb 27, 2026 •

Copy link
Copy Markdown
Author

@marella could you take a look at this? This problem is fully breaking the use of @material-design-icons/scripts in our org.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant