Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gmail not showing correct font

I am trying to change the font of my emails to open sans, however, I am having issues with Gmail rendering the correct font. I managed to find a way to solve the issue for outlook. This is what I have:

body {

        @font-face {
                font-family: 'Open Sans';
                font-style: normal;
                font-weight: 300;
                src: local('Open Sans'), local('OpenSans'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff) format('woff');
            }
        }

I have also tried other things such as declaring all text to be open sans:

<link href='http://fonts.googleapis.com/css?family=Open+Sans:300'rel='stylesheet'type='text/css'>
     <style type="text/css">
    .stylealltext { font-family: 'Open Sans', sans-serif;}
    .stylealltextbold {font-weight: bold; font-family: 'Open Sans', sans-serif; }

However, Gmail decides to show Arial, while Google Inbox decides to show Helvetica.. It looks like Google's mailing services just overrides whatever I feed it. Can anyone help?


Solution

Salvimatus's solution worked:

<span style="font-family: your-chosen-font">your text</span>

The span needs to manually added.

like image 938
Hadi Avatar asked Feb 26 '15 16:02

Hadi


1 Answers

Gmail does not support @font-face.

For you customize the font, you should write inline in each block of text that you have:

< span style="font-family: your-chosen-font">your text< /span>

Note: must be a font we have natively on Windows or Mac.

like image 64
salvimateus Avatar answered Oct 26 '22 05:10

salvimateus