This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Patrik Makrai
Posted Dec 04 - Read on Facebook

If you want to display custom fonts, here is a little how-to:

# The font file is at 'fonts/customFont.otf'

style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode("@font-face {\n" +
"\tfont-family: \"myFont\";\n" +
"\tsrc: local('☺'), url('fonts/customFont.otf') format('opentype');\n" +
"}\n" +
"\tfont-family: myFont !important;\n" +
"}\n"));

document.getElementsByTagName('head')[0].appendChild(style);

layerName.style = {
"font-family": "myFont"
}

2 Comments

Erdész Ábel

js accepts smileys now? ;P

Stephen Crowley

Yeah and sometimes it returns sad faces

Read the entire post on Facebook