使用 Marlett.ttf 作为 CSS 字体

发布于 2025-01-01 00:00:42 字数 888 浏览 6 评论 0原文

我正在开发一个基于 Web 的 GUI,为此我选择使用 Windows 中的一些图形元素。这些元素是 Windows 从名为 Marlett.ttf 的自己的系统字体中获取的元素:对于那些不熟悉它的人来说,Marlett.ttf 包含 Windows 中用于呈现多个 GUI 详细信息的字符:窗口操作符号(十字、破折号、正方形)、滚动条箭头等。

由于我想在没有任何图像和纯 CSS 的情况下实现我的目标,我想我只需使用 CSS3 @font-face 属性来确保我可以在我的网页中使用 Marlett.ttf。

我的试验都没有(调用本地字体文件,提取它(这是一个痛苦的事情,因为它是一个真正隐藏得很好的文件,我必须使用 xcopy 从我自己的 Windows 中获取它的副本!)并将其称为远程文件...)成功。

我什至尝试使用 cufòn,即使我对它根本不满意,但即使 cufòn 网站似乎也无法从该死的 .ttf 生成正确的 .font.js 文件:这是我从中得到的唯一结果是一个空标签,就好像 cufòn 无法解析该字体中的字符一样。不过,这些都是完全标准的(说到索引,这些字符对应于 0 到 9 的数字和 a 到 z 的小写字母)。

marlett.ttf 文件本身似乎并不具体,因为您可以使用 chammap 或简单地双击它并使用 Windows 的字体预览功能来检查其内容。不过,我没有用另一个操作系统检查它......

有人知道这里出了什么问题吗?为什么我不能像使用其他字体一样使用该字体,我该怎么办?该文件是否具有“特殊”属性,使其无法被除 Windows 之外的任何其他程序读取(即使我很难相信它),如果确实如此,我是否有任何方法可以摆脱它?

预先感谢您的宝贵时间。这是一个小提琴: http://jsfiddle.net/kRkBa/

I'm working on a web-based GUI, for which I chose to use some graphical elements from Windows. These elements are the ones Windows gets from its own system font named Marlett.ttf : for those of you who aren't familiar with it, Marlett.ttf contains the caracters used in Windows to render multiple GUI details : window operations symbols (cross, dash, squares), scrollbar arrows, and so on.

As I want to achieve my goal without any image and in pure CSS, I figured I'd just use CSS3 @font-face property to make sure I can use Marlett.ttf in my webpages.

None of my trials (calling the local font file, extracting it (which was a pain in the ass because it's a truly well hidden file, I had to use xcopy to get a copy of it from my own Windows !) and calling it as a distant file...) were successful.

I even tried to use cufòn, even if I wouldn't have been satisfied at all with it, but even the cufòn website seems to fail generating a proper .font.js file from that goddamn .ttf : the only result I get from this being an empty tag, as if cufòn was unable to parse characters from that font. These are perfectly standard though (speaking of indexes, these caracters correspond to digits from 0 to 9 and lowercase letters from a to z).

The marlett.ttf file itself doesn't seem to be specific in any way, as you can check its content with charmap or simply by double-clicking it and using Windows' font preview function. I didn't check it with another OS though...

Does anyone has any clue about what's going wrong here ? Why can't I use that font like any other one, and what can I do about it ? Does the file have "special" properties making it unreadabke by anything but Windows (even if I'd have real trouble believing it), and if it does, would there be any way for me to get rid of it ?

Thanks in advance for your time. Here's a fiddle : http://jsfiddle.net/kRkBa/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文