[comp.windows.ms.programmer] Font Resource saga ....

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

In article <1991Apr9.100804.26613@qut.edu.au> drift@qut.edu.au (Glenn Wallace) writes:
>A while back there was talk about font resources.
[...]
>2) I thought ... stuff it, I'll put my fonts in my DLL, as they are reasonably
>   private to what my DLL is doing. So I do a AddFontResource in my LibMain
>   to make them available after load time as follows;
>
>   nf = AddFontResource(MAKEINTRESOURCE(hInstance));   // something like that..
>
>   and I still get a BIG FAT 0 from AddFontResource.
[...]
>   Anyone got any clues with AddFontResource????

Well this works for me, I can only imagine that you are not using the
correct linker (I'm using the one that comes with C6.00) or have a
bugette in your .def or .rc file somewhere (make sure you have read the
readme.WRI file that comes with the SDK).  I had no joy, though, when I
tried to rc the font into my .exe, perhaps AddFontResource doesn't like
fonts in the code that it is currently executing?!?!  The other thing I do is
that I have the file in the same directory as the .exe and the dll
really has nothing else in it, although I don't see why either of these
should make any difference.

If you're still really stuck mail me and I'll see if I can knock together
some source you could use and mail it to you (however, I hope you're not
in a hurry, I'm fairly busy at the moment).

>Help! Summary of mailed replies will be posted.

As for compiling up a .fon file... ZERO I'm afraid.
There are a few of us pursuing this at the moment, perhaps we should start
up a comp.microsoft.windows.programmer.font.problems mailing list ;-)
(just joking!!) I dare say there will be a spate of postings if we find or
hear anything moing.

--
      -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 :-)

drift@qut.edu.au (Glenn Wallace) (04/09/91)

A while back there was talk about font resources.

To summarise, there were two problems:

1) Create an EXE (.FON file) with no code it it, just font resources as
   recommended by MS.

2) using AddFontResource to get at 'em.

well..

1) I tried this, using FONTRES.ARC from Online (for Windows 2.0) which has a
   "null" asm file to linkto produce an exe so that rc can hook in the fonts.
   I had the same link5.1 problem ..... any ideas anyone? What's the answer?

2) I thought ... stuff it, I'll put my fonts in my DLL, as they are reasonably
   private to what my DLL is doing. So I do a AddFontResource in my LibMain
   to make them available after load time as follows;

    nf = AddFontResource(MAKEINTRESOURCE(hInstance));   // something like that..

   and I still get a BIG FAT 0 from AddFontResource.

   The fonts are definitely in the DLL because WRT can see them (but not edit
   them :-(  ).

   Anyone got any clues with AddFontResource????

Wasn't anything on this on OnLine either...

Help! Summary of mailed replies will be posted.

PS Thanks for the replies to the NetBios problem.

+-------------------+-----------------------------------------+
| Glenn Wallace     | Net: drift@qut.edu.au                   |
| Drift Project     | Fone: +61 7 837-7126 Fax: +61 7 221-0173|
| Telecom Australia | Snail: 11th Flr 144 Edward St.,         |
+-------------------+        Brisbane, Q4000 Australia        |
|                                                             |
| Disclaimer - The opinions expressed must be my own, because |
|              Telecom is a statuatory authority and as such, |
|              is not capable of having opinions.             |
+-------------------------------------------------------------+