Click here to Skip to main content
15,883,606 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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 ?
Posted
Updated 24-Jun-14 3:10am
v2
Comments
[no name] 24-Jun-14 9:26am    
See this link- https://www.youtube.com/watch?v=8MeNU1CEhlY

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

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

Please, refer this: Embedding Fonts in a Document[^]
 
Share this answer
 
Comments
Alexey Vlasenko 24-Jun-14 9:45am    
I'm working on convertation from pdf to rtf. And I don't know, what kind of data ms word processor wants to see in font embedded section {\*\fontemb\...}. There is no any information about this in spec.
I used TTEmbedFont function from WinAPI to create embedded font data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900