Rotating Text in Photon

All-
Does anyone know how to rotate text in Photon? I’m displaying text
using the PgDrawText function. I see that there is a PgSetRotation in the
PhProto.h header file but no definition in the helpviewer. Any help would
be useful. I’m trying to do this in QNX4 as well but 6 would work also.
Thanks

Jeff

Jeff Holtz <holtzj@mediaone.net> wrote:

All-
Does anyone know how to rotate text in Photon? I’m displaying text
using the PgDrawText function. I see that there is a PgSetRotation in the
PhProto.h header file but no definition in the helpviewer. Any help would
be useful. I’m trying to do this in QNX4 as well but 6 would work also.
Thanks

Jeff

This is almost impossible in QNX4, and difficult in QNX6.

In QNX4, it is nasty:

Use the extern declaration for Ph, and save Ph->font.
Call PfAttach(NULL, 32000), and if non-NULL, place the
result in Ph->font. When you are finished, you can
call PfDetach, and place the old value in Ph->font.

In between PfAttach, and PfDetach, you can use the
the PfRenderText routine, which has a callback, that
provides the whole bitmap, or partial (depending on size),
which you can manipulate in any method you desire. The
problem is that you have to convert the FontRender stuff
to a PhImage_t equivalent, and draw the image when you
are ready. There are different image types, that I cannot
recall, which you can use if FontRender->bpp is 4 or 8.

In QNX6.2, you can use PfAttachCx, PfDetach, and PfRenderCx,
so that you do not have to override the Ph->font reference.

In QNX6.2, you can also use PfGetOutline/PfGetOulineCx, which returns a
vector representation. This allows you to transform the
points any way you wish. The issue with this method, is
that one must “colour” the drawing himself, since the
information is all vector based. The “colouring” can be
done manually, checking which areas need to be flood filled,
or you can use what they call an font odd-even filling algorithm,
which I cannot help you wish, since I an unaware currently
as to how to implement it.

Regards.