Load a font server
#include <font_api.h> int PfAttachServerDll( fontdll_t dll, int prio, char const *device );
font
This function loads a local font server thread for the provided dll context. The function attempts to attach a resource manager server thread, which attaches all relevant device names. This is useful only if no external server is running, and you want this application to function as the default font server. The application must have an effective user ID of root in order for this approach to succeed.
Since this behaviour encorporates handling of dynamic font loading, this routine will return an error if a sleuth thread is already in service. That is, if the application has already successfully called PfAttachSleuthMonitorDll(), PfAttachServerDll() will fail, and vice versa.
This routine overwrites the local PHFONT environment variable if the device parameter is not NULL. |
If the resource manager registers the default font server device (which is the same as the global PHFONT environment variable) successfully, the application should register a SIGUSR2 signal handler. In some instances of dynamic font loading, the application is signalled by SIGUSR2 to request a restart of the server thread. The application should handle the request, then at the next available time, invoke the function PfRestartServerDll(). Otherwise, the application should block the SIGUSR2 signal if you do not wish it to honor such requests.
If the server thread attaches a device name other than the default specified by the global PHFONT environment variable, then it is not notified of dynamic font changes unless directly messaged.
See the example in PfAttachLocalDll().
Photon
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
PfAttachLocalDll(), PfAttachSleuthMonitorDll(), PfRestartServerDll().
Fonts chapter of the Photon Programmer's Guide