[comp.sys.mac.programmer] Changing Menu Font and Word Break routines

djvelleman@amherst.bitnet (08/20/90)

I'm writing an application which has its own font containing some special
symbols.  I'm trying to do two things that seem to be harder than they
should be:
1.  I want to use my font in a menu.  I know I can write a MDEF to do this,
but I don't want to duplicate all the work in the standard MDEF.  There must
be an easier way.  I tried writing a MDEF which switches fonts,
calls the standard MDEF, and then switches back to the system font, but the
standard MDEF seems to set the font to the system font itself.  I tried a MDEF
which changes the system font and then calls the standard MDEF, and that didn't
work either.  (I'm not sure why.  Maybe I did it wrong.)  A hack that works:
a MDEF that changes fonts, calls a copy of the standard MDEF which has been
doctored by changing all calls to TextFont to NOP, and then changes fonts
back.  There must be a better way.
2.  I want to use my font in a TextEdit record, and I want to have line breaks
not only after spaces, but also after a few other special characters.  I tried
writing a word break routine, but it didn't seem to work as described in IM.
Has anyone gotten a custom word break routine to work?  A hack that does work
for this:  use ascii codes <32 for the symbols at which a line can break.  This
may actually be the best solution, but is it dangerous?  Obviously, I have
to avoid some ascii codes, like CR.  Which ones are safe to use?
  Thanks for any help.
    Dan Velleman
    Math Dept.
    Amherst College
    Bitnet:  djvelleman@amherst