如何在邮件中嵌入附件字体?

问题描述

我尝试将Google Api中的字体嵌入为我的邮件html中的 font-family:'Montserrat',sans-serif; 。有人请帮我怎么添加它。

https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap%22%20rel=%22stylesheet

https://fonts.googleapis.com/css2?family=Stint+Ultra+Condensed&display=swap

<!DOCTYPE html>
<html>

<head>
    <Meta charset="UTF-8">
    <Meta name="viewport" content="width=device-width,initial-scale=1.0">
    <Meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Test Font mailer</title>
    <link href="https://fonts.googleapis.com/css?family=Raleway&display=swap" rel="stylesheet">
</head>

<body style="margin:0; padding:0;">
<style>
    
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: local('Montserrat Medium'),local('Montserrat-Medium'),url(https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_ZpC3gTD_u50.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: local('Montserrat Medium'),url(https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_ZpC3g3D_u50.woff2) format('woff2');
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: local('Montserrat Medium'),url(https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_ZpC3gbD_u50.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: local('Montserrat Medium'),url(https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_ZpC3gfD_u50.woff2) format('woff2');
  unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: local('Montserrat Medium'),url(https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_ZpC3gnD_g.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'StintUltraCondensed';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Stint Ultra Condensed'),local('StintUltraCondensed-Regular'),url(https://fonts.gstatic.com/s/stintultracondensed/v9/-W_gXirsVjjeyEnPC45qD2NoFPtBE0xCh2AOox8P6cM.woff2) format('woff2');
  unicode-range: U+0100-024F,U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'StintUltraCondensed';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Stint Ultra Condensed'),url(https://fonts.gstatic.com/s/stintultracondensed/v9/-W_gXirsVjjeyEnPC45qD2NoFPtBE0xCh2AOrR8P.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+FFFD;
}
        body {
            margin: 0;
            padding: 0;
            background: #eeeeee;
            font-family: 'Montserrat',sans-serif;
        }
        
    </style>
    <table width="100%" align="center" cellpadding="0" cellspacing="0" bgcolor="aqua">
        <tr>
            <td>
                <table width="700" align="center" cellpadding="0" cellspacing="0" border="0" class="mainWidth"
                    style="background: #fff;">
                    
                    <tr>
                        <td align="center" valign="top"><div style="font-family:'StintUltraCondensed';font-size:50px">My First test font will work.</div></td>
                    </tr>
                    <tr>
                        <td align="center" valign="top"><div style="font-size:70px">My First test font will work.</div></td>
                    </tr>
                    
        </tr>
    </table>
    </td>
    </tr>
    </table>
</body>

</html>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)