Board index » delphi » fonts dont work

fonts dont work

I'm using different fonts (graph) and I'm not
sure which files I need to keep in the directory my 'initgraph' call points to.
I've got a few files, (example goth.chr), but the fonts still aren't showing up
in the program.  Which others do I need to include?
 

Re:fonts dont work


"Rzr03" <rz...@cs.com> schreef in bericht
news:20020608153112.00660.00000249@mb-ci.news.cs.com...

Quote
> I'm using different fonts (graph) and I'm not
> sure which files I need to keep in the directory my 'initgraph' call
points to.
> I've got a few files, (example goth.chr), but the fonts still aren't
showing up
> in the program.  Which others do I need to include?

Only the fonts that you use, are to be found by the program.

Usually the trick is to pass the location of where the fonts are located.
(C:\TP\BGI)

So use

Initgraph(graphmode,graphdriver,'C:\TP\BGI');

If you leave this field blanco, the program searches in the dos current
directory, which is usually also the running directory of the program. If
you run the program from within the IDE and have the option "compile to
memory" set, this is possibly another the directory, ..TP\BIN where TP
itself is installed. In that case the program may not be able to find the
drivers.

Femme

Re:fonts dont work


What I want to be able to do is have my program on a disk and use it on any
computer, even ones that don't have TP installed. So pointing it to 'C:\TP\BGI'
wont work. I need to know which files i need to put on my disk so that I can
run it anywhere.

Re:fonts dont work


"Rzr03" <rz...@cs.com> schreef in bericht
news:20020609170423.21966.00000051@mb-ft.news.cs.com...

Quote
> What I want to be able to do is have my program on a disk and use it on
any
> computer, even ones that don't have TP installed. So pointing it to
'C:\TP\BGI'
> wont work. I need to know which files i need to put on my disk so that
I can
> run it anywhere.

It that case I would always include all the font drivers in the directory
of the program. You can use the solution I posted a few days ago.

uses tstdirs,......

....
initgraph(graphmode,graphdriver,progdirectory);

Will work, even if the program is started from another Dos directory.

Femme

Re:fonts dont work


I've copied every single file from the BGI directory onto my disk, and it still
will not work.

Re:fonts dont work


Well I don't realy understand this, but this is what happened:
As I said, I tried putting all the files from the BGI folder onto my disk and
it did not work. So I tried it again, except this time I put the files in a
folder on the disk called BGI, and pointed initgraph to that. Now it works. So
my problem is solved.. but why did that work?

Re:fonts dont work


In article <20020609170423.21966.00000...@mb-ft.news.cs.com>,

Quote
Rzr03 <rz...@cs.com> wrote:
>What I want to be able to do is have my program on a disk and use it on any
>computer, even ones that don't have TP installed. So pointing it to 'C:\TP\BGI'
>wont work. I need to know which files i need to put on my disk so that I can
>run it anywhere.

There's a way to put the graphics drivers and the fonts into a .tpu. Then
in your program put a uses clause for that .tpu file then it'll all get
compiled into the executable. On my system there's a directory called
\bp\examples\dos\bgi that contains code samples on how to make the .tpu
files.
--
john R. Latala
jrlat...@golden.net

Re:fonts dont work


"Rzr03" <rz...@cs.com> schreef in bericht
news:20020609191723.07555.00000321@mb-cf.news.cs.com...

Quote
> Well I don't realy understand this, but this is what happened:
> As I said, I tried putting all the files from the BGI folder onto my
disk and
> it did not work. So I tried it again, except this time I put the files
in a
> folder on the disk called BGI, and pointed initgraph to that. Now it
works. So
> my problem is solved.. but why did that work?

Dozens of things can cause the non functioning, but telling the program
where the drivers are to be found, solved the problem. E.g. if the
program is on a floppy disk an you are working in Dos, start the program
by entering  A:\myprog will leave the C disk dos current and the program
will be unable to find the drivers.
Without further information I can't see or guess from here what you did
wrong.

The disadvantage now is that there must be a directory with that exact
name. If you would have used my solution, it is sufficient to copy the
program to whatever directory you want and it works.

Femme

Other Threads