1

I'm running into issues with slow speed on pages, and I noticed that there is a huge text string in our pages. I believe it's base64 encoding. I'm not sure if this is is it, but is this normal for Cloud Pages to call fonts like this? Or is there another way to do this without such a long text string? Maybe Google Fonts? The string below goes for thousands of more characters. I had to cut it to fit it in the text box.

<link href="https://fonts.googleapis.com/css?family=Open+Sans&amp;display=swap" rel="stylesheet">
%%[
    SET @customFont = "T1RUTwAMAIAAAwBAQ0ZGIPx4wZsAACjsAABlnERTSUcFzasEAACbMAAAHKBHUE9T/YMS9wAAjogAAAVQR
3Avch+xv3IRPs

............................thousands of more characters ............................

93L4OBVod6fMy5+nrq6fb0tKd29oHxPy+9sEWYC2zNScsbe3nGVCSoBgWR8lBPcfysr3EfcIb=="
]%%
<style>
    @font-face {
        font-family: "universStdBold";
        src: url(data:font/ttf;base64,%%=v(@customFont)=%%) format('truetype');
        font-weight: normal;
        font-style: normal;
    }
</style>
4

It appears this is necessary for custom font hosting in SFMC. See here for more details: Upload custom font on Marketing Cloud

Basically you cannot host a font in SFMC without including it as the base64 encoded string inside your stylesheet.

Example pulled from the above listed answer:

AMPscript:

%%[
  SET @customFont = "BlahBlahBase64String"
]%%

CSS:

@font-face {
  font-family: "BestFontEver";
  src: url(data:font/ttf;base64,%%=v(@customFont)=%%) format('truetype');
  font-weight: normal;
  font-style: normal;
}

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.