Using browser system font stack in html email
Asked Answered
C

1

5

Do system font stacks, e.g. something like...

<p style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"> Whatever sans-serif font, but please use that ugly Arial as a last resort only </p>

...work in common email clients too?

I've tested it on my own devices (Outlook 2017 & Android App, Android E-Mail, Gmail Web & Android App), and it seems to work so far.

But what about Apple? I've got no devices to test and I don't know if I have to use the system name or the font's real name.

Crackerjack answered 17/2, 2017 at 15:7 Comment(0)
N
10

Yes, system fonts work in EVERY email client, including every Apple product on Mac OS (Apple Mail, Outlook for Mac, etc.) and iOS (iPhone Mail, iPad Mail, Gmail for iOS, etc.)

The font stack works just like it would on the web. Using your example:

<p style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"> Whatever sans-serif font, but please use that ugly Arial as a last resort only </p>
  1. If -apple-system is installed, display that.
  2. Else if BlinkMacSystemFont is installed, display that.
  3. Else if Segoe UI is installed, use that.

And so on.


GitHub uses a font stack with 100% system fonts that covers most bases, just as an example:

font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"
Novellanovello answered 17/2, 2017 at 16:24 Comment(2)
I actually did not know this. Excellent answer.Maisonette
Yeah, this is absolutely the way to go with fonts in HTML emails. There are a lot of tutorials out there that say you can use webfonts, but they do not work reliably. Just stick to system fonts.Unmeaning

© 2022 - 2024 — McMap. All rights reserved.