[Previous] [Contents] [Index] [Next]

PfAttach()

Attach to a font server

Synopsis:

#include <photon/Pf.h>

struct _Pf_ctrl *PfAttach( const char *device, 
                           long size );

Arguments:

device
The prefix name of the server; if this argument is NULL, the prefix is the value in the PHFONT environment variable, or /dev/phfont if this isn't set.
size
The size of an area in shared memory to set up between the task and the server for returning text bitmaps (normally required only by graphics drivers). If this argument is -1, the value of the PHFONTMEM environment variable is used; if size is 0, no such memory area is created.

Library:

ph

Description:

This function attaches to the font server.

PhAttach() calls PfAttach() as part of the standard Photon initialization sequence. The Pf library also automatically invokes PfAttach() when the library detects that the font server has been restarted. The font control structure pointer is stored in the global Photon control structure.

If you simply want to override the default font context, you can set the two environment variables (PHFONT and PHFONTMEM) to new values before performing standard Photon initialization, instead of calling this function directly.

If you want to use multiple font contexts, open them with PfAttach(), and then use the "Cx" versions of the font functions.

To detach from the font server, call PfDetach().

Returns:

A pointer to an internal control structure if successful, NULL otherwise.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PfDetach(), PfExtentCx(), PfExtentTextCharPositionsCx(), PfGenerateFontNameCx(), PfGetOutlineCx(), PfRenderCx()

Fonts chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]