Hi,
So I'm familiar with the discussions on custom fonts and how to implement a custom font using the @font-face call. I've attempted to implement a custom font, Avenr, in this manner. Unfortunately I'm having no luck with having the custom font rendered. Can someone please help me by glancing at my code to help me determine what I'm doing incorrectly? I'm completely spinning my wheels on this one as the email consistently renders in Arial regardless of the hierarchy of the font-family order. Thanks much!
<style type="text/css">
@font-face {
font-family: "Avenir Next Pro";
src: url('https://www....[actual font URL here]....AvenirNext-Regular.ttf') format("truetype"),
url('https://www....[actual font URL here]....AvenirNext-Regular.svg') format('svg'),
url('https://www....[actual font URL here]....AvenirNext-Regular.eot') format('eot');
}
body{font-family: 'Avenir Next Pro', Helvetica, Arial, Verdana, sans-serif;}
</style>
Solved! Go to Solution.
Quick note here (though it shouldn't matter in terms of what the core problem is in this case; need to see the actual page for that) that you really should use the following structure for your @font-face definition:
@font-face {
font-family: 'Avenir Next Pro';
src: url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.eot");
src: url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.eot?#iefix") format("embedded-opentype"), url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.woff") format("woff"), url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal; }
EDIT: Actually caught the problem here--if you're calling a custom font for your emails, know that there's only partial support (@font-face | Campaign Monitor ) and you need to define Outlook-only fallbacks as to prevent having the program simply use serif.
Please don't obfuscate your real URLs. Point to the page having this problem.
Hi Sanford, upon request, here are the full URLs, which shouldn't affect the surrounding code.
<style type="text/css">
@font-face {
font-family: "Avenir Next Pro";
src: url('https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.ttf') format("truetype"),
url('https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.svg') format('svg'),
url('https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.eot') format('eot');
}
body{font-family: 'Avenir Next Pro', Helvetica, Arial, Verdana, sans-serif;}
</style>
Quick note here (though it shouldn't matter in terms of what the core problem is in this case; need to see the actual page for that) that you really should use the following structure for your @font-face definition:
@font-face {
font-family: 'Avenir Next Pro';
src: url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.eot");
src: url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.eot?#iefix") format("embedded-opentype"), url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.woff") format("woff"), url("https://www.tradingtechnologies.com/wp-content/themes/tt/assets/fonts/AvenirNext-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal; }
EDIT: Actually caught the problem here--if you're calling a custom font for your emails, know that there's only partial support (@font-face | Campaign Monitor ) and you need to define Outlook-only fallbacks as to prevent having the program simply use serif.
Ah yes, "the email"...
You have been a great help. Thank you!
As a follow up for those looking to implement custom fonts, I was able to eventually deliver our custom font successfully in the email. The trick for me was defining the font-family style, not only at the top, but also specifically for each paragraph. It is a laborious task for a text heavy email, but it works.
Here's what it looks like:
<body>
<div id="FreeTextContent" class="mktoText" mktoname="FreeTextContent">
<p><span style="font-family: 'avenir next pro',helvetica, arial, sans-serif;">This is the first paragraph.</span></p>
<p><span style="font-family: 'avenir next pro',helvetica, arial, sans-serif;">This is the second paragraph.</span></p>
</div>
</body>