如何将字体嵌入RTF文件 [英] How to embed font to RTF file

查看:169
本文介绍了如何将字体嵌入RTF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我需要将字体嵌入到rtf文档中。但我没有找到任何例子如何做到这一点。 MS Word生成这样的文件和数据。



{\f230\fbidi \fdecor\fcharset0\fprq2 {\ * \ panose 04020705040a02060702}

{\ * \fontemb \ ftruetype

5ba1000099a0000002000200040000000004020705040a02060702000090
$ b $ 00 0000007200730069006f006e00200031002e0035003600000010004100

030142480060da0065690045aa14cde98ccfd21159a3440a4dde19f1ebe

6f7300e819b086bbfdc03c2c01fda246e9d15878691a9dd6172df21b8fdfa

aeaba8ffaf6b6c1bbc443da013441c80e6fe154dfd6690f00ee63e101adb1

b3332e49b341de932d1660ce44a857d66fcd30a0a397dae88140298954



.....



65c1b474e4557a922ce3c0cb7c599e2cbc0} Emb_Font;}



我试图在我的应用程序中打开font-file(.ttf)并将其内容转换为hex串。它适用于rtf中的图像,但没有给我任何字体结果。可能是,rtf文件需要一些特定的数据,而不仅仅是font-file中的字体信息。有没有例子怎么做?

So I need to embed font to rtf document. But I've not found any examples how to do it. MS Word generates fileds and data like this.

{\f230\fbidi \fdecor\fcharset0\fprq2{\*\panose 04020705040a02060702}
{\*\fontemb\ftruetype
5ba1000099a00000020002000400000004020705040a02060702000090
0065007200730069006f006e00200031002e0035003600000010004100
030142480060da0065690045aa14cde98ccfd21159a3440a4dde19f1ebe
6f7300e819b086bbfdc03c2c01fda246e9d15878691a9dd6172df21b8fdfa
aeaba8ffaf6b6c1bbc443da013441c80e6fe154dfd6690f00ee63e101adb1
b3332e49b341de932d1660ce44a857d66fcd30a0a397dae88140298954

.....

65c1b474e4557a922ce3c0cb7c599e2cbc0}Emb_Font;}

I tried to open font-file (.ttf) in my app and convert it's content to hex string. It worked with images in rtf, but didn't give me any result with fonts. May be, rtf file needs some specific data, not only font information from font-file. Are there any examples how to do it ?

推荐答案

顺便说一句......

By The Way...
引用:

如果在MS Word以外的其他字处理器中打开带有嵌入字体的RTF文件,它通常会删除嵌入字体。

if an RTF file with embedded fonts is opened in other word processor than MS Word, it will usually remove embedded fonts.



来源: http://en.wikipedia.org/wiki/Font_embedding [ ^ ]



请参考:在文档中嵌入字体 [ ^ ]


我使用WinAPI中的TTEmbedFont函数创建嵌入字体数据。
I used TTEmbedFont function from WinAPI to create embedded font data.


这篇关于如何将字体嵌入RTF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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