Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Importing a Font File
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Nitro




PostPosted: Thu Jun 26, 2003 12:14 am   Post subject: Importing a Font File

Lets say you want to use a specific font in one of your programs, a font that most people do not have. Is it possible to install a font when your program is first run?


The following code would theoretically work, but I get a permission denied error. Something special about the font direction I think. Any way around it?

code:

File.Copy ("filename", "destination")
        if Error.Last = eNoError then
            put "File copied"
        else
            put "Did not copy the file."
            put "Error: ", Error.LastMsg
        end if
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Jun 26, 2003 12:38 am   Post subject: (No subject)

well ether

a) get user to manually drop the font file into the folder Confused (bad)

or

b) since fonts are really images of letters, you can write your own Font. module using image files instead (complicated but you can use color) Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Mazer




PostPosted: Thu Jun 26, 2003 8:13 am   Post subject: (No subject)

nitro i tried pretty much exactly what you did. basically i had a few lines at the beginning of my program that checked if the file for the font i wanted to use was in the windows/fonts directory and if not it would copy the font into that folder then loop until the file exists in the fonts directory (this is to make sure that the font is existent when i go to define my font variables). it worked fine on my pc but when i tried it on the school computers it didnt work. so i said to myself: screw it, i'll just copy the fonts into the folder myself and make sure people only play my game on this computer Wink
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: