[comp.sys.mac.hypercard] Installing fonts in stacks?

ireland@ac.dal.ca (04/11/90)

I'm writing a stack which has a text field which must use a non-proportional
font.  I've settle on Monaco 12 for ease of reading and I think it looks
better on the screen than Courier.  I've recently discovered that not all
Macs have Monaco 12 installed in the system.  Obviously when my stack is run
on such a machine the text looks awful.  I hope to distribute this stack
as happiware soon and wondered what the best solution to this problem is.
Is it OK to install Monaco 12 into my stack and distribute it?  When I opened
my system file with rescopy there were lots of font resources, some with
names, and other just with numbers, so I didn't know which contained Monaco 12.
So I reopened the system file with FontDA mover and it showed a Monaco 12
resource which I put into a new file because FontDA mover wouldn't recognize
my stack (maybe there's a trick to installing fonts in documents that I don't
know of).  Then I opened up this file containing only Monaco 12 with rescopy.
Rescopy displayed 3 files. Font #512 "Monaco" , size of 0 bytes; Font #524
size of 2906 bytes; and Fond #4 "Monaco", size of 60 bytes.  I copied all 3
into my stack, though I suspect that a resource of size 0 can't be doing much.
When I opened my stack all seemed fine until I opened a script window.  The
text in the script window looks bad, its probably Monaco 12 being scaled to
9 pt text.  Do I have to put Monaco 9 into my stack as well?  

Any help is greatly appreciated.   Keith

llkl@uhura.cc.rochester.edu (Laurie Kleiner) (04/12/90)

In article <1428@ac.dal.ca> ireland@ac.dal.ca writes:
>I'm writing a stack which has a text field which must use a non-proportional
>font.  I've settled on Monaco 12 for ease of reading and I think it looks
>better on the screen than Courier.  I've recently discovered that not all
>Macs have Monaco 12 installed in the system.  Obviously when my stack is run
>on such a machine the text looks awful.  I hope to distribute this stack
>as happiware soon and wondered what the best solution to this problem is.
>Is it OK to install Monaco 12 into my stack and distribute it?  When I opened


I had this problem with one of my stacks, too.  The easy solution is to install
the font resource right into your stack, like you would install an XCMD (I
believe you need two resources for one font, they should both have about the 
same name, just different types of resources, maybe someone else could 
elaborate on this).

However, this easy solutions has some problems - if the font is already 
installed in the system, you can get some strange system crashes and font
anomallies (in HyperCard, and in other programs if you don't reboot after
running the stack).

So, the preferred solution is to pack a suitcase with Monoco 9 and 12 along
with your stack, with documentation telling the user to install the font
in their system.

I think I got this information from Danny Goodman's (wordy but still PDG)
_Developer's Guide_.

-- 
-------------------------------------------------------------------------------
Laurie Kleiner                                      llkl@uhura.cc.rochester.edu 
            Old enough to know better, stupid enough to do it anyhow. 
-------------------------------------------------------------------------------

taylorj@yvax.byu.edu (04/13/90)

The problem is that if you install a font in your stack, only the sizes you
installed will be available.  Other sizes of the same font in the System will
be ignored.  So you'll need to install in your stack all needed sizes of the
font.

I recommend that you use Font/DA Mover to install the fonts in your stack,
instead of ResEdit.  Font/DA Mover makes sure all the required FOND and FONT
resources are copied correctly, and it handles font ID conflicts if you have
other fonts in the stack.  The trick is to hold down the option key when you
click Font/DA Mover's open button, then it will let you open any file, such as
your stack.

I don't agree with the recommendation to include the fonts separately and ask
the user to install them in his system.  This is not very Mac-like.  Anyone
should be able to simply pop in your disk and run your stack without being
required to muck about in the System file.  Those who are worried about extra
copies of fonts can move them from your stack to the System file if they feel
so inclined.


Jim Taylor
Microcomputer Support for Curriculum
Brigham Young University
taylorj@yvax.byu.edu

tim@hoptoad.uucp (Tim Maroney) (04/13/90)

