如何使用特定字体创建电子邮件? [英] How can I create an email using a specific font?

查看:216
本文介绍了如何使用特定字体创建电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个具有特定字体(handwriting.ttf)的应用程序,它在应用程序中绝对可以正常工作,但是当我通过我的应用程序通过电子邮件发送用该字体编写的文本时-字体在接收者端变得杂乱无章(原因是接收者的计算机中没有这种垂直字体)

I have made an applications which has specific font (handwriting.ttf), it works absolutely fine in application but when I email the text written in this font through my application - the font becomes gibrish on receivers end (the reason is that receiver does not have this perticular font in his computer)

我看到了另一个应用程序,该应用程序使用自定义字体通过电子邮件发送文本. 这使我确信这种功能可以正常工作-但我不知道该怎么做?

I have seen another application that sends text via email using custom font. This gives me confidence that functionality like this works - but I dont kow how?

推荐答案

当您说胡言乱语时,是指用户正在看到副本,但是对齐和其他图形元素被弄乱了,或者您确实看到了完全无法理解的东西.我本来希望您的字体标签具有一系列字体,并且如果使用自定义字体的尝试失败,电子邮件将退回到一种更标准的字体中.请使用(a)用于创建电子邮件正文的代码,以及(b)有关如何在电子邮件客户端中进行呈现的屏幕快照,来更新您的原始问题.

When you say gibberish, do you mean that the user is seeing the copy, but with the alignment and other graphical elements getting screwed up, or that you literally see something entirely incomprehensible. I would have expected your font tag to have a series of fonts and that the email would have fallen back to one of the more standard fonts if the attempt to use the custom font failed. Please update your original question with (a) the code that you're using to create your email body, as well as (b) a screen snapshot of how it's rendered in the email client.

两个即时建议:

  1. 如果您知道其他正在使用自定义字体发送电子邮件的应用程序(对此我感到很惊讶,但我会为您效忠),请让其中一个向您发送电子邮件,然后查看该电子邮件的来源,并查看其在电子邮件HTML中的内容,并检查其运行方式;

  1. If you know of other apps that are sending email with a custom font (which I'm surprised by, but I'll take your word for it), have one of them send you an email and then view the source of that email and see what it's putting in the email's html and examine how it's doing it;

我收到的大多数使用特殊字体的电子邮件也都包含了各种图形元素,并且将电子邮件作为图像发送(您可以使用base64嵌入到基于html的电子邮件中,或者放置在某些服务器上并链接到那里的< img>),也经常使用文本格式.您可以使用 Quartz 2D 来创建这些图像,然后将其嵌入到电子邮件中.显然,这并非在所有情况下都有效,但使用电子邮件正文或将PDF(您也可以从应用程序生成)作为附件的图像似乎更为常见.

Most emails I get that are employing specialized fonts are also incorporating all sorts of graphical elements and it's sending the email as an image (which you can either embed in-line in the html-based email using base64, or put on some server and link to the <img> there), frequently with a text rendition, too. You can use Quartz 2D to create those images that you then embed in your email. Clearly this won't work in all situations, but using images for the body of the email, or PDFs (which you can also generate from the app) for attachments seems to be more common.

就我个人而言,我会避免将自定义字体嵌入到电子邮件的html正文中,因为您受制于用户电子邮件客户端如何呈现自定义字体(如果有的话)的种种变数.另外,您还想做一些详尽的测试,检查不同电子邮件客户端中的电子邮件(就像@meccan的已注释链接一样).如果生成的电子邮件的外观和风格至关重要且风格高度,并且电子邮件的内容相对较短,则我倾向于选择选项2.

Personally, I'd shy away from embedding custom fonts in the html body of the email because you're subject to the vagaries of how the user's email client renders custom fonts, if at all. Plus you'd want to do some exhaustive testing, examining the email in different email clients (as @meccan's commented link had done). If the look and feel of the resulting email are critical and highly stylized, and if the content of the email is relatively short, I'd lean towards option 2.

这篇关于如何使用特定字体创建电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