GMAIL 中的 Google 字体无法识别

我正在使用 PHPMailer 发送邮件,Gmail 似乎无法识别标题中的字体“Kaushan Script”,但它成功识别了正文其余部分的“Roboto Condensed”。两者都是谷歌字体。尽管如此,gmail 还是能够识别一个并忽略另一个并放置它自己的随机字体。检查 gmail 中的元素仍然显示我使用的字体名称。这是我的代码:


<!DOCTYPE html>

  <html>

   <head>

     <meta charset="utf-8">

     <meta name="viewport" content="width=device-width, initial-scale=1.0">

     <link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed&display=swap" rel="stylesheet">

     <link href="https://fonts.googleapis.com/css2?family=Kaushan+Script&display=swap" rel="stylesheet">

     <style>

      .mail-head, .mail-foot {

        background: linear-gradient(315deg, #ee9617 0%, #fe5858 74%);

        padding: 10px;

        width: 100%;

        box-sizing: border-box;

        color: #fff;

        font-size: 2rem;

        font-family: "Kaushan Script", cursive;

      }

      .mail-foot {

        font-size: 14px;

        text-align: center;

        font-family: "Roboto Condensed", sans-serif;

      }

      .mail-body {

        font-size: 1rem;

        font-family: "Roboto Condensed", sans-serif;

        padding: 20px;

        line-height: 1.5;

        border-right: 1px solid #ee9617;

        border-left: 1px solid #fe5858;

      }

      .logo {

        width: auto;

        height: 2.5rem;

      }

      .logo-title {

        position: absolute;

        top: 1rem;

        left: 4.5rem;

      }

      .otp {

        color: #f69;

        margin-left: 10px;

      }

     </style>

   </head>

   <body>

     <div class="mail-head">

       <span class="logo-title">Site Name</span>

     </div>


阿波罗的战车
浏览 93回答 1
1回答

偶然的你

语境据我所知,Gmail 并不支持所有的 Google 字体或网络字体。2018 年 4 月,Gmail 为其网络邮件客户端发布了更新的界面。这个新界面使用了有限的流行网络字体列表,包括 Google Sans 和 Roboto。(这解释了为什么 Roboto 工作是你的情况)。问题我没有找到关于此的官方文档,也没有找到支持 Gmail 界面的 Google 字体或网络字体列表。选择这些是 Gmail 支持的字体。尝试更改其中任何一个的“Kaushan Script”以确认 Gmail 不支持“Kaushan Script”。检查您是否可以使用这些字体中的任何一种来替换“Kaushan Script”。否则我建议改用图像。宋体宋体黑Arial 窄版文人老派古书木炭导游快递新漫画无 MS固定宽度(等宽)加拉蒙日内瓦乔治亚州黑体字影响清醒领事大露西达没有 Unicode 的 Lucida摩纳哥商务车无衬线字体窄 (arial 窄)纽约巴拉丁帕拉蒂诺排字机机器人无衬线字体(宋体)Serif (times new roman)(衬线体)象征塔霍马次Times New Roman(times new roman, serif)Trebuchet MS (trebuchet ms, sans-serif)绿色织带宽幅(宋体黑)翼丁Zapf 标志符号祝你好运!
打开App,查看更多内容
随时随地看视频慕课网APP