Google GMAIL 中的字体无法识别
Google Font in GMAIL doesn't get recognized
我正在使用 PHPMailer 发送邮件,Gmail 似乎无法识别标题中的字体 "Kaushan Script",但它可以成功识别其余 body 中的 "Roboto Condensed"。两者都是 Google 字体。尽管如此,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>
上下文
据我所知,Gmail 不支持所有 Google 字体或网络字体。 2018 年 4 月,Gmail 为其网络邮件客户端发布了更新的界面。这个新界面使用有限的流行网络字体列表,包括 Google Sans 和 Roboto。 (这解释了为什么 Roboto 工作是你的情况)。
问题
我没有找到这方面的官方文档,也没有找到支持 Gmail 界面的 Google 字体或网络字体的列表。
备选
这些是 Gmail 支持的字体。尝试更改其中任何一个的 "Kaushan Script" 以确认 Gmail 不支持 "Kaushan Script"。检查您是否可以使用这些字体中的任何一种来替换 "Kaushan Script"。否则我建议改用图片。
- 宋体
- 宋体黑
- Arial 窄
- 文人古风
- 古董书
- 木炭
- 快递
- 快递新
- Comic Sans MS
- 固定宽度(等宽)
- 加拉蒙德
- 日内瓦
- 格鲁吉亚
- Helvetica
- 影响
- Lucida 控制台
- 大露西达
- Lucida Sans Unicode
- 摩纳哥
- 等宽
- MS 无衬线字体
- 窄(arial 窄)
- 纽约
- 帕拉蒂诺
- Palatino Linotype
- 机器人
- 无衬线体(宋体)
- Serif (times new roman)(serif)
- 符号
- 塔霍马
- 次
- Times New Roman(times new roman, serif)
- Trebuchet MS(trebuchet ms,无衬线体)
- 绿色
- Webdings
- 宽(宋体黑)
- Wingdings
- Zapf 装饰符号
祝你好运!
我正在使用 PHPMailer 发送邮件,Gmail 似乎无法识别标题中的字体 "Kaushan Script",但它可以成功识别其余 body 中的 "Roboto Condensed"。两者都是 Google 字体。尽管如此,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>
上下文
据我所知,Gmail 不支持所有 Google 字体或网络字体。 2018 年 4 月,Gmail 为其网络邮件客户端发布了更新的界面。这个新界面使用有限的流行网络字体列表,包括 Google Sans 和 Roboto。 (这解释了为什么 Roboto 工作是你的情况)。
问题
我没有找到这方面的官方文档,也没有找到支持 Gmail 界面的 Google 字体或网络字体的列表。
备选
这些是 Gmail 支持的字体。尝试更改其中任何一个的 "Kaushan Script" 以确认 Gmail 不支持 "Kaushan Script"。检查您是否可以使用这些字体中的任何一种来替换 "Kaushan Script"。否则我建议改用图片。
- 宋体
- 宋体黑
- Arial 窄
- 文人古风
- 古董书
- 木炭
- 快递
- 快递新
- Comic Sans MS
- 固定宽度(等宽)
- 加拉蒙德
- 日内瓦
- 格鲁吉亚
- Helvetica
- 影响
- Lucida 控制台
- 大露西达
- Lucida Sans Unicode
- 摩纳哥
- 等宽
- MS 无衬线字体
- 窄(arial 窄)
- 纽约
- 帕拉蒂诺
- Palatino Linotype
- 机器人
- 无衬线体(宋体)
- Serif (times new roman)(serif)
- 符号
- 塔霍马
- 次
- Times New Roman(times new roman, serif)
- Trebuchet MS(trebuchet ms,无衬线体)
- 绿色
- Webdings
- 宽(宋体黑)
- Wingdings
- Zapf 装饰符号
祝你好运!