Can You Help?

If so, contact me!

Text Sizing: In the FWCAddEvent macro, the event text is sized to fit in the allowed space as determined by the number of days the event spans. Because the user is likely to be using proportional fonts for rendering text, I can't pre-determine how many text characters will fit in the allowed space. The sizing routine, then, involves:

  1. Rendering the text
  2. Get the length of the rendered text
  3. Compare this length to the allowed space
  4. If the text is too long, drop the last word (move it to the next line)
  5. Repeat at step one for the remaining text (and then for the remaining lines)

Although this process works, it seems rather cumbersome and time consuming. Do you have any ideas on how to more efficiently fit a line of text into a limited space?

Moon Phases: The routine I found for determining the phases of the moon seems to be accurate for the new moon and the full moon (within a few minutes) when compared to the moon phase tables available from the US Naval Observatory. My interpolations to come up with the first and last quarters, though, can be off by a day in many cases. Do you know of a fairly simple routine for calculating the four phases of the moon (new moon, first quarter, full moon, third quarter)?