Include @font-face with save page as

2

I can embed a custom font with @font-face in the css like this:

@font-face{ font-family: MyFont; src: url('fonts/font.ttf'); }

But when I save the page on my computer to see the page as local, the font is not saved. I tried this with Firefox and Chrome and the issue is the same in both.

How can I force embed the font with save page as ?

ManUtopiK

Posted 2013-01-23T21:04:32.760

Reputation: 121

1this might go under superuser. depends on where your looking for the resolution. – TMB – 2013-01-23T21:06:24.250

Agreed - not only do I think this will be browser / OS specific and next to impossible to force for everyone... I think it's also better suited for SU. – rlemon – 2013-01-23T21:51:28.253

Save Page As won't know how to follow url(); in CSS. You'll need to grab those files manually. – LuckySpoon – 2013-01-24T02:23:43.413

@LuckySpoon: As the browser can read that url stuff from CSS, it could also save it. That's not really an argument you give. – hakre – 2013-01-24T03:05:42.817

Which browser are you saving the file with? – hakre – 2013-01-24T03:06:11.093

@hakre: In my experience, Save Page As does not reliably follow CSS paths. Whilst I agree it should know how, I've never found this to be the case. – LuckySpoon – 2013-01-24T03:14:36.393

This should be reported in the issue trackers of those browsers. – hakre – 2013-01-24T03:22:33.820

Answers

4

This can be easily done with the command line tool wget. Download it and then enter in your command line:

wget -p -k http://mywebsite.com

Wget will download all CSS, JS and Webfonts.

chicken

Posted 2013-01-23T21:04:32.760

Reputation: 365

1If you do this you might need to remove all the query parameters from the saved files, todo this on UNIX use something like find . -name \*\\?\* | while read file; do mv "$file" $(echo $file | sed 's/\?.*//'); done – Matthew Buckett – 2017-06-27T11:32:04.823