In article <1428@ac.dal.ca> ireland@ac.dal.ca writes:
>Is it OK to install Monaco 12 into my stack and distribute it?

That's a very good question.  I do it, and so does everybody else,
because there's really no alternative.  It's certainly not user
friendly to tell people they have to modify their system file before
running your stackware.  On the other hand, there is a technical note
from Apple which says vaguely that there are known problems with
including fonts in document files, and that you shouldn't do it.  Given
the lack of alternatives in HyperCard, I think you have to just cross
your fingers and go ahead.

>When I opened
>my system file with rescopy there were lots of font resources, some with
>names, and other just with numbers, so I didn't know which contained Monaco 12.
>So I reopened the system file with FontDA mover and it showed a Monaco 12
>resource which I put into a new file because FontDA mover wouldn't recognize
>my stack (maybe there's a trick to installing fonts in documents that I don't
>know of).

Yes, there is a trick.  Don't just click the Open button in Font/DA Mover,
click it while holding down the Option key.  All files (or perhaps only
all files with resource forks; I'm not sure) will be displayed in the
file selection dialog.

>Then I opened up this file containing only Monaco 12 with rescopy.
>Rescopy displayed 3 files. Font #512 "Monaco" , size of 0 bytes; Font #524
>size of 2906 bytes; and Fond #4 "Monaco", size of 60 bytes.  I copied all 3
>into my stack, though I suspect that a resource of size 0 can't be doing much.
>When I opened my stack all seemed fine until I opened a script window.  The
>text in the script window looks bad, its probably Monaco 12 being scaled to
>9 pt text.  Do I have to put Monaco 9 into my stack as well?  

I doubt it, but you have discovered why it's generally a bad idea to
move fonts as resources.  Use Font/DA Mover.  With the option-open
trick, it should be more than adequate, and it will prevent this kind
of accident.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"Prisons are built with stones of Law, Brothels with bricks of Religion."
    - Blake, "The Marriage of Heaven and Hell"

phaedrus@milton.acs.washington.edu (The Wanderer) (04/15/90)

In article <11097@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
>In article <1428@ac.dal.ca> ireland@ac.dal.ca writes:
>>Is it OK to install Monaco 12 into my stack and distribute it?
[description of installation process deleted]
>>When I opened my stack all seemed fine until I opened a script window.  The
>>text in the script window looks bad, its probably Monaco 12 being scaled to
>>9 pt text.  Do I have to put Monaco 9 into my stack as well?  
>
>I doubt it, but you have discovered why it's generally a bad idea to
>move fonts as resources.  Use Font/DA Mover.  With the option-open
>trick, it should be more than adequate, and it will prevent this kind
>of accident.

     I don't have my manuals handy at the moment, but I think you probably
will have to install Monaco 9 as well.  If you try to, say, put Helvetica 48
in a file by itself, and use Suitcase to make it available when you need a
font that large, you'll find that all the other Helveticas go away.
     The problem is the FOND resource, which tells the system what font sizes
are available in a given font.  There has to be a FOND in your document file,
or the system won't recognize the FONT there at all.  The problem is that
while your document file is open, the OS will only look at the FOND in your
document, not the corresponding FOND in the System; since the document's FOND
contains no mention of the other font sizes, the OS won't use them.
     You might be able to edit the FOND in ResEdit to include the 9-point size
without actually installing the font in the stack, but I wouldn't recommend
it; you can run into all sorts of problems that way, particularly if for some
reason Monaco 9 actually wasn't installed (say, if someone had changed the
application font).  As a rule, whenever you want to install a font in a
document, you have to install all sizes of that font that might be used while
the document is open, even if that results in duplications between the
document and the System.  This is another reason not to install fonts in
documents; they become larger than your font files.  (Of course, as Tim
mentioned, HyperCard really doesn't leave you many choices.)


-- 
Internet: phaedrus@u.washington.edu        (University of Washington, Seattle)
  The views expressed here are not those of this station or its management.
   "If you can keep your head while those about you are losing theirs,
      consider an exciting career as a guillotine operator!"