0

My goal was to design a simple website, with a custom font (that isn't available on Google Fonts). I used FontSquirrel's generator for webfonts as a supplement to manually-linked fonts. What was expected was for the src for the WOFF and WOFF2 files to be just simple links to the files. What happened was the generator added this garbage data (which was taken on pastebin as spam and would probably be taken as spam here as well) for every WOFF and WOFF2 file. This threw me off.

As I already stated, I manually linked the files and it did not work, however this may be just a side effect of me not knowing how webfonts work. I tried to look up about this on the internet and found irrelevant results.

I used FontSquirrel to generate the files, and these are the settings I used. The extra font filetypes are for debugging this problem (it only happens to WOFF as I found out).

Am I truly not linking WOFF files properly? Is WOFF supposed to be linked like this? Is the generator supposed to insert garbage data into the WOFF srcs?

edit 1: I only figured out now (after someone pointed it out) that this "garbage data" may just be simply raw font data. I still don't know, however, why this happens, if this is a bug and I can just use the simple src attribute pointing to the file, or is this intentional?

Ron Afoc
  • 1
  • 2
  • Is your issue that the font is being injected inline rather that saved in a standalone file or that the font itself is too large? – Álvaro González Feb 01 '21 at 14:35
  • No. The font is in its own file. I am concerned about the srcs of the file being absurdly long. I embedded a gist that contains one of these WOFF srcs. – Ron Afoc Feb 01 '21 at 14:37
  • That's only about 21K. What makes you say it's "garbage data" and not, say, actual font data? – Heretic Monkey Feb 01 '21 at 14:49
  • One of these srcs is 21K, but there are at least 18 of these in one file, also twice because WOFF2 also does this. I actually haven't thought that it may be raw font data, but why does it need to be embedded and not just an src to the same font data? – Ron Afoc Feb 01 '21 at 14:51
  • Is this somehow relevant? https://stackoverflow.com/questions/14793842/browser-does-not-render-woff-fonts-font-face – Ron Afoc Feb 01 '21 at 15:02
  • These seem like questions that should be asked to FontSquirrel. They're not really programming questions. Programmatically, you can include fonts as data URIs, URLs to font files, whatever you want. How FontSquirrel packages their fonts is completely up to FontSquirrel. – Heretic Monkey Feb 01 '21 at 15:17

0 Answers0