Resource availability: fonts

Tyro[a.c.edwards] nospam at home.com
Wed May 6 05:07:02 PDT 2009


On 5/6/2009 12:30 PM, Daniel Keep wrote:
>
> Tyro[a.c.edwards] wrote:
>> One cannot necessarily rely on particular font being available on a system, and for security reasons asminsistrators restrict instalation of fonts (among other things) onto systems in a network. I would like to know if it is possible to embed a font into my code so that I know that it will always be there, or can I provide it with the exe but not have to rely on it being "installed" (i.e. use it from the same folder in which the exe resides)?
>>
>> Thanks,
>> Andrew
>
> That depends.  What are you using the font for?
>
> If you're using a library that requires a family name, then probably
> not.  If you're using a library that can accept a file name, then
> probably yes.

I'm using DFL which uses family names (eg. "Times New Roman").

> Remember that the system doesn't care if you append crap to the end of
> an executable.  One trick you can use is to just append whatever files
> you want to the end of the executable, and then have a little 1K block
> at the end that tells you where the files are and how big they are; you
> can then extract the files at run time and delete them when you terminate.
>

When I do this, how do I ensure that the program is able to locate the 
font after extraction without "installing" it?

>    -- Daniel


More information about the Digitalmars-d-learn mailing list