1

Working on rebranding a portal/community/experience login page. The designers, being non-Salesforce folk, have a CSS font-face tag in there that references the font files and I've got them in a static resource now (zipped, no subfolders, resource called fonts

The problem is that I can't seem to use the static resources because they sit on the other side of the auth mechanism, therefore they get redirected to the login page, the HTML gets served back into where it's expecting a font and of course that breaks.

I've tried a couple of approaches so far

url(({!URLFOR($Resource.fonts,'/franklingothicurw-boo.woff')})

which gives a 404 not found

and

url(/esg/s/sfsites/c/resource/fonts/franklingothicurw-boo.woff)

which redirects to the login page and gives OTS parsing error: invalid sfntVersion: 218774561

Is there a way to reference the fonts correctly in a CSS font-face tag prior to site authentication?

If it makes a difference, these are old style pages, using Force.com/Visualforce tech. No Lightning here I'm afraid

2
  • Is there a reason you couldn’t set visibility to Public on the static resources that you need accessible from the public login. Jun 8 at 12:53
  • Rob- If you are referencing a Zip file then your relative path must start with fonts/font... like this url(({!URLFOR($Resource.fonts,'fonts/franklingothicurw-boo.woff')}). The relative path must include full hierarchy of sub-folder structure and not just the .woff file only.
    – VarunC
    Jun 8 at 13:54

1 Answer 1

0

Ok, seems to be fixed now. The URLFOR approach appears to work, but I ended up with the font resources as a static resource each in their own right, not zipped, and referenced them individually

url({!URLFOR($Resource.franklingothicurw_boo_woff2))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.