[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Save font file with document from my MFC aplication

Posted on 2006-06-10
1
Medium Priority
?
439 Views
Last Modified: 2013-12-03
Yes I know! You are not supose to distribute fonts whitout copyright infringement unless you have writen consent and bla bla bla ...... and I'll be dead before I can even think on this because I'm not even close to super powerfull (Put your favorite to hate corporation name here).

But I'm doing this aplication for a design firm wich helps them to protect/manage their designs database and they insist on having a PDF file behavour when opening their files from my aplication. I proposed them that the file can let them know wich fonts aren't available when opening but they still don't like to lose time surfing the server looking for a font. Something like Corel Draw cdr files with the fonts used embeded in the file when the document is saved.

I think that what I need to know for this to work is:

1. How do I get the file name from a LOGFONT structure so i'll be able to save it with the document?
2. When opening a document from my aplication, how do I check if the fonts the document needs exists in the computer used to open such document just using the "font name"?
3. And how do I install a font file from my application?

IMPORTATNT: Please don't confuse font file with font name
0
Comment
Question by:juanjo_dic
1 Comment
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 2000 total points
ID: 16882997
>>How do I get the file name from a LOGFONT structure so i'll be able to save it with the document?
>>When opening a document from my aplication, how do I check if the fonts the document needs exists in the computer

Have a look at this for getting font file info from font face name:
XFont - Get font name and file information
http://www.codeproject.com/gdi/xfont.asp
Finding a Font file from a Font name
http://www.codeproject.com/gdi/fontfile.asp

and This one retrieves font name from TTF file :
http://www.codeproject.com/gdi/fontnamefromfile.asp

Now with above two articles useful to get font file name from face name and face name from file name. So with above may easily check that fonts you needed in your applicaton are present or not.

>>And how do I install a font file from my application?
Have a look at this :
A simple wrapper to dynamically install/uninstall application specific fonts from compiled resources.
http://www.codeproject.com/gdi/FontInstaller.asp

-MAHESH
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month19 days, 14 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question