[comp.windows.ms.programmer] Trouble creating fonts.

pjr@pyra.co.uk (Peter Ruczynski) (04/03/91)

#include <std/excuses.h>

I'm trying to set up a font which I have desingned using the font
editor so I have a .fnt file, I also have C6.0 SDK3.0 and masm5.10.

First I thought I'd try to create a .fon system resource library...  No
joy!  I tried various permutations of the example given in the MS Guide
to programming (18.12) but my linker (not link4 by the way, but the one
you get with C6.0) keeps telling me that I have no segments defined and
bombs out, putting a NOP instruction in the asm code let it compile
but it's no longer an allowable format as it has segs.

I have three theories for the above:
1. is that there is a switch to link that I don't know about
2. there is a piece of special asm code somewhere which I don't know
	about (something like the code you get for creating dlls)
or
3. I need link4!

So, next I thought I'd try and rc it into my .exe pick it up using
AddFontResource ala the tips.txt file which comes with the SDK...  No
joy yet again, AddFontResource returns null every time.
I have absolutely no theories on this one... it just don't work!

Am I missing something fundamental here or have Microsoft managed to
hide a vital piece of info so well that I just can't find it?

If this has been covered before then could someone mail me a resume of
the mail thread.  If not please email me and I'll post a resume if
there is something missing in the SDK/documentation.

Thanks

Pete.

--
      -w---------    Pyramid Technology U.K.       Peter Ruczynski    
    ---www-------    Pyramid House                 #include <std/disclaimer.h>
  -----wwwww-----    Farnborough                   pjr@pyra.co.uk
-------wwwwwww---    Hants GU14 7PL     England.   Wot no funny comment :-)

mmshah@athena.mit.edu (Milan M Shah) (04/05/91)

>First I thought I'd try to create a .fon system resource library...  No
>joy!  I tried various permutations of the example given in the MS Guide
>to programming (18.12) but my linker (not link4 by the way, but the one
>you get with C6.0) keeps telling me that I have no segments defined and
>bombs out, putting a NOP instruction in the asm code let it compile
>but it's no longer an allowable format as it has segs.
>
  This is a known bug in the link program that comes with C6.0 and was
  not fixed in C6.0a. Link just plain and simple won't link this file.

>I have three theories for the above:
>1. is that there is a switch to link that I don't know about
  There is an undocumented switch, but not to link. From what I understand,
  even though link aborts with an error, it has created the correct .exe
  file. However, it has "set the error bit" in the exefile header. Now, there
  is an undocumented switch to rc that clears this "error bit". But here's
  the catch ... I forgot!!! I even tried doing a rc -<x> where I tried every
  letter for x, but couldn't get it to work. However, I know such a switch
  exists, because I did get it to work once.
 
>2. there is a piece of special asm code somewhere which I don't know
>	about (something like the code you get for creating dlls)
  Nyet.

>or
>3. I need link4!
>
  This will fix the problem as well (and is the method I use, which explains
  how I lost the above info). However, link4 is no longer available, even 
  from Microsoft, so only people with SDK 2.11 win.

Big question of the day - how did Microsoft create their fonts?

Hope this helps.

Milan
.

risto@tuura.UUCP (Risto Lankinen) (04/08/91)

mmshah@athena.mit.edu (Milan M Shah) writes:

>>1. is that there is a switch to link that I don't know about
>  There is an undocumented switch, but not to link. From what I understand,
>  even though link aborts with an error, it has created the correct .exe
>  file. However, it has "set the error bit" in the exefile header. Now, there
>  is an undocumented switch to rc that clears this "error bit". ...

Well, 'EXEHDR/R errlink.exe' does what you suggest.  Haven't tried whether it
solves the font problem, though.

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto@yj.data.nokia.fi     ***************************************

richgi@microsoft.UUCP (Richard GILLMANN) (04/09/91)

In article <1991Apr5.144739.20527@athena.mit.edu> mmshah@athena.mit.edu (Milan M Shah) writes:
:   even though link aborts with an error, it has created the correct .exe
:   file. However, it has "set the error bit" in the exefile header. Now, there
:   is an undocumented switch to rc that clears this "error bit". But here's
:   the catch ... I forgot!!! I even tried doing a rc -<x> where I tried every
:   letter for x, but couldn't get it to work. However, I know such a switch
:   exists, because I did get it to work once.

exehdr /reset will do the trick.

pjr@pyra.co.uk (Peter Ruczynski) (04/10/91)

In article <1147@tuura.UUCP> risto@tuura.UUCP (Risto Lankinen) writes:
>mmshah@athena.mit.edu (Milan M Shah) writes:
>
>>>1. is that there is a switch to link that I don't know about
>>  There is an undocumented switch, but not to link. From what I understand,
>>  even though link aborts with an error, it has created the correct .exe
>>  file. However, it has "set the error bit" in the exefile header. Now, there
>>  is an undocumented switch to rc that clears this "error bit". ...

Err?!?!  I wrote the original article/question but I haven't seen this post!
Could someone mail it to me as the most important bit seems to be missing
(i.e. the actual switch to rc!) from this precis.

>Well, 'EXEHDR/R errlink.exe' does what you suggest.  Haven't tried whether it
>solves the font problem, though.

I'll try this when I get around to finally trying to create .fon files again.
At the moment I'm happy using a screwey dll and AddFontResource()!

>Terveisin: Risto Lankinen

Pete.

--
      -w---------    Pyramid Technology U.K.       Peter Ruczynski    
    ---www-------    Pyramid House                 #include <std/disclaimer.h>
  -----wwwww-----    Farnborough                   pjr@pyra.co.uk
-------wwwwwww---    Hants GU14 7PL     England.   Wot no funny comment :-)