在带有@ font-face的CSS中使用OS 9资源fork字体 [英] Using OS 9 resource fork fonts in CSS with @font-face

查看:217
本文介绍了在带有@ font-face的CSS中使用OS 9资源fork字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些旧的OS 9字体,其中包含资源分支中的字体数据。当我尝试在@ font-face中链接这种字体并在浏览器中打开HTML时,文本仍以默认字体显示。

I have some old OS 9 fonts which contain the font data in the resource fork. When I try to link such a font in a @font-face and open up the HTML in a browser, the text still appears in the default font.

,我发现字体数据可以使用rsrc属性复制到常规的ttf文件。所以我运行命令 cp< font> / rsrc< font> -attr.ttf 并尝试链接@ font-face中的新文件。再次,文本以默认字体显示。

On searching around, I found that the font data can be copied to a regular ttf file using the rsrc attribute. So I ran the command cp <font>/rsrc <font>-attr.ttf and tried linking the new file in the @font-face. Again, the text showed up in the default font.

关于stackoverflow的另一个讨论建议二进制打印和使用 xattr -p <字体> | xxd -r> < font> -xxd.ttx 。再次,链接此文件无法更改字体。

Another discussion on stackoverflow suggested binary printing and copying of the data using xattr -p <font> | xxd -r > <font>-xxd.ttx. Once again, linking this file failed to change the font.

只是为了确保HTML是正确的,我链接了一个较新的ttf字体从同一个目录,它工作正确。有没有人知道,如果旧的字体可以用于@ font-face,有或没有任何转换。谢谢。

Just to make sure that the HTML was correct, I linked a newer ttf font from the same directory and it worked correctly. Does anyone know if the old fonts can be used in @font-face, with or without any conversion. Thank you.

推荐答案

字体手提箱可以容纳2种不同类型的字体:位图字体和TrueType字体。位图字体将是'NFNT'资源以及必要的'FOND'(字体系列信息)。另一方面,TrueType字体将是'FOND'(字体系列)的'sfnt'资源条目信息)。通常,保存位图字体数据的字体手提箱只有字体的一半;要使用,您需要有额外的PostScript Outline字体文件(这些文件将有一个 LWFN 图标)。

Font Suitcases can potentially hold 2 different kinds of fonts: bitmap fonts and TrueType fonts. Bitmap fonts would be 'NFNT' resources along with the necessary 'FOND' (font family information). On the other hand, TrueType fonts would be 'sfnt' resource entries along with the necessary 'FOND' (font family information). Normally, font suitcases that hold bitmap font data are only one half of the font; to be usable you need to have the additional PostScript Outline font files (these will have an LWFN icon).

否则,字体手提箱可以表示TrueType字体,与PostScript类型1字体手提箱相比,它是真正自包含的。

Otherwise, the font suitcase can represent a TrueType font, which compared to a "PostScript Type 1 Font Suitcase", is truly self-contained.

要从资源 - 基于文件的Mac TrueType字体转换为Windows TrueType字体,您只需要提取'sfnt'资源条目)。

To convert from a resource-file-based Mac TrueType font to a Windows TrueType font, you just need to extract the 'sfnt' resource entries).

由于Rosetta已经没有了,我没有Resorcerer,所以我设法打开一个准系统资源文件编辑器。

Since Rosetta is no more, I'm without Resorcerer, so I've managed to whip up a barebones resource file editor.

http://www.markdouma .com / developer / ResourceFinagler.zip

我只是添加了几行,现在可以选择个人'sfnt'

I just added a few lines so that you can now select the individual 'sfnt' resources like shown in the image below, and drag them to the Finder to create the individual Windows TrueType fonts.

这篇关于在带有@ font-face的CSS中使用OS 9资源fork字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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