Computer Science Canada

Importing a Font File

Author:  Nitro [ 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

Author:  Tony [ Thu Jun 26, 2003 12:38 am ]
Post 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

Author:  Mazer [ Thu Jun 26, 2003 8:13 am ]
Post 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


: