![]()  | 
![]()  | 
![]()  | 
![]()  | 
![]()  | 
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. | 
Attach to a local font server
#include <font_api.h>
struct _Pf_ctrl* PfAttachDllCx( fontdll_t dll,
                                long size );
font
This routine allocates a font context structure, and connects to the local font server referred to by dll.
#include <font_api.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const * argv[])
{  fontdll_t dll;
   if((dll = PfAttachLocalDll(NULL, NULL)) != NULL)
   {  struct _Pf_ctrl * pf;
      if((pf = PfAttachDllCx(dll, 0)) != NULL)
      {  if(PfAllocRenderCx(pf, 32000) == 0)
         {  char const * name;
            long size = 0L;
            if(PfAllocDetailsCx(pf, &name, &size) == 0)
            {  if(name != NULL)
                 printf("shmem name %s, size %ld bytes.\n", name, size);
               else
                 printf("heap buffer size %d bytes.\n", abs(size));
            }
         }
         PfDetachCx(pf);
      }
      if((pf = PfAttachDllCx(dll, 0)) != NULL)
      {  if(PfAllocRenderCx(pf, -32000) == 0)
         {  char const * name;
            long size = 0L;
            if(PfAllocDetailsCx(pf, &name, &size) == 0)
            {  if(name != NULL)
                 printf("shmem name %s, size %ld bytes.\n", name, size);
               else
                 printf("heap buffer size %d bytes.\n", abs(size));
            }
         }
         PfDetachCx(pf);
      }
      PfDetachLocalDll(dll);
   }
   return(0);
}
Photon
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | Yes | 
Fonts chapter of the Photon Programmer's Guide
![]()  | 
![]()  | 
![]()  | 
![]()  |